Merge pull request #21943 from rycks/15.0_fix_public_propal_sign_call_trigger

fix #21941 call_trigger
This commit is contained in:
Laurent Destailleur 2022-09-07 14:33:26 +02:00 committed by GitHub
commit 7600aec8f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -212,6 +212,15 @@ if ($action == "importSignature") {
$db->commit();
$response = "success";
setEventMessages("PropalSigned", null, 'warnings');
if (method_exists($object, 'call_trigger')) {
//customer is not a user !?! so could we use same user as validation ?
$user = new User($db);
$user->fetch($object->user_valid_id);
$result = $object->call_trigger('PROPAL_CLOSE_SIGNED', $user);
if ($result < 0) {
$error++;
}
}
} else {
$db->rollback();
$error++;

View File

@ -168,6 +168,15 @@ if ($action == 'confirm_refusepropal' && $confirm == 'yes') {
$message = 'refused';
setEventMessages("PropalRefused", null, 'warnings');
if (method_exists($object, 'call_trigger')) {
//customer is not a user !?! so could we use same user as validation ?
$user = new User($db);
$user->fetch($object->user_valid_id);
$result = $object->call_trigger('PROPAL_CLOSE_REFUSED', $user);
if ($result < 0) {
$error++;
}
}
} else {
$db->rollback();
}