diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f9219c265ad..b5794758d23 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2090,7 +2090,7 @@ function dol_print_url($url,$target='_blank',$max=32,$withpicto=0) */ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid=1,$withpicto=0) { - global $conf,$user,$langs; + global $conf,$user,$langs,$hookmanager; $newemail=$email; @@ -2125,7 +2125,15 @@ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid= $newemail.=img_warning($langs->trans("ErrorBadEMail",$email)); } } - return '
'.($withpicto?img_picto($langs->trans("EMail"), 'object_email.png').' ':'').$newemail.'
'; + + $rep = '
'.($withpicto?img_picto($langs->trans("EMail"), 'object_email.png').' ':'').$newemail.'
'; + if ($hookmanager) { + $parameters = array('cid' => $cid, 'socid' => $socid,'addlink' => $addlink, 'picto' => $withpicto); + $reshook = $hookmanager->executeHooks('printEmail', $parameters, $email); + $rep.=$hookmanager->resPrint; + } + + return $rep; } /** @@ -2535,12 +2543,12 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep $rep=''; if ($hookmanager) { - $parameters = array('countrycode' => $countrycode, 'cid' => $cid, 'socid' => $socid,'titlealt' => $titlealt, 'picto' => $withpicto); - $reshook = $hookmanager->executeHooks('printPhone', $parameters, $phone); - $rep.=$hookmanager->resPrint; - } - if (empty($reshook)) - { + $parameters = array('countrycode' => $countrycode, 'cid' => $cid, 'socid' => $socid,'titlealt' => $titlealt, 'picto' => $withpicto); + $reshook = $hookmanager->executeHooks('printPhone', $parameters, $phone); + $rep.=$hookmanager->resPrint; + } + if (empty($reshook)) + { $picto = ''; if($withpicto){ if($withpicto=='fax'){ diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 515a2208947..5aa8864b403 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2100,7 +2100,7 @@ class Societe extends CommonObject include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $hookmanager=new HookManager($this->db); } - $hookmanager->initHooks(array('societedao')); + $hookmanager->initHooks(array('thirdpartydao')); $parameters=array('id'=>$this->id); $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $linkclose = $hookmanager->resPrint; @@ -2127,7 +2127,7 @@ class Societe extends CommonObject include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $hookmanager=new HookManager($this->db); } - $hookmanager->initHooks(array('societedao')); + $hookmanager->initHooks(array('thirdpartydao')); $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;