Merge pull request #22792 from noec764/14_FIX_Add_Missing_LibStatut_Hooks

FIX: Add Missing "LibStatut" hooks in propal, commande, facture
This commit is contained in:
Laurent Destailleur
2022-11-09 15:39:43 +01:00
committed by GitHub
4 changed files with 41 additions and 4 deletions

View File

@@ -3626,7 +3626,7 @@ class Commande extends CommonOrder
public function LibStatut($status, $billed, $mode, $donotshowbilled = 0)
{
// phpcs:enable
global $langs, $conf;
global $langs, $conf, $hookmanager;
$billedtext = '';
if (empty($donotshowbilled)) {
@@ -3674,6 +3674,19 @@ class Commande extends CommonOrder
$mode = 0;
}
$parameters = array(
'status' => $status,
'mode' => $mode,
'billed' => $billed,
'donotshowbilled' => $donotshowbilled
);
$reshook = $hookmanager->executeHooks('LibStatut', $parameters, $this); // Note that $action and $object may have been modified by hook
if ($reshook > 0) {
return $hookmanager->resPrint;
}
return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode, '', array('tooltip' => $labelTooltip));
}