diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a5eecd998e3..7be99f5e278 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1401,43 +1401,6 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $form=new Form($db); // Define link to login card - /* - $loginhtmltext=''; $logintext=''; - if ($user->societe_id) - { - $thirdpartystatic=new Societe($db); - $thirdpartystatic->fetch($user->societe_id); - $companylink=' ('.$thirdpartystatic->getNomUrl('','').')'; - $company=' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')'; - } - $logintext='
login.''; - if ($user->societe_id) $logintext.=$companylink; - $logintext.='
'; - $loginhtmltext.=''.$langs->trans("User").''; - $loginhtmltext.='
'.$langs->trans("Name").': '.$user->getFullName($langs); - $loginhtmltext.='
'.$langs->trans("Login").': '.$user->login; - $loginhtmltext.='
'.$langs->trans("EMail").': '.$user->email; - $loginhtmltext.='
'.$langs->trans("Administrator").': '.yn($user->admin); - $type=($user->societe_id?$langs->trans("External").$company:$langs->trans("Internal")); - $loginhtmltext.='
'.$langs->trans("Type").': '.$type; - $loginhtmltext.='
'; - $loginhtmltext.='
'.$langs->trans("Connection").''; - $loginhtmltext.='
'.$langs->trans("IPAddress").': '.$_SERVER["REMOTE_ADDR"]; - if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $loginhtmltext.='
'.$langs->trans("ConnectedOnMultiCompany").': '.$conf->entity.' (user entity '.$user->entity.')'; - $loginhtmltext.='
'.$langs->trans("AuthenticationMode").': '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)'); - $loginhtmltext.='
'.$langs->trans("ConnectedSince").': '.dol_print_date($user->datelastlogin,"dayhour"); - $loginhtmltext.='
'.$langs->trans("PreviousConnexion").': '.dol_print_date($user->datepreviouslogin,"dayhour"); - $loginhtmltext.='
'.$langs->trans("CurrentTheme").': '.$conf->theme; - $loginhtmltext.='
'.$langs->trans("CurrentMenuManager").': '.$menumanager->name; - $s=picto_from_langcode($langs->getDefaultLang()); - $loginhtmltext.='
'.$langs->trans("CurrentUserLanguage").': '.($s?$s.' ':'').$langs->getDefaultLang(); - $loginhtmltext.='
'.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')'; - if (! empty($conf->browser->phone)) $loginhtmltext.='
'.$langs->trans("Phone").': '.$conf->browser->phone; - if (! empty($_SESSION["disablemodules"])) $loginhtmltext.='
'.$langs->trans("DisabledModules").':
'.join(', ',explode(',',$_SESSION["disablemodules"])); - */ - $appli='Dolibarr'; if (! empty($conf->global->MAIN_APPLICATION_TITLE)) { @@ -1471,7 +1434,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $toprightmenu.='
'; // Add login user link //$toprightmenu.=$form->textwithtooltip('',$loginhtmltext,2,1,$logintext,'login_block_elem2',2); // This include div class="login" - $toprightmenu.= $user->getNomurl(0, '', 1); + $toprightmenu.= $user->getNomurl(0, '', true, 0, 11); $toprightmenu.='
'; $toprightmenu.='
'; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 860b855d52a..16123c86b9c 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1779,9 +1779,10 @@ class User extends CommonObject * @param string $option On what the link point to * @param boolean $infologin Add connection info to the tooltip * @param string $notooltip 1=Disable tooltip + * @param int $maxlen Max length of visible user name * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $infologin=0, $notooltip=0) + function getNomUrl($withpicto=0, $option='', $infologin=0, $notooltip=0, $maxlen=24) { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -1792,7 +1793,7 @@ class User extends CommonObject $label = '' . $langs->trans("User") . ''; $label.= '
'; - $label .= '' . $langs->trans('Name') . ': ' . $this->getFullName($langs,'','',24); + $label .= '' . $langs->trans('Name') . ': ' . $this->getFullName($langs,'',''); if (! empty($this->login)) $label .= '
' . $langs->trans('Login') . ': ' . $this->login; if (! empty($this->email)) @@ -1845,7 +1846,7 @@ class User extends CommonObject $result.=($lien.img_object(($notooltip?'':$label), 'user', ($notooltip?'':'class="classfortooltip"')).$lienfin); if ($withpicto != 2) $result.=' '; } - $result.= $lien . $this->getFullName($langs,'','',24) . $companylink . $lienfin; + $result.= $lien . $this->getFullName($langs,'','',$maxlen) . $companylink . $lienfin; return $result; }