diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index d9b7147fefa..68e078bd5ef 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3347,7 +3347,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)) { @@ -3378,6 +3378,14 @@ class Propal extends CommonObject $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 d3fbe41312c..99a8e31521c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -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)); } diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php index f48cb9bffe5..344a2b19229 100644 --- a/htdocs/core/ajax/check_notifications.php +++ b/htdocs/core/ajax/check_notifications.php @@ -128,7 +128,7 @@ if (empty($_SESSION['auto_check_events_not_before']) || $time >= $_SESSION['auto $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_reminder as ar ON a.id = ar.fk_actioncomm AND ar.fk_user = '.((int) $user->id); $sql .= ' WHERE a.code <> "AC_OTH_AUTO"'; $sql .= ' AND ('; - $sql .= " (ar.typeremind = 'browser' AND ar.dateremind < '".$db->idate(dol_now())."' AND ar.status = 0 AND ar.entity = ".$conf->entity; + $sql .= " ar.typeremind = 'browser' AND ar.dateremind < '".$db->idate(dol_now())."' AND ar.status = 0 AND ar.entity = ".$conf->entity; $sql .= ' )'; } else { $sql .= ' JOIN '.MAIN_DB_PREFIX.'actioncomm_reminder as ar ON a.id = ar.fk_actioncomm AND ar.fk_user = '.((int) $user->id); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 6fa218d4970..b586c69d464 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -584,7 +584,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) { @@ -634,6 +634,22 @@ abstract class CommonInvoice extends CommonObject } } + $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); }