Change deprecated properties with new name

This commit is contained in:
Laurent Destailleur 2019-09-01 22:21:48 +02:00
parent f6c2fb77ae
commit 97a1a47266
7 changed files with 30 additions and 29 deletions

View File

@ -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 "</td>\n";
// Company
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOST('societe', 'alpha')?GETPOST('societe', 'alpha'):$object->societe).'"></td></tr>';
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOST('societe', 'alpha')?GETPOST('societe', 'alpha'):$object->company).'"></td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
@ -1066,7 +1067,7 @@ else
{
print $object->showOptionals($extrafields, 'edit');
}
print '<tbody>';
print "</table>\n";
dol_fiche_end();
@ -1206,7 +1207,7 @@ else
print "</td></tr>";
// Company
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(isset($_POST["societe"])?GETPOST("societe", '', 2):$object->societe).'"></td></tr>';
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(isset($_POST["societe"])?GETPOST("societe", '', 2):$object->company).'"></td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
@ -1370,7 +1371,7 @@ else
{
print $object->showOptionals($extrafields, 'edit');
}
print '</table>';
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 '</td></tr>';
// Company
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'</td></tr>';
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>';

View File

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

View File

@ -134,7 +134,7 @@ if ($id > 0)
print '</tr>';
// Company
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'</td></tr>';
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>';

View File

@ -686,7 +686,7 @@ while ($i < min($num, $limit))
} else {
$companyname=$obj->company;
}
$memberstatic->societe = $companyname;
$memberstatic->company = $companyname;
print '<tr class="oddeven">';

View File

@ -99,7 +99,7 @@ if ($id)
print '</tr>';
// Company
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'</td></tr>';
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>';

View File

@ -494,7 +494,7 @@ if ($rowid > 0)
print '</tr>';
// Company
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'</td></tr>';
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>';
@ -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

View File

@ -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 '<tr class="oddeven">';
if ($objp->societe != '')
if ($objp->company != '')
{
print '<td><a href="card.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->societe, 12).'</a></td>'."\n";
}