diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 40610ce5d6f..691c20e10f8 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -229,7 +229,8 @@ class HookManager 'showLinkToObjectBlock', 'setContentSecurityPolicy', 'setHtmlTitle', - 'completeTabsHead' + 'completeTabsHead', + 'formDolBanner' ) )) { $hooktype = 'addreplace'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 408a771e1ed..c71b3ad0802 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1845,7 +1845,7 @@ function dol_get_fiche_end($notab = 0) */ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $onlybanner = 0, $morehtmlright = '') { - global $conf, $form, $user, $langs; + global $conf, $form, $user, $langs, $hookmanager; $error = 0; @@ -2116,6 +2116,17 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi $morehtmlref .= ''; } + $parameters=array('morehtmlref'=>$morehtmlref); + $reshook = $hookmanager->executeHooks('formDolBanner', $parameters, $object, $action); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } elseif (empty($reshook)) { + $morehtmlref .= $hookmanager->resPrint; + } elseif ($reshook > 0) { + $morehtmlref = $hookmanager->resPrint; + } + + print '
';