mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-07 01:58:09 +01:00
NEW Add hook printEmail
This commit is contained in:
@@ -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)
|
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;
|
$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));
|
$newemail.=img_warning($langs->trans("ErrorBadEMail",$email));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return '<div class="nospan float" style="margin-right: 10px">'.($withpicto?img_picto($langs->trans("EMail"), 'object_email.png').' ':'').$newemail.'</div>';
|
|
||||||
|
$rep = '<div class="nospan float" style="margin-right: 10px">'.($withpicto?img_picto($langs->trans("EMail"), 'object_email.png').' ':'').$newemail.'</div>';
|
||||||
|
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='';
|
$rep='';
|
||||||
|
|
||||||
if ($hookmanager) {
|
if ($hookmanager) {
|
||||||
$parameters = array('countrycode' => $countrycode, 'cid' => $cid, 'socid' => $socid,'titlealt' => $titlealt, 'picto' => $withpicto);
|
$parameters = array('countrycode' => $countrycode, 'cid' => $cid, 'socid' => $socid,'titlealt' => $titlealt, 'picto' => $withpicto);
|
||||||
$reshook = $hookmanager->executeHooks('printPhone', $parameters, $phone);
|
$reshook = $hookmanager->executeHooks('printPhone', $parameters, $phone);
|
||||||
$rep.=$hookmanager->resPrint;
|
$rep.=$hookmanager->resPrint;
|
||||||
}
|
}
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
$picto = '';
|
$picto = '';
|
||||||
if($withpicto){
|
if($withpicto){
|
||||||
if($withpicto=='fax'){
|
if($withpicto=='fax'){
|
||||||
|
|||||||
@@ -2100,7 +2100,7 @@ class Societe extends CommonObject
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||||
$hookmanager=new HookManager($this->db);
|
$hookmanager=new HookManager($this->db);
|
||||||
}
|
}
|
||||||
$hookmanager->initHooks(array('societedao'));
|
$hookmanager->initHooks(array('thirdpartydao'));
|
||||||
$parameters=array('id'=>$this->id);
|
$parameters=array('id'=>$this->id);
|
||||||
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$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;
|
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
|
||||||
@@ -2127,7 +2127,7 @@ class Societe extends CommonObject
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||||
$hookmanager=new HookManager($this->db);
|
$hookmanager=new HookManager($this->db);
|
||||||
}
|
}
|
||||||
$hookmanager->initHooks(array('societedao'));
|
$hookmanager->initHooks(array('thirdpartydao'));
|
||||||
$parameters=array('id'=>$this->id, 'getnomurl'=>$result);
|
$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
|
$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;
|
if ($reshook > 0) $result = $hookmanager->resPrint;
|
||||||
|
|||||||
Reference in New Issue
Block a user