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.= '
';
+ $label.= '' . $langs->trans('Name') . ': ' . $this->getFullName($langs,'','');
+ if (! empty($this->login))
+ $label.= '
' . $langs->trans('Login') . ': ' . $this->login;
+ $label.= '
' . $langs->trans("EMail").': '.$this->email;
+ if (! empty($this->admin))
+ $label.= '
' . $langs->trans("Administrator").': '.yn($this->admin);
+ if (! empty($this->societe_id) ) // Add thirdparty for external users
+ {
+ $thirdpartystatic = new Societe($db);
+ $thirdpartystatic->fetch($this->societe_id);
+ if (empty($hidethirdpartylogo)) $companylink = ' '.$thirdpartystatic->getNomUrl(2); // picto only of company
+ $company=' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')';
+ }
+ $type=($this->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
+ $label.= '
' . $langs->trans("Type") . ': ' . $type;
+ $label.='
';
+ if (! empty($this->photo))
+ {
+ $label.= '';
+ $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1);
+ $label.= '
';
+ }
- $label = '' . $langs->trans("User") . '';
- $label.= '';
- $label.= '' . $langs->trans('Name') . ': ' . $this->getFullName($langs,'','');
- if (! empty($this->login))
- $label.= '
' . $langs->trans('Login') . ': ' . $this->login;
- $label.= '
' . $langs->trans("EMail").': '.$this->email;
- if (! empty($this->admin))
- $label.= '
' . $langs->trans("Administrator").': '.yn($this->admin);
- if (! empty($this->societe_id) ) // Add thirdparty for external users
- {
- $thirdpartystatic = new Societe($db);
- $thirdpartystatic->fetch($this->societe_id);
- if (empty($hidethirdpartylogo)) $companylink = ' '.$thirdpartystatic->getNomUrl(2); // picto only of company
- $company=' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')';
- }
- $type=($this->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
- $label.= '
' . $langs->trans("Type") . ': ' . $type;
- $label.='
';
- if (! empty($this->photo))
- {
- $label.= '';
- $label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1);
- $label.= '
';
- }
-
- // Info Login
- if ($infologin)
- {
- $label.= '
';
- $label.= '
'.$langs->trans("Connection").'';
- $label.= '
'.$langs->trans("IPAddress").': '.$_SERVER["REMOTE_ADDR"];
- if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $label.= '
'.$langs->trans("ConnectedOnMultiCompany").': '.$conf->entity.' (user entity '.$this->entity.')';
- $label.= '
'.$langs->trans("AuthenticationMode").': '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)');
- $label.= '
'.$langs->trans("ConnectedSince").': '.dol_print_date($this->datelastlogin,"dayhour");
- $label.= '
'.$langs->trans("PreviousConnexion").': '.dol_print_date($this->datepreviouslogin,"dayhour");
- $label.= '
'.$langs->trans("CurrentTheme").': '.$conf->theme;
- $label.= '
'.$langs->trans("CurrentMenuManager").': '.$menumanager->name;
- $s=picto_from_langcode($langs->getDefaultLang());
- $label.= '
'.$langs->trans("CurrentUserLanguage").': '.($s?$s.' ':'').$langs->getDefaultLang();
- $label.= '
'.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')';
- $label.= '
'.$langs->trans("Layout").': '.$conf->browser->layout;
- $label.= '
'.$langs->trans("Screen").': '.$_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
- if (! empty($conf->browser->phone)) $label.= '
'.$langs->trans("Phone").': '.$conf->browser->phone;
- if (! empty($_SESSION["disablemodules"])) $label.= '
'.$langs->trans("DisabledModules").':
'.join(', ',explode(',',$_SESSION["disablemodules"]));
- }
+ // Info Login
+ if ($infologin)
+ {
+ $label.= '
';
+ $label.= '
'.$langs->trans("Connection").'';
+ $label.= '
'.$langs->trans("IPAddress").': '.$_SERVER["REMOTE_ADDR"];
+ if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $label.= '
'.$langs->trans("ConnectedOnMultiCompany").': '.$conf->entity.' (user entity '.$this->entity.')';
+ $label.= '
'.$langs->trans("AuthenticationMode").': '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)');
+ $label.= '
'.$langs->trans("ConnectedSince").': '.dol_print_date($this->datelastlogin,"dayhour");
+ $label.= '
'.$langs->trans("PreviousConnexion").': '.dol_print_date($this->datepreviouslogin,"dayhour");
+ $label.= '
'.$langs->trans("CurrentTheme").': '.$conf->theme;
+ $label.= '
'.$langs->trans("CurrentMenuManager").': '.$menumanager->name;
+ $s=picto_from_langcode($langs->getDefaultLang());
+ $label.= '
'.$langs->trans("CurrentUserLanguage").': '.($s?$s.' ':'').$langs->getDefaultLang();
+ $label.= '
'.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')';
+ $label.= '
'.$langs->trans("Layout").': '.$conf->browser->layout;
+ $label.= '
'.$langs->trans("Screen").': '.$_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
+ if (! empty($conf->browser->phone)) $label.= '
'.$langs->trans("Phone").': '.$conf->browser->phone;
+ if (! empty($_SESSION["disablemodules"])) $label.= '
'.$langs->trans("DisabledModules").':
'.join(', ',explode(',',$_SESSION["disablemodules"]));
+ }
- if ($option == 'leave') $link.= 'global->MAIN_OPTIMIZEFORTEXTBROWSER))
- {
- $langs->load("users");
- $label=$langs->trans("ShowUser");
- $link.=' alt="'.dol_escape_htmltag($label, 1).'"';
- }
- $link.= ' title="'.dol_escape_htmltag($label, 1).'"';
- $link.= ' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
- }
- $link.= '>';
+ if ($option == 'leave') $link.= 'global->MAIN_OPTIMIZEFORTEXTBROWSER))
+ {
+ $langs->load("users");
+ $label=$langs->trans("ShowUser");
+ $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
+ }
+ $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose.= ' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
+ }
+ if (! is_object($hookmanager))
+ {
+ include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
+ $hookmanager=new HookManager($this->db);
+ }
+ $hookmanager->initHooks(array('userdao'));
+ $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 ($withpictoimg == -1) $result.='';
+ //if ($withpictoimg == -1) $result.='
';
$result.=$link;
- if ($withpictoimg)
- {
- $paddafterimage='';
- if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"';
- if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
';
- else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 'mini', 0, 1).'
';
- $result.=$picto;
+ if ($withpictoimg)
+ {
+ $paddafterimage='';
+ if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"';
+ if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
';
+ else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 'mini', 0, 1).'
';
+ $result.=$picto;
}
if (abs($withpictoimg) != 2)
{