can modify tooltip by reference

This commit is contained in:
Frédéric FRANCE
2021-11-22 19:57:26 +01:00
parent 949bc9f9bd
commit dc3bfcfb87
63 changed files with 261 additions and 66 deletions

View File

@@ -1116,7 +1116,7 @@ class Reception extends CommonObject
*/
public function getNomUrl($withpicto = 0, $option = 0, $max = 0, $short = 0, $notooltip = 0)
{
global $conf, $langs;
global $conf, $langs, $hookmanager;
$result = '';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Reception").'</u>';
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
@@ -1149,6 +1149,16 @@ class Reception extends CommonObject
$result .= ' ';
}
$result .= $linkstart.$this->ref.$linkend;
global $action;
$hookmanager->initHooks(array('receptiondao'));
$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) {
$result = $hookmanager->resPrint;
} else {
$result .= $hookmanager->resPrint;
}
return $result;
}