rename Hook and moved it into LibStatut method
This commit is contained in:
parent
60671f1c78
commit
1bfcfc3a0c
@ -690,7 +690,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
public function LibStatut($status, $mode = 0, $billed = 0)
|
public function LibStatut($status, $mode = 0, $billed = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs, $hookmanager;
|
||||||
|
|
||||||
if (empty($this->statuts) || empty($this->statutshort)) {
|
if (empty($this->statuts) || empty($this->statutshort)) {
|
||||||
$langs->load('orders');
|
$langs->load('orders');
|
||||||
@ -749,6 +749,11 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$statusLong = $langs->transnoentitiesnoconv($this->statuts[$status]).$billedtext;
|
$statusLong = $langs->transnoentitiesnoconv($this->statuts[$status]).$billedtext;
|
||||||
$statusShort = $langs->transnoentitiesnoconv($this->statutshort[$status]);
|
$statusShort = $langs->transnoentitiesnoconv($this->statutshort[$status]);
|
||||||
|
|
||||||
|
$parameters = array('status' => $status, 'mode' => $mode, 'billed' => $billed, 'obj'=>$this);
|
||||||
|
$reshook = $hookmanager->executeHooks('diffHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
if ($reshook > 0) {
|
||||||
|
return $hookmanager->resPrint;
|
||||||
|
}
|
||||||
return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode);
|
return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1537,15 +1537,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
// Status
|
// Status
|
||||||
if (!empty($arrayfields['cf.fk_statut']['checked'])) {
|
if (!empty($arrayfields['cf.fk_statut']['checked'])) {
|
||||||
$parameters = array('obj' => $obj);
|
print '<td class="right nowrap">'.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).'</td>';
|
||||||
$morehtmlstatus = $objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed);
|
|
||||||
$reshook = $hookmanager->executeHooks('moreHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook
|
|
||||||
if (empty($reshook)) {
|
|
||||||
$morehtmlstatus .= $hookmanager->resPrint;
|
|
||||||
} else {
|
|
||||||
$morehtmlstatus = $hookmanager->resPrint;
|
|
||||||
}
|
|
||||||
print '<td class="right nowrap">' . $morehtmlstatus . '</td>';
|
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user