FIX: Add Missing "LibStatut" hook in propal, commande, facture
This commit is contained in:
parent
026404657d
commit
73b857c1b3
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user