From 97a1a47266523610735db2fb795b4a82b7216e41 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Sep 2019 22:21:48 +0200 Subject: [PATCH] Change deprecated properties with new name --- htdocs/adherents/card.php | 19 +++++++++--------- htdocs/adherents/class/adherent.class.php | 24 +++++++++++------------ htdocs/adherents/document.php | 2 +- htdocs/adherents/list.php | 2 +- htdocs/adherents/note.php | 2 +- htdocs/adherents/subscription.php | 6 +++--- htdocs/adherents/type.php | 4 ++-- 7 files changed, 30 insertions(+), 29 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index a6fd91a4210..5836bf48332 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -289,7 +289,7 @@ if (empty($reshook)) $object->login = trim(GETPOST("login", 'alpha')); $object->pass = trim(GETPOST("pass", 'alpha')); - $object->societe = trim(GETPOST("societe", 'alpha')); + $object->societe = trim(GETPOST("societe", 'alpha')); // deprecated $object->company = trim(GETPOST("societe", 'alpha')); $object->address = trim(GETPOST("address", 'alpha')); @@ -468,7 +468,8 @@ if (empty($reshook)) $object->firstname = $firstname; $object->lastname = $lastname; $object->gender = $gender; - $object->societe = $societe; + $object->societe = $societe; // deprecated + $object->company = $societe; $object->address = $address; $object->zip = $zip; $object->town = $town; @@ -946,7 +947,7 @@ else print "\n"; // Company - print ''.$langs->trans("Company").''; + print ''.$langs->trans("Company").''; // Civility print ''.$langs->trans("UserTitle").''; @@ -1066,7 +1067,7 @@ else { print $object->showOptionals($extrafields, 'edit'); } - + print ''; print "\n"; dol_fiche_end(); @@ -1206,7 +1207,7 @@ else print ""; // Company - print ''.$langs->trans("Company").'societe).'">'; + print ''.$langs->trans("Company").'company).'">'; // Civility print ''.$langs->trans("UserTitle").''; @@ -1370,7 +1371,7 @@ else { print $object->showOptionals($extrafields, 'edit'); } - + print ''; dol_fiche_end(); @@ -1447,13 +1448,13 @@ else if ($object->morphy == 'mor') { - $companyname=$object->societe; + $companyname=$object->company; if (! empty($fullname)) $companyalias=$fullname; } else { $companyname=$fullname; - if (! empty($object->societe)) $companyalias=$object->societe; + if (! empty($object->company)) $companyalias=$object->company; } // Create a form array @@ -1635,7 +1636,7 @@ else print ''; // Company - print ''.$langs->trans("Company").''.$object->societe.''; + print ''.$langs->trans("Company").''.$object->company.''; // Civility print ''.$langs->trans("UserTitle").''.$object->getCivilityLabel().' '; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a90eb0d00c1..62e7720035e 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -324,7 +324,7 @@ class Adherent extends CommonObject $infos.= $langs->transnoentities("id").": ".$this->id."\n"; $infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n"; $infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n"; - $infos.= $langs->transnoentities("Company").": ".$this->societe."\n"; + $infos.= $langs->transnoentities("Company").": ".$this->company."\n"; $infos.= $langs->transnoentities("Address").": ".$this->address."\n"; $infos.= $langs->transnoentities("Zip").": ".$this->zip."\n"; $infos.= $langs->transnoentities("Town").": ".$this->town."\n"; @@ -350,7 +350,7 @@ class Adherent extends CommonObject '__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):($this->firstname?$this->firstname:''), '__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):($this->lastname?$this->lastname:''), '__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs), - '__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):($this->societe?$this->societe:''), + '__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->company):($this->company?$this->company:''), '__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):($this->address?$this->address:''), '__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):($this->zip?$this->zip:''), '__TOWN__'=>$msgishtml?dol_htmlentitiesbr($this->town):($this->town?$this->town:''), @@ -558,7 +558,7 @@ class Adherent extends CommonObject $sql.= ", lastname = ".($this->lastname?"'".$this->db->escape($this->lastname)."'":"null"); $sql.= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman' $sql.= ", login = ".($this->login?"'".$this->db->escape($this->login)."'":"null"); - $sql.= ", societe = ".($this->societe?"'".$this->db->escape($this->societe)."'":"null"); + $sql.= ", societe = ".($this->company?"'".$this->db->escape($this->company)."'":"null"); $sql.= ", fk_soc = ".($this->socid > 0?$this->db->escape($this->socid):"null"); $sql.= ", address = ".($this->address?"'".$this->db->escape($this->address)."'":"null"); $sql.= ", zip = ".($this->zip?"'".$this->db->escape($this->zip)."'":"null"); @@ -682,7 +682,7 @@ class Adherent extends CommonObject $luser->lastname=$this->lastname; $luser->gender=$this->gender; $luser->pass=$this->pass; - $luser->societe_id=$this->societe; + //$luser->socid=$this->fk_soc; // We do not enable this. This may transform a user into an external user. $luser->birth=$this->birth; @@ -1608,13 +1608,13 @@ class Adherent extends CommonObject if ($this->morphy == 'mor') { - $companyname=$this->societe; + $companyname=$this->company; if (! empty($fullname)) $companyalias=$fullname; } else { $companyname=$fullname; - if (! empty($this->societe)) $companyalias=$this->societe; + if (! empty($this->company)) $companyalias=$this->company; } $result=$customer->create_from_member($this, $companyname, $companyalias); @@ -2297,7 +2297,7 @@ class Adherent extends CommonObject // phpcs:enable global $conf, $langs; - if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe + if ($user->socid) return -1; // protection pour eviter appel par utilisateur externe $now=dol_now(); @@ -2398,7 +2398,7 @@ class Adherent extends CommonObject $this->gender='man'; $this->login='dolibspec'; $this->pass='dolibspec'; - $this->societe = 'Societe ABC'; + $this->company = 'Societe ABC'; $this->address = '61 jump street'; $this->zip = '75000'; $this->town = 'Paris'; @@ -2483,9 +2483,9 @@ class Adherent extends CommonObject $this->fullname=$this->getFullName($langs); // For avoid ldap error when firstname and lastname are empty - if ($this->morphy == 'mor' && (empty($this->fullname) || $this->fullname == $this->societe)) { - $this->fullname = $this->societe; - $this->lastname = $this->societe; + if ($this->morphy == 'mor' && (empty($this->fullname) || $this->fullname == $this->company)) { + $this->fullname = $this->company; + $this->lastname = $this->company; } // Possible LDAP KEY (constname => varname) @@ -2513,7 +2513,7 @@ class Adherent extends CommonObject } if ($this->firstname && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->firstname; if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste; - if ($this->societe && ! empty($conf->global->LDAP_MEMBER_FIELD_COMPANY)) $info[$conf->global->LDAP_MEMBER_FIELD_COMPANY] = $this->societe; + if ($this->company && ! empty($conf->global->LDAP_MEMBER_FIELD_COMPANY)) $info[$conf->global->LDAP_MEMBER_FIELD_COMPANY] = $this->company; if ($this->address && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->address; if ($this->zip && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->zip; if ($this->town && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->town; diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 72a1bd0d569..7d9b3405d1e 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -134,7 +134,7 @@ if ($id > 0) print ''; // Company - print ''.$langs->trans("Company").''.$object->societe.''; + print ''.$langs->trans("Company").''.$object->company.''; // Civility print ''.$langs->trans("UserTitle").''.$object->getCivilityLabel().' '; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 5ef4f90b605..3ddf739c813 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -686,7 +686,7 @@ while ($i < min($num, $limit)) } else { $companyname=$obj->company; } - $memberstatic->societe = $companyname; + $memberstatic->company = $companyname; print ''; diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index ce2918cb86a..07a902f0a3d 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -99,7 +99,7 @@ if ($id) print ''; // Company - print ''.$langs->trans("Company").''.$object->societe.''; + print ''.$langs->trans("Company").''.$object->company.''; // Civility print ''.$langs->trans("UserTitle").''.$object->getCivilityLabel().' '; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index ab8206c66b8..7dd5a8ce23a 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -494,7 +494,7 @@ if ($rowid > 0) print ''; // Company - print ''.$langs->trans("Company").''.$object->societe.''; + print ''.$langs->trans("Company").''.$object->company.''; // Civility print ''.$langs->trans("UserTitle").''.$object->getCivilityLabel().' '; @@ -862,13 +862,13 @@ if ($rowid > 0) if ($object->morphy == 'mor') { - $companyname=$object->societe; + $companyname=$object->company; if (! empty($fullname)) $companyalias=$fullname; } else { $companyname=$fullname; - if (! empty($object->societe)) $companyalias=$object->societe; + if (! empty($object->company)) $companyalias=$object->company; } // Create a form array diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 410d5ca254f..0c32e33164d 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -489,7 +489,7 @@ if ($rowid > 0) $now=dol_now(); - $sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, "; + $sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe as company,"; $sql.= " d.datefin,"; $sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,"; $sql.= " t.libelle as type, t.subscription"; @@ -649,7 +649,7 @@ if ($rowid > 0) // Lastname print ''; - if ($objp->societe != '') + if ($objp->company != '') { print ''.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->societe, 12).''."\n"; }