Pass user to the delete function

This commit is contained in:
Laurent Destailleur 2017-09-12 14:34:33 +02:00
parent 531ebc4c48
commit c5961d8386
2 changed files with 5 additions and 3 deletions

View File

@ -480,7 +480,7 @@ class FactureRec extends CommonInvoice
* @param int $idwarehouse Id warehouse to use for stock change.
* @return int <0 if KO, >0 if OK
*/
function delete($user, $notrigger=0, $idwarehouse=-1)
function delete(User $user, $notrigger=0, $idwarehouse=-1)
{
$rowid=$this->id;
@ -1361,7 +1361,9 @@ class FactureLigneRec extends CommonInvoiceLine
/**
* Delete line in database
*
* @return int <0 if KO, >0 if OK
* @param User $user Object user
* @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK
*/
function delete(User $user, $notrigger = false)
{

View File

@ -300,7 +300,7 @@ if (empty($reshook))
// Delete
if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $user->rights->facture->supprimer)
{
$object->delete();
$object->delete($user);
header("Location: " . $_SERVER['PHP_SELF'] );
exit;
}