diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index a47017446bb..d551f6b5af9 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -313,9 +313,9 @@ class Members extends DolibarrApi /** * Update member * - * @param int $id ID of member to update - * @param array $request_data Datas - * @return Object Updated object + * @param int $id ID of member to update + * @param array $request_data Datas + * @return Object Updated object * * @throws RestException 403 Access denied * @throws RestException 404 Member not found diff --git a/htdocs/adherents/class/api_memberstypes.class.php b/htdocs/adherents/class/api_memberstypes.class.php index f055542d6b4..c3d0e374746 100644 --- a/htdocs/adherents/class/api_memberstypes.class.php +++ b/htdocs/adherents/class/api_memberstypes.class.php @@ -179,9 +179,9 @@ class MembersTypes extends DolibarrApi /** * Update member type * - * @param int $id ID of member type to update - * @param array $request_data Datas - * @return int + * @param int $id ID of member type to update + * @param array $request_data Datas + * @return Object Updated object * * @throws RestException 403 Access denied * @throws RestException 404 No Member Type found diff --git a/htdocs/adherents/class/api_subscriptions.class.php b/htdocs/adherents/class/api_subscriptions.class.php index 285a1948602..a5f27263cbd 100644 --- a/htdocs/adherents/class/api_subscriptions.class.php +++ b/htdocs/adherents/class/api_subscriptions.class.php @@ -176,9 +176,9 @@ class Subscriptions extends DolibarrApi /** * Update subscription * - * @param int $id ID of subscription to update - * @param array $request_data Datas - * @return Object + * @param int $id ID of subscription to update + * @param array $request_data Datas + * @return Object Updated object * * @throws RestException 403 Access denied * @throws RestException 404 No Subscription found diff --git a/htdocs/bom/class/api_boms.class.php b/htdocs/bom/class/api_boms.class.php index 464f4193f35..6f1e8b31ced 100644 --- a/htdocs/bom/class/api_boms.class.php +++ b/htdocs/bom/class/api_boms.class.php @@ -180,7 +180,7 @@ class Boms extends DolibarrApi * Create bom object * * @param array $request_data Request datas - * @return int ID of bom + * @return int ID of bom * * @throws RestException 403 Access denied * @throws RestException 500 Error retrieving list of boms @@ -214,10 +214,9 @@ class Boms extends DolibarrApi /** * Update bom * - * @param int $id Id of bom to update - * @param array $request_data Datas - * - * @return int + * @param int $id Id of bom to update + * @param array $request_data Datas + * @return Object Object after update * * @throws RestException 403 Access denied * @throws RestException 404 BOM not found diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index b938298f2c1..79b5007a241 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -218,9 +218,9 @@ class Categories extends DolibarrApi /** * Update category * - * @param int $id Id of category to update - * @param array $request_data Datas - * @return int + * @param int $id Id of category to update + * @param array $request_data Datas + * @return Object Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 9c266c92cb6..6aa5bd090d8 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -229,10 +229,9 @@ class AgendaEvents extends DolibarrApi /** * Update Agenda Event general fields * - * @param int $id Id of Agenda Event to update - * @param array $request_data Datas - * - * @return Object|false Object with cleaned properties + * @param int $id Id of Agenda Event to update + * @param array $request_data Datas + * @return Object|false Object with cleaned properties */ public function put($id, $request_data = null) { diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index b4f5c8ffcea..cee27733140 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -480,10 +480,9 @@ class Contracts extends DolibarrApi /** * Update contract general fields (won't touch lines of contract) * - * @param int $id Id of contract to update - * @param array $request_data Datas - * - * @return array|mixed + * @param int $id Id of contract to update + * @param array $request_data Datas + * @return Object Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index c8e3e94527f..5e13d12bd35 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -209,10 +209,9 @@ class Donations extends DolibarrApi /** * Update order general fields (won't touch lines of order) * - * @param int $id Id of order to update - * @param array $request_data Datas - * - * @return int + * @param int $id Id of order to update + * @param array $request_data Datas + * @return Object Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index d46d7e57ea5..2eb5f95d05e 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -419,10 +419,9 @@ class Shipments extends DolibarrApi /** * Update shipment general fields (won't touch lines of shipment) * - * @param int $id Id of shipment to update - * @param array $request_data Datas - * - * @return int + * @param int $id Id of shipment to update + * @param array $request_data Datas + * @return Object Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index cfa8ecfb6df..d8e650fb88d 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -407,10 +407,9 @@ class ExpenseReports extends DolibarrApi /** * Update Expense Report general fields (won't touch lines of expensereport) * - * @param int $id Id of Expense Report to update - * @param array $request_data Datas - * - * @return int + * @param int $id Id of Expense Report to update + * @param array $request_data Datas + * @return Object Updated object * * @throws RestException 401 Not allowed * @throws RestException 404 Expense report not found diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index c96182ec545..38ade727330 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -229,10 +229,9 @@ class SupplierInvoices extends DolibarrApi /** * Update supplier invoice * - * @param int $id Id of supplier invoice to update - * @param array $request_data Datas - * - * @return int + * @param int $id Id of supplier invoice to update + * @param array $request_data Datas + * @return Object|false Updated object * * @throws RestException 403 * @throws RestException 404 diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index bcc657c5a7f..156b395c377 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -257,9 +257,9 @@ class SupplierOrders extends DolibarrApi /** * Update supplier order * - * @param int $id Id of supplier order to update - * @param array $request_data Datas - * @return int + * @param int $id Id of supplier order to update + * @param array $request_data Datas + * @return Object|false Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php b/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php index 90d222b0e59..8bb3e044889 100644 --- a/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php +++ b/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php @@ -257,9 +257,9 @@ class KnowledgeManagement extends DolibarrApi /** * Update knowledgerecord * - * @param int $id Id of knowledgerecord to update - * @param array $request_data Datas - * @return int + * @param int $id Id of knowledgerecord to update + * @param array $request_data Datas + * @return Object Updated object * * @throws RestException * diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index 615bd359b21..1908a2a0b4b 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -224,9 +224,9 @@ class MyModuleApi extends DolibarrApi /** * Update myobject * - * @param int $id Id of myobject to update - * @param array $request_data Datas - * @return int + * @param int $id Id of myobject to update + * @param array $request_data Datas + * @return Object Object after update * * @throws RestException 403 Not allowed * @throws RestException 404 Not found diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index d11b66915c4..2951c1069eb 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -204,10 +204,9 @@ class Mos extends DolibarrApi /** * Update MO * - * @param int $id Id of MO to update - * @param array $request_data Datas - * - * @return int + * @param int $id Id of MO to update + * @param array $request_data Datas + * @return Object Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/multicurrency/class/api_multicurrencies.class.php b/htdocs/multicurrency/class/api_multicurrencies.class.php index 8ec5efacd91..3158263c0b7 100644 --- a/htdocs/multicurrency/class/api_multicurrencies.class.php +++ b/htdocs/multicurrency/class/api_multicurrencies.class.php @@ -235,9 +235,9 @@ class MultiCurrencies extends DolibarrApi /** * Update Currency * - * @param int $id Id of Currency to update - * @param array $request_data Datas - * @return array The updated Currency + * @param int $id Id of Currency to update + * @param array $request_data Datas + * @return Object The updated Currency * * @throws RestException */ diff --git a/htdocs/partnership/class/api_partnerships.class.php b/htdocs/partnership/class/api_partnerships.class.php index b1b23066143..0fda760e704 100644 --- a/htdocs/partnership/class/api_partnerships.class.php +++ b/htdocs/partnership/class/api_partnerships.class.php @@ -217,9 +217,9 @@ class Partnerships extends DolibarrApi /** * Update partnership * - * @param int $id Id of partnership to update - * @param array $request_data Datas - * @return int + * @param int $id Id of partnership to update + * @param array $request_data Datas + * @return Object Updated object * * @throws RestException * diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 2f57093862e..48ab72e66d4 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -332,17 +332,15 @@ class Products extends DolibarrApi * Update product. * Price will be updated by this API only if option is set on "One price per product". See other APIs for other price modes. * - * @param int $id Id of product to update - * @param array $request_data Datas - * @return int + * @param int $id Id of product to update + * @param array $request_data Datas + * @return Object Updated object * * @throws RestException 401 * @throws RestException 404 */ public function put($id, $request_data = null) { - global $conf; - if (!DolibarrApiAccess::$user->hasRight('produit', 'creer')) { throw new RestException(403); } diff --git a/htdocs/product/stock/class/api_stockmovements.class.php b/htdocs/product/stock/class/api_stockmovements.class.php index b0a460f7b97..e2457e09f8d 100644 --- a/htdocs/product/stock/class/api_stockmovements.class.php +++ b/htdocs/product/stock/class/api_stockmovements.class.php @@ -211,9 +211,9 @@ class StockMovements extends DolibarrApi /** * Update stock movement * - * @param int $id Id of warehouse to update - * @param array $request_data Datas - * @return int + * @param int $id Id of warehouse to update + * @param array $request_data Datas + * @return Object Updated object */ /* public function put($id, $request_data = null) diff --git a/htdocs/product/stock/class/api_warehouses.class.php b/htdocs/product/stock/class/api_warehouses.class.php index c03ba11c01d..e39ede65299 100644 --- a/htdocs/product/stock/class/api_warehouses.class.php +++ b/htdocs/product/stock/class/api_warehouses.class.php @@ -188,9 +188,9 @@ class Warehouses extends DolibarrApi /** * Update warehouse * - * @param int $id Id of warehouse to update - * @param array $request_data Datas - * @return int + * @param int $id Id of warehouse to update + * @param array $request_data Datas + * @return Object Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index 896c1219653..b3637643169 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -438,10 +438,9 @@ class Projects extends DolibarrApi /** * Update project general fields (won't touch lines of project) * - * @param int $id Id of project to update - * @param array $request_data Datas - * - * @return int + * @param int $id Id of project to update + * @param array $request_data Datas + * @return Object Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 28304406505..89907456672 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -435,10 +435,9 @@ class Tasks extends DolibarrApi /** * Update task general fields (won't touch time spent of task) * - * @param int $id Id of task to update - * @param array $request_data Datas - * - * @return int + * @param int $id Id of task to update + * @param array $request_data Datas + * @return Object Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/salaries/class/api_salaries.class.php b/htdocs/salaries/class/api_salaries.class.php index 6baa75b88ae..693c1978b31 100644 --- a/htdocs/salaries/class/api_salaries.class.php +++ b/htdocs/salaries/class/api_salaries.class.php @@ -162,9 +162,9 @@ class Salaries extends DolibarrApi /** * Update salary * - * @param int $id ID of salary - * @param array $request_data data - * @return int + * @param int $id ID of salary + * @param array $request_data Data + * @return Object Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index eda54cd3d41..7fd087024c3 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -309,9 +309,9 @@ class Contacts extends DolibarrApi /** * Update contact * - * @param int $id Id of contact to update - * @param array $request_data Datas - * @return int + * @param int $id Id of contact to update + * @param array $request_data Datas + * @return Object Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index b7273e7fe6b..8dc6b56262f 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -273,9 +273,9 @@ class Thirdparties extends DolibarrApi /** * Update thirdparty * - * @param int $id Id of thirdparty to update - * @param array $request_data Datas - * @return array|mixed|boolean + * @param int $id Id of thirdparty to update + * @param array $request_data Datas + * @return Object|false Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 0b7f6625847..6163ae449b2 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -353,10 +353,9 @@ class Tickets extends DolibarrApi /** * Update ticket * - * @param int $id Id of ticket to update - * @param array $request_data Datas - * @return int - * + * @param int $id Id of ticket to update + * @param array $request_data Datas + * @return Object Updated object */ public function put($id, $request_data = null) { diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index d2f406442b2..ac40da2c6df 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -350,7 +350,7 @@ class Users extends DolibarrApi * * @param int $id Id of account to update * @param array $request_data Datas - * @return array|mixed Record after update + * @return Object Updated object * * @throws RestException 403 Not allowed * @throws RestException 404 Not found diff --git a/htdocs/zapier/class/api_zapier.class.php b/htdocs/zapier/class/api_zapier.class.php index 30ab25c938d..b18dd175029 100644 --- a/htdocs/zapier/class/api_zapier.class.php +++ b/htdocs/zapier/class/api_zapier.class.php @@ -259,44 +259,6 @@ class Zapier extends DolibarrApi ); } - // /** - // * Update hook - // * - // * @param int $id Id of hook to update - // * @param array $request_data Datas - // * @return int - // * - // * @url PUT /hooks/{id} - // */ - /*public function put($id, $request_data = null) - { - if (! DolibarrApiAccess::$user->hasRight('zapier', 'write')) { - throw new RestException(403); - } - - $result = $this->hook->fetch($id); - if( ! $result ) { - throw new RestException(404, 'Hook not found'); - } - - if( ! DolibarrApi::_checkAccessToResource('hook', $this->hook->id)) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); - } - - foreach($request_data as $field => $value) { - if ($field == 'id') { - continue; - } - $this->hook->$field = $value; - } - - if ($this->hook->update($id, DolibarrApiAccess::$user) > 0) { - return $this->get($id); - } else { - throw new RestException(500, $this->hook->error); - } - }*/ - /** * Delete hook *