NEW hidden option MAIN_TE_PRIVATE_FIRST_AND_LASTNAME_TO_UPPER (#31143)

* 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
This commit is contained in:
daraelmin
2024-09-27 01:45:01 +02:00
committed by GitHub
parent 94310faaac
commit 73c2c2bdcc

View File

@@ -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));