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:
commit
08985fbe62
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user