Merge pull request #24247 from noec764/FIX_Add_Hook_on_ticket_libStatut

FIX: Add missing hook on LibStatut
This commit is contained in:
Laurent Destailleur 2023-03-17 23:13:20 +01:00 committed by GitHub
commit d8f3d8afef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1273,7 +1273,7 @@ class Ticket extends CommonObject
public function LibStatut($status, $mode = 0, $notooltip = 0)
{
// phpcs:enable
global $langs;
global $langs, $hookmanager;
$labelStatus = $this->statuts[$status];
$labelStatusShort = $this->statuts_short[$status];
@ -1301,6 +1301,18 @@ class Ticket extends CommonObject
$mode = 0;
}
$parameters = array(
'status' => $status,
'mode' => $mode,
);
// Note that $action and $object may have been modified by hook
$reshook = $hookmanager->executeHooks('LibStatut', $parameters, $this);
if ($reshook > 0) {
return $hookmanager->resPrint;
}
$params = array();
if ($notooltip) {
$params = array('tooltip' => 'no');