fix unknown $user (#28687)
* fix unknown $user * fix @param * fix @param * fix @param * fix @param
This commit is contained in:
parent
61e69b352b
commit
9b59445e39
3 changed files with 7 additions and 8 deletions
|
|
@ -2316,6 +2316,8 @@ class CommandeFournisseur extends CommonOrder
|
|||
*/
|
||||
public function deleteLine($idline, $notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
if ($this->statut == 0) {
|
||||
$line = new CommandeFournisseurLigne($this->db);
|
||||
|
||||
|
|
@ -2333,12 +2335,11 @@ class CommandeFournisseur extends CommonOrder
|
|||
}
|
||||
}
|
||||
|
||||
if ($line->delete($notrigger) > 0) {
|
||||
if ($line->delete($user, $notrigger) > 0) {
|
||||
$this->update_price(1);
|
||||
return 1;
|
||||
} else {
|
||||
$this->error = $line->error;
|
||||
$this->errors = $line->errors;
|
||||
$this->setErrorsFromObject($line);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -4162,10 +4163,8 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||
* @param int $notrigger 1=Disable call to triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete($notrigger = 0)
|
||||
public function delete($user, $notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
|
|
|||
|
|
@ -327,7 +327,6 @@ class Establishment extends CommonObject
|
|||
* Delete record
|
||||
*
|
||||
* @param User $user User making the change
|
||||
* @param int $id Id of record to delete
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete($user)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2016 Jean-François Ferry <hello@librethic.io>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -410,7 +411,7 @@ class Tickets extends DolibarrApi
|
|||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
if (!$this->ticket->delete($user)) {
|
||||
if (!$this->ticket->delete(DolibarrApiAccess::$user)) {
|
||||
throw new RestException(500, 'Error when deleting ticket');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue