From b9a44fc76bbe4fe4f84f8fdfe0b41ab278b82fe3 Mon Sep 17 00:00:00 2001 From: ATM-Nicolas Date: Tue, 31 Jul 2018 12:15:18 +0200 Subject: [PATCH 1/3] FIX : Wrong position of firstname lastname --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d9c86dd45f4..7b8d110802c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5856,7 +5856,7 @@ function dolGetFirstLastname($firstname,$lastname,$nameorder=-1) $ret=''; // If order not defined, we use the setup if ($nameorder < 0) $nameorder=$conf->global->MAIN_FIRSTNAME_NAME_POSITION; - if ($nameorder && ((string) $nameorder != '2')) + if (empty($nameorder) && ((string) $nameorder != '2')) { $ret.=$firstname; if ($firstname && $lastname) $ret.=' '; From 70adfb135dc332c30a225b1412fd1e50f71f2992 Mon Sep 17 00:00:00 2001 From: ATM-Nicolas Date: Fri, 3 Aug 2018 09:51:29 +0200 Subject: [PATCH 2/3] FIX : Missing behavior --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7b8d110802c..28a31507733 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5855,8 +5855,8 @@ function dolGetFirstLastname($firstname,$lastname,$nameorder=-1) $ret=''; // If order not defined, we use the setup - if ($nameorder < 0) $nameorder=$conf->global->MAIN_FIRSTNAME_NAME_POSITION; - if (empty($nameorder) && ((string) $nameorder != '2')) + if ($nameorder < 0) $nameorder=empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION); + if ($nameorder && ((string) $nameorder != '2')) { $ret.=$firstname; if ($firstname && $lastname) $ret.=' '; From 6954ab00f9ada8e986af9594e210034652e834f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Aug 2018 18:11:27 +0200 Subject: [PATCH 3/3] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 28a31507733..f27c1fbf0a0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5855,7 +5855,7 @@ 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 < 0) $nameorder=(empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?1:0); if ($nameorder && ((string) $nameorder != '2')) { $ret.=$firstname;