From 73c2c2bdcc791f44a81ebbdfe02f2e22ef7187ec Mon Sep 17 00:00:00 2001 From: daraelmin <8067223+daraelmin@users.noreply.github.com> Date: Fri, 27 Sep 2024 01:45:01 +0200 Subject: [PATCH] NEW hidden option MAIN_TE_PRIVATE_FIRST_AND_LASTNAME_TO_UPPER (#31143) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * NEW hidden option MAIN_TE_PRIVATE_FIRST_AND_LASTNAME_TO_UPPER Hidden option to force the formatting of third-party “natural person” names as follows: First Name LAST NAME * FIX Tabs must be used to indent lines; spaces are not allowed --- htdocs/core/class/commonpeople.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/core/class/commonpeople.class.php b/htdocs/core/class/commonpeople.class.php index c9d7dba4cb9..016a5a185a6 100644 --- a/htdocs/core/class/commonpeople.class.php +++ b/htdocs/core/class/commonpeople.class.php @@ -315,6 +315,19 @@ trait CommonPeople */ public function setUpperOrLowerCase() { + if (getDolGlobalString('MAIN_TE_PRIVATE_FIRST_AND_LASTNAME_TO_UPPER')) { + $this->lastname = dol_ucwords(dol_strtolower($this->lastname)); + $this->firstname = dol_ucwords(dol_strtolower($this->firstname)); + if (empty($this->typent_code) || $this->typent_code != "TE_PRIVATE") { + $this->name = dol_ucwords(dol_strtolower($this->name)); + } + if (!empty($this->firstname)) { + $this->lastname = dol_strtoupper($this->lastname); + } + if (property_exists($this, 'name_alias')) { + $this->name_alias = isset($this->name_alias) ? dol_ucwords(dol_strtolower($this->name_alias)) : ''; + } + } if (getDolGlobalString('MAIN_FIRST_TO_UPPER')) { $this->lastname = dol_ucwords(dol_strtolower($this->lastname)); $this->firstname = dol_ucwords(dol_strtolower($this->firstname));