Skip to content

Commit

Permalink
NEW hidden option MAIN_TE_PRIVATE_FIRST_AND_LASTNAME_TO_UPPER (Doliba…
Browse files Browse the repository at this point in the history
…rr#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
  • Loading branch information
daraelmin authored Sep 26, 2024
1 parent 94310fa commit 73c2c2b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions htdocs/core/class/commonpeople.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,19 @@ public function getBannerAddress($htmlkey, $object)
*/
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));
Expand Down

0 comments on commit 73c2c2b

Please sign in to comment.