From 43f150dc426aafd016972b2dad0c2aaa3571a773 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 12 Dec 2019 17:02:59 +0100 Subject: [PATCH 1/6] Update societe.class.php --- htdocs/societe/class/societe.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c2017c894c0..286aa63821e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -673,6 +673,7 @@ class Societe extends CommonObject if (empty($this->status)) $this->status = 0; $this->name = $this->name ?trim($this->name) : trim($this->nom); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->name = ucwords($this->name); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->name=strtoupper($this->name); $this->nom = $this->name; // For backward compatibility if (empty($this->client)) $this->client = 0; if (empty($this->fournisseur)) $this->fournisseur = 0; @@ -987,7 +988,9 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::Update id=".$id." call_trigger=".$call_trigger." allowmodcodeclient=".$allowmodcodeclient." allowmodcodefournisseur=".$allowmodcodefournisseur); $now = dol_now(); - + + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->name = ucwords($this->name); + if (! empty($conf->global->MAIN_ALL_TO_UPPER)) $this->name=strtoupper($this->name); // Clean parameters $this->id = $id; $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); From 380b698c6f6c664a56e7263fdddf820b01a11c0b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 12 Dec 2019 16:09:23 +0000 Subject: [PATCH 2/6] Fixing style errors. --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 286aa63821e..3160a701f64 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -988,7 +988,7 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::Update id=".$id." call_trigger=".$call_trigger." allowmodcodeclient=".$allowmodcodeclient." allowmodcodefournisseur=".$allowmodcodefournisseur); $now = dol_now(); - + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->name = ucwords($this->name); if (! empty($conf->global->MAIN_ALL_TO_UPPER)) $this->name=strtoupper($this->name); // Clean parameters From 21a28e4bb48ba607c5575624c434337c44914d09 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 12 Dec 2019 17:20:20 +0100 Subject: [PATCH 3/6] Update contact.class.php --- htdocs/contact/class/contact.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index a945e8cb5a5..ddad3792a2b 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -261,6 +261,7 @@ class Contact extends CommonObject $this->lastname = $this->lastname ?trim($this->lastname) : trim($this->name); $this->firstname = trim($this->firstname); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); if (empty($this->socid)) $this->socid = 0; if (empty($this->priv)) $this->priv = 0; @@ -372,6 +373,10 @@ class Contact extends CommonObject $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); // Clean parameters + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); + $this->lastname = trim($this->lastname) ?trim($this->lastname) : trim($this->lastname); $this->firstname = trim($this->firstname); $this->email = trim($this->email); From ffde746479371f0754e3f408aa3e19db9eb4d94b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 12 Dec 2019 16:22:07 +0000 Subject: [PATCH 4/6] Fixing style errors. --- htdocs/contact/class/contact.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index ddad3792a2b..0c8da446df7 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -376,7 +376,7 @@ class Contact extends CommonObject if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); - + $this->lastname = trim($this->lastname) ?trim($this->lastname) : trim($this->lastname); $this->firstname = trim($this->firstname); $this->email = trim($this->email); From 68a1b12fbab1e218c894ae9b8d557d66a0aef888 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 12 Dec 2019 17:27:24 +0100 Subject: [PATCH 5/6] Update user.class.php --- htdocs/user/class/user.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ffb8c15e3c3..10a71dadd6c 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1175,6 +1175,11 @@ class User extends CommonObject global $mysoc; // Clean parameters + + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname=strtoupper($this->lastname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); + $this->login = trim($this->login); if (!isset($this->entity)) $this->entity = $conf->entity; // If not defined, we use default value @@ -1513,6 +1518,11 @@ class User extends CommonObject dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember.", nosyncmemberpass=".$nosyncmemberpass); // Clean parameters + + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname=strtoupper($this->lastname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); + $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); $this->employee = $this->employee ? $this->employee : 0; From 31b09f433ffe914e7eff46c9c03e343bdc43940a Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 12 Dec 2019 16:29:11 +0000 Subject: [PATCH 6/6] Fixing style errors. --- htdocs/user/class/user.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 10a71dadd6c..051c9f43d0c 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1175,11 +1175,11 @@ class User extends CommonObject global $mysoc; // Clean parameters - + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname=strtoupper($this->lastname); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); - + $this->login = trim($this->login); if (!isset($this->entity)) $this->entity = $conf->entity; // If not defined, we use default value @@ -1518,11 +1518,11 @@ class User extends CommonObject dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember.", nosyncmemberpass=".$nosyncmemberpass); // Clean parameters - + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname); if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname=strtoupper($this->lastname); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); - + $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); $this->employee = $this->employee ? $this->employee : 0;