diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index f36b8027461..06bd79ea618 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3243,7 +3243,7 @@ class Propal extends CommonObject public function LibStatut($status, $mode = 1) { // phpcs:enable - global $conf; + global $conf, $hookmanager; // Init/load array of translation of status if (empty($this->labelStatus) || empty($this->labelStatusShort)) { @@ -3273,7 +3273,15 @@ class Propal extends CommonObject } elseif ($status == self::STATUS_BILLED) { $statusType = 'status6'; } + + $parameters = array('status' => $status, 'mode' => $mode); + $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($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 54e50baa9f7..b43b29a43cc 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3591,7 +3591,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)) { @@ -3636,6 +3636,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)); } diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index f6edbd3f8d4..af143b324c4 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -532,7 +532,7 @@ abstract class CommonInvoice extends CommonObject public function LibStatut($paye, $status, $mode = 0, $alreadypaid = -1, $type = -1) { // phpcs:enable - global $langs; + global $langs, $hookmanager; $langs->load('bills'); if ($type == -1) { @@ -576,6 +576,22 @@ abstract class CommonInvoice extends CommonObject $labelStatusShort = $langs->transnoentitiesnoconv('Bill'.$prefix.'StatusPaid'); } } + + $parameters = array( + 'status' => $status, + 'mode' => $mode, + 'paye' => $paye, + 'alreadypaid' => $alreadypaid, + 'type' => $type + ); + + $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); }