Merge pull request #12109 from frederic34/patch-15
keep a copy of object for trigger
This commit is contained in:
commit
f3c627cb7f
@ -250,6 +250,7 @@ if (empty($reshook))
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->contact->supprimer)
|
||||
{
|
||||
$result=$object->fetch($id);
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$object->old_lastname = GETPOST("old_lastname");
|
||||
$object->old_firstname = GETPOST("old_firstname");
|
||||
|
||||
@ -817,6 +817,7 @@ if (empty($reshook))
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->supprimer)
|
||||
{
|
||||
$object->fetch($socid);
|
||||
$object->oldcopy = clone $object;
|
||||
$result = $object->delete($socid, $user);
|
||||
|
||||
if ($result > 0)
|
||||
|
||||
@ -292,7 +292,7 @@ class Contacts extends DolibarrApi
|
||||
{
|
||||
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$this->contact->oldcopy = clone $this->contact;
|
||||
return $this->contact->delete($id);
|
||||
}
|
||||
|
||||
|
||||
@ -418,7 +418,7 @@ class Thirdparties extends DolibarrApi
|
||||
// External modules should update their ones too
|
||||
if (!$errors)
|
||||
{
|
||||
$reshook = $hookmanager->executeHooks('replaceThirdparty', array(
|
||||
$reshook = $hookmanager->executeHooks('replaceThirdparty', array(
|
||||
'soc_origin' => $soc_origin->id,
|
||||
'soc_dest' => $object->id
|
||||
), $soc_dest, $action);
|
||||
@ -488,6 +488,7 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array(
|
||||
if( ! DolibarrApi::_checkAccessToResource('societe', $this->company->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
$this->company->oldcopy = clone $this->company;
|
||||
return $this->company->delete($id);
|
||||
}
|
||||
|
||||
|
||||
@ -156,6 +156,7 @@ if (empty($reshook)) {
|
||||
|
||||
$object = new User($db);
|
||||
$object->fetch($id);
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$result = $object->delete($user);
|
||||
if ($result < 0) {
|
||||
|
||||
@ -350,7 +350,7 @@ class Users extends DolibarrApi
|
||||
{
|
||||
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$this->useraccount->oldcopy = clone $this->useraccount;
|
||||
return $this->useraccount->delete(DolibarrApiAccess::$user);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user