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.='