FIX actions on supplier proposal not saved (bad trigger name)

This commit is contained in:
Laurent Destailleur 2020-03-24 13:25:45 +01:00
parent 1ff15e1fd9
commit d922eb270d
2 changed files with 9 additions and 9 deletions

View File

@ -1041,7 +1041,7 @@ if (empty($reshook))
if (!$error)
{
$result = $object->insertExtraFields('SUPPLIER_PROPOSAL_MODIFY');
$result = $object->insertExtraFields('PROPOSAL_SUPPLIER_MODIFY');
if ($result < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
@ -1433,7 +1433,7 @@ if ($action == 'create')
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
$notify = new Notify($db);
$text .= '<br>';
$text .= $notify->confirmMessage('SUPPLIER_PROPOSAL_VALIDATE', $object->socid, $object);
$text .= $notify->confirmMessage('PROPOSAL_SUPPLIER_VALIDATE', $object->socid, $object);
}
if (!$error)

View File

@ -1481,7 +1481,7 @@ class SupplierProposal extends CommonObject
if (!$error && !$notrigger)
{
// Call trigger
$result = $this->call_trigger('SUPPLIER_PROPOSAL_VALIDATE', $user);
$result = $this->call_trigger('PROPOSAL_SUPPLIER_VALIDATE', $user);
if ($result < 0) { $error++; }
// End call triggers
}
@ -1683,7 +1683,7 @@ class SupplierProposal extends CommonObject
if (!$notrigger)
{
// Call trigger
$result = $this->call_trigger('SUPPLIER_PROPOSAL_REOPEN', $user);
$result = $this->call_trigger('PROPOSAL_SUPPLIER_REOPEN', $user);
if ($result < 0) { $error++; }
// End call triggers
}
@ -1737,11 +1737,11 @@ class SupplierProposal extends CommonObject
if ($resql)
{
$modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED : $this->modelpdf;
$triggerName = 'SUPPLIER_PROPOSAL_CLOSE_REFUSED';
$triggerName = 'PROPOSAL_SUPPLIER_CLOSE_REFUSED';
if ($status == 2)
{
$triggerName = 'SUPPLIER_PROPOSAL_CLOSE_SIGNED';
$triggerName = 'PROPOSAL_SUPPLIER_CLOSE_SIGNED';
$modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL : $this->modelpdf;
if (!empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists
@ -1751,7 +1751,7 @@ class SupplierProposal extends CommonObject
}
if ($status == 4)
{
$triggerName = 'SUPPLIER_PROPOSAL_CLASSIFY_BILLED';
$triggerName = 'PROPOSAL_SUPPLIER_CLASSIFY_BILLED';
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
@ -1916,7 +1916,7 @@ class SupplierProposal extends CommonObject
if (!$error) {
// Call trigger
$result = $this->call_trigger('SUPPLIER_PROPOSAL_UNVALIDATE', $user);
$result = $this->call_trigger('PROPOSAL_SUPPLIER_UNVALIDATE', $user);
if ($result < 0) $error++;
}
@ -2034,7 +2034,7 @@ class SupplierProposal extends CommonObject
if (!$notrigger)
{
// Call trigger
$result = $this->call_trigger('SUPPLIER_PROPOSAL_DELETE', $user);
$result = $this->call_trigger('PROPOSAL_SUPPLIER_DELETE', $user);
if ($result < 0) { $error++; }
// End call triggers
}