Skip to content
Snippets Groups Projects
Commit 968b2b43 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Better position for username

parent 52222ecd
No related branches found
No related tags found
No related merge requests found
......@@ -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='<div class="login"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'"';
$logintext.=$target?(' target="'.$target.'"'):'';
$logintext.='>'.$user->login.'</a>';
if ($user->societe_id) $logintext.=$companylink;
$logintext.='</div>';
$loginhtmltext.='<u>'.$langs->trans("User").'</u>';
$loginhtmltext.='<br><b>'.$langs->trans("Name").'</b>: '.$user->getFullName($langs);
$loginhtmltext.='<br><b>'.$langs->trans("Login").'</b>: '.$user->login;
$loginhtmltext.='<br><b>'.$langs->trans("EMail").'</b>: '.$user->email;
$loginhtmltext.='<br><b>'.$langs->trans("Administrator").'</b>: '.yn($user->admin);
$type=($user->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
$loginhtmltext.='<br><b>'.$langs->trans("Type").'</b>: '.$type;
$loginhtmltext.='<br>';
$loginhtmltext.='<br><u>'.$langs->trans("Connection").'</u>';
$loginhtmltext.='<br><b>'.$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"];
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $loginhtmltext.='<br><b>'.$langs->trans("ConnectedOnMultiCompany").'</b>: '.$conf->entity.' (user entity '.$user->entity.')';
$loginhtmltext.='<br><b>'.$langs->trans("AuthenticationMode").'</b>: '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)');
$loginhtmltext.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dol_print_date($user->datelastlogin,"dayhour");
$loginhtmltext.='<br><b>'.$langs->trans("PreviousConnexion").'</b>: '.dol_print_date($user->datepreviouslogin,"dayhour");
$loginhtmltext.='<br><b>'.$langs->trans("CurrentTheme").'</b>: '.$conf->theme;
$loginhtmltext.='<br><b>'.$langs->trans("CurrentMenuManager").'</b>: '.$menumanager->name;
$s=picto_from_langcode($langs->getDefaultLang());
$loginhtmltext.='<br><b>'.$langs->trans("CurrentUserLanguage").'</b>: '.($s?$s.' ':'').$langs->getDefaultLang();
$loginhtmltext.='<br><b>'.$langs->trans("Browser").'</b>: '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')';
if (! empty($conf->browser->phone)) $loginhtmltext.='<br><b>'.$langs->trans("Phone").'</b>: '.$conf->browser->phone;
if (! empty($_SESSION["disablemodules"])) $loginhtmltext.='<br><b>'.$langs->trans("DisabledModules").'</b>: <br>'.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.='<div class="login_block_user">';
// 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.='</div>';
$toprightmenu.='<div class="login_block_other">';
......
......@@ -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 = '<u>' . $langs->trans("User") . '</u>';
$label.= '<div width="100%">';
$label .= '<b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs,'','',24);
$label .= '<b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs,'','');
if (! empty($this->login))
$label .= '<br><b>' . $langs->trans('Login') . ':</b> ' . $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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment