diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 259918c5aa9..78752bdba03 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -957,39 +957,53 @@ class Contact extends CommonObject
*/
function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='')
{
- global $conf, $langs;
+ global $conf, $langs, $hookmanager;
$result='';
- $label = '' . $langs->trans("ShowContact") . '';
- $label.= '
' . $langs->trans("Name") . ': '.$this->getFullName($langs);
- //if ($this->civility_id) $label.= '
' . $langs->trans("Civility") . ': '.$this->civility_id; // TODO Translate cibilty_id code
- if (! empty($this->poste)) $label.= '
' . $langs->trans("Poste") . ': '.$this->poste;
- $label.= '
' . $langs->trans("EMail") . ': '.$this->email;
- $phonelist=array();
- if ($this->phone_pro) $phonelist[]=$this->phone_pro;
- if ($this->phone_mobile) $phonelist[]=$this->phone_mobile;
- if ($this->phone_perso) $phonelist[]=$this->phone_perso;
- $label.= '
' . $langs->trans("Phone") . ': '.join(', ',$phonelist);
- $label.= '
' . $langs->trans("Address") . ': '.dol_format_address($this, 1, ' ', $langs);
+ $label = '' . $langs->trans("ShowContact") . '';
+ $label.= '
' . $langs->trans("Name") . ': '.$this->getFullName($langs);
+ //if ($this->civility_id) $label.= '
' . $langs->trans("Civility") . ': '.$this->civility_id; // TODO Translate cibilty_id code
+ if (! empty($this->poste)) $label.= '
' . $langs->trans("Poste") . ': '.$this->poste;
+ $label.= '
' . $langs->trans("EMail") . ': '.$this->email;
+ $phonelist=array();
+ if ($this->phone_pro) $phonelist[]=$this->phone_pro;
+ if ($this->phone_mobile) $phonelist[]=$this->phone_mobile;
+ if ($this->phone_perso) $phonelist[]=$this->phone_perso;
+ $label.= '
' . $langs->trans("Phone") . ': '.join(', ',$phonelist);
+ $label.= '
' . $langs->trans("Address") . ': '.dol_format_address($this, 1, ' ', $langs);
+
+ $link = 'global->MAIN_OPTIMIZEFORTEXTBROWSER))
+ {
+ $label=$langs->trans("ShowContact");
+ $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
+ }
+ $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose.= ' class="classfortooltip">';
- $link = 'global->MAIN_OPTIMIZEFORTEXTBROWSER))
- {
- $label=$langs->trans("ShowContact");
- $link.=' alt="'.dol_escape_htmltag($label, 1).'"';
- }
- $link.= ' title="'.dol_escape_htmltag($label, 1).'"';
- $link.= ' class="classfortooltip">';
+ if (! is_object($hookmanager))
+ {
+ include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
+ $hookmanager=new HookManager($this->db);
+ }
+ $hookmanager->initHooks(array('contactdao'));
+ $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;
+
+ $link.=$linkclose;
+
$linkend='';
-
+
if ($option == 'xxx')
{
$link = '';
$linkend='';
}
-
- if ($withpicto) $result.=($link.img_object($label, 'contact', 'class="classfortooltip"').$linkend.' ');
- $result.=$link.($maxlen?dol_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$linkend;
+
+ if ($withpicto) $result.=($link.img_object($label, 'contact', 'class="classfortooltip"').$linkend.' ');
+ $result.=$link.($maxlen?dol_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$linkend;
return $result;
}
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 982b109da99..f3f03c65ac6 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -3132,7 +3132,7 @@ class Product extends CommonObject
*/
function getNomUrl($withpicto=0,$option='',$maxlength=0)
{
- global $conf, $langs;
+ global $conf, $langs, $hookmanager;
include_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
$result='';
@@ -3157,6 +3157,17 @@ class Product extends CommonObject
$linkclose = '" title="'.str_replace('\n', '', dol_escape_htmltag($label, 1)).'" class="classfortooltip">';
+ if (! is_object($hookmanager))
+ {
+ include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
+ $hookmanager=new HookManager($this->db);
+ }
+ $hookmanager->initHooks(array('productdao'));
+ $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;
+
+
if ($option == 'supplier') {
$link = 'label, 'product', 'class="classfortooltip"').$linkend.' ');
- if ($this->type == Product::TYPE_SERVICE) $result.=($link.img_object($langs->trans("ShowService").' '.$this->label, 'service', 'class="classfortooltip"').$linkend.' ');
+ if ($this->type == Product::TYPE_PRODUCT) $result.=($link.img_object('', 'product', '').$linkend.' ');
+ if ($this->type == Product::TYPE_SERVICE) $result.=($link.img_object('', 'service', '').$linkend.' ');
}
$result.=$link.$newref.$linkend;
return $result;
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 2367d4b87f5..89d345c5f98 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1811,7 +1811,7 @@ class Societe extends CommonObject
*/
function getNomUrl($withpicto=0, $option='', $maxlen=0, $notooltip=0)
{
- global $conf,$langs;
+ global $conf,$langs, $hookmanager;
$name=$this->name?$this->name:$this->nom;
@@ -1899,17 +1899,29 @@ class Societe extends CommonObject
// Add type of canvas
$link.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'"';
+ $linkclose='';
if (empty($notooltip))
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowCompany");
- $link.=' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
- $link.= ' title="'.dol_escape_htmltag($label, 1).'"';
- $link.=' class="classfortooltip"';
+ $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose.=' class="classfortooltip"';
+
+ if (! is_object($hookmanager))
+ {
+ include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
+ $hookmanager=new HookManager($this->db);
+ }
+ $hookmanager->initHooks(array('societedao'));
+ $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;
+
}
- $link.='>';
+ $link.=$linkclose.'>';
$linkend='';
if ($withpicto) $result.=($link.img_object(($notooltip?'':$label), 'company', ($notooltip?'':'class="classfortooltip"')).$linkend);
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 5b79447736e..d10585fe12d 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -1941,89 +1941,100 @@ class User extends CommonObject
*/
function getNomUrl($withpictoimg=0, $option='', $infologin=0, $notooltip=0, $maxlen=24, $hidethirdpartylogo=0, $mode='',$morecss='')
{
- global $langs, $conf, $db;
- global $dolibarr_main_authentication, $dolibarr_main_demo;
- global $menumanager;
+ global $langs, $conf, $db, $hookmanager;
+ global $dolibarr_main_authentication, $dolibarr_main_demo;
+ global $menumanager;
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg=0;
- $result = '';
- $companylink = '';
- $link = '';
+ $result = '';
+ $companylink = '';
+ $link = '';
+
+ $label = '' . $langs->trans("User") . '';
+ $label.= '