diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 0318cbcd5bf..85f0c537806 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -705,6 +705,7 @@ class Orders extends DolibarrApi * @param int $id Order ID * @param int $idwarehouse Warehouse ID * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return Object Object with cleaned properties * * @url POST {id}/validate * @@ -712,8 +713,6 @@ class Orders extends DolibarrApi * @throws RestException 401 * @throws RestException 404 * @throws RestException 500 System error - * - * @return array */ public function validate($id, $idwarehouse = 0, $notrigger = 0) { diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php index b97175f1397..2e01fae85cf 100644 --- a/htdocs/core/class/html.formorder.class.php +++ b/htdocs/core/class/html.formorder.class.php @@ -78,7 +78,7 @@ class FormOrder extends Form * @param string $selected Id of preselected input method * @param string $htmlname Name of HTML select list * @param int $addempty 0=list with no empty value, 1=list with empty value - * @return array Tableau des sources de commandes + * @return int <0 if KO, >0 if OK */ public function selectInputMethod($selected = '', $htmlname = 'source_id', $addempty = 0) { diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 174f79b099e..4792c8b67b5 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1995,7 +1995,7 @@ class Holiday extends CommonObject * Return list of people with permission to validate leave requests. * Search for permission "approve leave requests" * - * @return array Array of user ids + * @return array|int Array of user ids or -1 if error */ public function fetch_users_approver_holiday() { diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index eb7e1579261..775c81425d6 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -267,12 +267,11 @@ class Tasks extends DolibarrApi /** * Get roles a user is assigned to a task with * - * @param int $id Id of task - * @param int $userid Id of user (0 = connected user) + * @param int $id Id of task + * @param int $userid Id of user (0 = connected user) + * @return array Array of roles * * @url GET {id}/roles - * - * @return int */ public function getRoles($id, $userid = 0) { @@ -301,6 +300,7 @@ class Tasks extends DolibarrApi foreach ($this->task->roles as $line) { array_push($result, $this->_cleanObjectDatas($line)); } + return $result; } diff --git a/htdocs/reception/class/api_receptions.class.php b/htdocs/reception/class/api_receptions.class.php index 5e4c68fe468..a7b8bdb02ce 100644 --- a/htdocs/reception/class/api_receptions.class.php +++ b/htdocs/reception/class/api_receptions.class.php @@ -60,7 +60,6 @@ class Receptions extends DolibarrApi * * @param int $id ID of reception * @return Object Object with cleaned properties - * * @throws RestException */ public function get($id) @@ -386,14 +385,12 @@ class Receptions extends DolibarrApi /** * Delete a line to given reception * - * * @param int $id Id of reception to update * @param int $lineid Id of line to delete + * @return array * * @url DELETE {id}/lines/{lineid} * - * @return int - * * @throws RestException 401 * @throws RestException 404 */ @@ -412,23 +409,27 @@ class Receptions extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - // TODO Check the lineid $lineid is a line of ojbect + // TODO Check the lineid $lineid is a line of object $updateRes = $this->reception->deleteline(DolibarrApiAccess::$user, $lineid); - if ($updateRes > 0) { - return $this->get($id); - } else { + if ($updateRes < 0) { throw new RestException(405, $this->reception->error); } + + return array( + 'success' => array( + 'code' => 200, + 'message' => 'Line deleted' + ) + ); } /** * Update reception general fields (won't touch lines of reception) * - * @param int $id Id of reception to update - * @param array $request_data Datas - * - * @return int + * @param int $id Id of reception to update + * @param array $request_data Datas + * @return Object Object with cleaned properties */ public function put($id, $request_data = null) { @@ -462,7 +463,6 @@ class Receptions extends DolibarrApi * Delete reception * * @param int $id Reception ID - * * @return array */ public function delete($id) diff --git a/htdocs/recruitment/class/api_recruitment.class.php b/htdocs/recruitment/class/api_recruitment.class.php index 9162a6250f3..c8e21a3e029 100644 --- a/htdocs/recruitment/class/api_recruitment.class.php +++ b/htdocs/recruitment/class/api_recruitment.class.php @@ -407,9 +407,9 @@ class Recruitment extends DolibarrApi /** * Update jobposition * - * @param int $id Id of jobposition to update - * @param array $request_data Datas - * @return int + * @param int $id Id of jobposition to update + * @param array $request_data Datas + * @return Object Object with cleaned properties * * @throws RestException * @@ -450,9 +450,9 @@ class Recruitment extends DolibarrApi /** * Update candidature * - * @param int $id Id of candidature to update - * @param array $request_data Datas - * @return int + * @param int $id Id of candidature to update + * @param array $request_data Datas + * @return Object Object with cleaned properties * * @throws RestException *