From 58a734cb172310148cf11204d8cf8e1289d95aba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Sep 2015 17:28:11 +0200 Subject: [PATCH] Firstname only on login --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/lib/functions.lib.php | 6 +++++- htdocs/main.inc.php | 6 +++--- htdocs/theme/md_exp/img/title_hrm.png | Bin 0 -> 1028 bytes htdocs/theme/md_exp/style.css.php | 1 + htdocs/user/class/user.class.php | 5 +++-- 6 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 htdocs/theme/md_exp/img/title_hrm.png diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 135635ed94d..383723eefd3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -389,7 +389,7 @@ abstract class CommonObject * * @param Translate $langs Language object for translation of civility * @param int $option 0=No option, 1=Add civility - * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname + * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname * @param int $maxlen Maximum length * @return string String with full name */ diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8649528d883..1e256effa5f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4297,12 +4297,16 @@ function dolGetFirstLastname($firstname,$lastname,$nameorder=-1) $ret=''; // If order not defined, we use the setup if ($nameorder < 0) $nameorder=(empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)); - if ($nameorder) + if ($nameorder && $nameorder != '2') { $ret.=$firstname; if ($firstname && $lastname) $ret.=' '; $ret.=$lastname; } + else if ($nameorder == 2) + { + $ret.=$firstname; + } else { $ret.=$lastname; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7c682756edd..f1f15fc0f06 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1390,8 +1390,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a ' . "\n"; // Raven.js for client-side Sentry logging support - if (array_key_exists('mod_syslog_sentry', $conf->loghandlers) && ! empty($conf->global->SYSLOG_SENTRY_DSN)) { - + if (array_key_exists('mod_syslog_sentry', $conf->loghandlers) && ! empty($conf->global->SYSLOG_SENTRY_DSN)) + { // Filter out secret key $dsn = parse_url($conf->global->SYSLOG_SENTRY_DSN); $public_dsn = $dsn['scheme'] . '://' . $dsn['user'] .'@' . $dsn['host'] . $dsn['path']; @@ -1465,7 +1465,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a // Login name with tooltip $toprightmenu.='
'; $toprightmenu.=''; diff --git a/htdocs/theme/md_exp/img/title_hrm.png b/htdocs/theme/md_exp/img/title_hrm.png new file mode 100644 index 0000000000000000000000000000000000000000..de788526bc1e458293e2c957066e54695c1d44f3 GIT binary patch literal 1028 zcmV+f1pE7mP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2j2!1 z7C8iN#ivsM00V?cL_t(o!|j+$PZLoXhM$>&(gFg4fEP4)A)+Lj8ob1~FuHK*MiX}? z#$Vun@IUw;bYQa}wY=k&9o^LnM2Xq6wfV94`4QK%7ff3;2Rsr7#+yE{Cdw~qlBu(iX4&VX> z;3x0{cmzBIW;X+T7jPc90-OPcL?n**z+2!c@C10QUD*&x1GfdhU#GqY?f@5nmW=>^ zTq|Y+DM{_$?C}y%w8mZo*MRMDL8Ph#p8`68exThlLq}ko3g+or<2}GdzyqGe0ntz; z_#AK#xDV_E_K3uFAS-8W)cg*x3ao{gg=4I|qXlV;3!+-^YrwQLm?xtUco^sqnKs}o z@CKLwE{klSjn=Mw0P;zL4@>WWOSAkPy z#&;;W1=1dOVmD#nO>#i5%sVCd1VHoutbCH-9hptu02e09a@Y=K;KD}Rd^rL^Traos zbJa{92YlLi&rU!^IjbM>-)7^TnoAt;gTO(N$O}wSWAnflU_8Pk_scB)Y!>)o;1)0- z+bzif8-Xd{0dO~B?xQNcW|IIP$6;RppB0nWwCb*|-DSd{qj9f{StY*muYfV&L`Yfd zsLn}gN7_Vi(J(JRsb~CcSgqNrqLU z^oJxE$1pEM$df-6L@p1^$eg~Zhs^=Mjj&sD@JD3pL%;#6%kd-bqx`0%n7^d!f^=SF zCXEuiYVavJ=zx+_pPC3K0;F$^MLiQjwkZFZ)v3aab|VM;s#K)ety+tYFHQo-B0fk6 zD8ItHmB!59ipneFBCrw^ciC*#8yy|>!s2`@a9U9!9TMLBm_XL^ZgAf#MLRJqU&(2Q z{sEs=L@8RpYYnj6Z__fPjFR1|d?F{)@}e^An4&|_TiT~xDP5B!<0-sO8PRObP(RA% zUA1Hxqw9B#vEbR&c!NPQcupB4UE_bYZ`kKLK`F7Ma5|afai41(ZP?dT1Q9}j7Yz;C y#T7*vFDdYG=Z!je3UkuL3b?w|r7m?@pZo=NH7Uu*yF-lt0000getFullName($langs,'',-1,$maxlen) . $linkend . $companylink; + $result.= $link . $this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen) . $linkend . $companylink; return $result; }