mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-16 14:31:29 +01:00
Standardize code
This commit is contained in:
@@ -370,8 +370,10 @@ class Proposals extends DolibarrApi
|
||||
* @url DELETE {id}/lines/{lineid}
|
||||
*
|
||||
* @return int
|
||||
* @throws 401
|
||||
* @throws 404
|
||||
*/
|
||||
function delLine($id, $lineid) {
|
||||
function deleteLine($id, $lineid) {
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@@ -384,9 +386,10 @@ class Proposals extends DolibarrApi
|
||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
$updateRes = $this->propal->deleteline($lineid);
|
||||
if ($updateRes == 1) {
|
||||
if ($updateRes > 0) {
|
||||
return $this->get($id);
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -389,7 +389,7 @@ class CommandeApi extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function delLine($id, $lineid) {
|
||||
function deleteLine($id, $lineid) {
|
||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
@@ -353,14 +353,16 @@ class Orders extends DolibarrApi
|
||||
* Delete a line to given order
|
||||
*
|
||||
*
|
||||
* @param int $id Id of commande to update
|
||||
* @param int $id Id of order to update
|
||||
* @param int $lineid Id of line to delete
|
||||
*
|
||||
* @url DELETE {id}/lines/{lineid}
|
||||
*
|
||||
* @return int
|
||||
* @throws 401
|
||||
* @throws 404
|
||||
*/
|
||||
function delLine($id, $lineid) {
|
||||
function deleteLine($id, $lineid) {
|
||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@@ -373,6 +375,7 @@ class Orders extends DolibarrApi
|
||||
if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
$updateRes = $this->commande->deleteline(DolibarrApiAccess::$user,$lineid);
|
||||
if ($updateRes > 0) {
|
||||
|
||||
@@ -312,13 +312,13 @@ class Invoices extends DolibarrApi
|
||||
* @param int $id Id of invoice
|
||||
* @param int $lineid Id of the line to delete
|
||||
*
|
||||
* @url DELETE {id}/deleteline/{lineid}
|
||||
* @url DELETE {id}/lines/{lineid}
|
||||
*
|
||||
* @return array
|
||||
* @throws 304
|
||||
* @throws 400
|
||||
* @throws 401
|
||||
* @throws 404
|
||||
* @throws 405
|
||||
*/
|
||||
function deleteLine($id, $lineid) {
|
||||
|
||||
@@ -340,7 +340,7 @@ class Invoices extends DolibarrApi
|
||||
|
||||
$result = $this->invoice->deleteline($lineid);
|
||||
if( $result < 0) {
|
||||
throw new RestException(304);
|
||||
throw new RestException(405, $this->invoice->error);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
|
||||
@@ -348,7 +348,7 @@ class ExpenseReports extends DolibarrApi
|
||||
* @return int
|
||||
*/
|
||||
/*
|
||||
function delLine($id, $lineid) {
|
||||
function deleteLine($id, $lineid) {
|
||||
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user