Merge pull request #23997 from marc-dll/17.0_FIX_banner_status

FIX: banner: status was not displayed if status field is not called 'status'
This commit is contained in:
Laurent Destailleur 2023-02-22 13:37:13 +01:00 committed by GitHub
commit 86fab2311b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2308,15 +2308,13 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
} }
$tmptxt = $object->getLibStatut(5); $tmptxt = $object->getLibStatut(5);
$morehtmlstatus .= $tmptxt; // No status on task $morehtmlstatus .= $tmptxt; // No status on task
} else { // Generic case } elseif (method_exists($object, 'getLibStatut')) { // Generic case
if (isset($object->status)) {
$tmptxt = $object->getLibStatut(6); $tmptxt = $object->getLibStatut(6);
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) { if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
$tmptxt = $object->getLibStatut(5); $tmptxt = $object->getLibStatut(5);
} }
$morehtmlstatus .= $tmptxt; $morehtmlstatus .= $tmptxt;
} }
}
// Add if object was dispatched "into accountancy" // Add if object was dispatched "into accountancy"
if (isModEnabled('accounting') && in_array($object->element, array('bank', 'paiementcharge', 'facture', 'invoice', 'invoice_supplier', 'expensereport', 'payment_various'))) { if (isModEnabled('accounting') && in_array($object->element, array('bank', 'paiementcharge', 'facture', 'invoice', 'invoice_supplier', 'expensereport', 'payment_various'))) {