From 63100c9c065f8642e7ebdd48c5e1afa19f34fe2f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 May 2014 00:23:09 +0200 Subject: [PATCH] Properties "civilite_id" were renamed into "civility_id". --- ChangeLog | 2 +- .../actions_adherentcard_common.class.php | 4 +- htdocs/adherents/class/adherent.class.php | 18 ++--- htdocs/adherents/fiche.php | 12 ++-- .../actions_contactcard_common.class.php | 4 +- htdocs/contact/class/contact.class.php | 12 ++-- htdocs/contact/fiche.php | 8 +-- htdocs/core/boxes/box_contacts.php | 4 +- htdocs/core/class/html.formcompany.class.php | 6 +- htdocs/core/lib/company.lib.php | 4 +- .../modules/mailings/contacts1.modules.php | 4 +- .../modules/mailings/contacts2.modules.php | 4 +- .../modules/mailings/contacts3.modules.php | 4 +- .../modules/mailings/contacts4.modules.php | 8 +-- .../core/modules/mailings/fraise.modules.php | 4 +- .../core/modules/mailings/pomme.modules.php | 4 +- htdocs/core/modules/modCategorie.class.php | 2 +- htdocs/public/members/new.php | 6 +- .../canvas/actions_card_common.class.php | 4 +- .../actions_card_individual.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- htdocs/societe/soc.php | 4 +- htdocs/webservices/server_contact.php | 68 +++++++++---------- htdocs/webservices/server_user.php | 2 +- test/phpunit/AdherentTest.php | 6 +- 25 files changed, 99 insertions(+), 99 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9111edc92b9..81f8d6c1a3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -95,7 +95,7 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f - The following hooks are now 'addreplace' hooks: "formCreateThirdpartyOptions" So check that return value is 0 to keep default standard behaviour after hook or 1 to disable default standard behaviour. - +- Properties "civilite_id" were renamed into "civility_id". ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index 269e5389eee..fc593e826f2 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -273,7 +273,7 @@ abstract class ActionsAdherentCardCommon } // Civility - $this->tpl['select_civility'] = $formcompany->select_civility($this->object->civilite_id); + $this->tpl['select_civility'] = $formcompany->select_civility($this->object->civility_id); // Predefined with third party if ((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE')) @@ -397,7 +397,7 @@ abstract class ActionsAdherentCardCommon $this->object->fk_soc = $_POST["fk_soc"]; $this->object->lastname = $_POST["lastname"]; $this->object->firstname = $_POST["firstname"]; - $this->object->civilite_id = $_POST["civilite_id"]; + $this->object->civility_id = $_POST["civility_id"]; $this->object->address = $_POST["address"]; $this->object->zip = $_POST["zipcode"]; $this->object->town = $_POST["town"]; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index db144b482b6..b98f9364f0b 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -45,7 +45,7 @@ class Adherent extends CommonObject var $id; var $ref; - var $civilite_id; + var $civility_id; var $firstname; var $lastname; var $login; @@ -184,7 +184,7 @@ class Adherent extends CommonObject if (dol_textishtml($text,1)) $msgishtml = 1; $infos=''; - if ($this->civilite_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n"; + if ($this->civility_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n"; $infos.= $langs->transnoentities("id").": ".$this->id."\n"; $infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n"; $infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n"; @@ -207,7 +207,7 @@ class Adherent extends CommonObject $substitutionarray=array( '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, '%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id, - '%CIVILITE%'=>$this->getCivilityLabel($msgishtml?0:1), + '%CIVILITY%'=>$this->getCivilityLabel($msgishtml?0:1), '%FIRSTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, '%LASTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, '%FULLNAME%'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs), @@ -425,7 +425,7 @@ class Adherent extends CommonObject $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; - $sql.= " civilite = ".(!is_null($this->civilite_id)?"'".$this->civilite_id."'":"null"); + $sql.= " civilite = ".(!is_null($this->civility_id)?"'".$this->civility_id."'":"null"); $sql.= ", firstname = ".($this->firstname?"'".$this->db->escape($this->firstname)."'":"null"); $sql.= ", lastname=" .($this->lastname?"'".$this->db->escape($this->lastname)."'":"null"); $sql.= ", login=" .($this->login?"'".$this->db->escape($this->login)."'":"null"); @@ -526,7 +526,7 @@ class Adherent extends CommonObject if ($result >= 0) { - $luser->civilite_id=$this->civilite_id; + $luser->civility_id=$this->civility_id; $luser->firstname=$this->firstname; $luser->lastname=$this->lastname; $luser->login=$this->user_login; @@ -1056,7 +1056,7 @@ class Adherent extends CommonObject { global $langs; - $sql = "SELECT d.rowid, d.ref_ext, d.civilite, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,"; + $sql = "SELECT d.rowid, d.ref_ext, d.civilite as civility_id, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,"; $sql.= " d.email, d.skype, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,"; $sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,"; $sql.= " d.datec as datec,"; @@ -1098,7 +1098,7 @@ class Adherent extends CommonObject $this->ref = $obj->rowid; $this->id = $obj->rowid; $this->ref_ext = $obj->ref_ext; - $this->civilite_id = $obj->civilite; + $this->civility_id = $obj->civility; $this->firstname = $obj->firstname; $this->lastname = $obj->lastname; $this->login = $obj->login; @@ -1552,7 +1552,7 @@ class Adherent extends CommonObject global $langs; $langs->load("dict"); - $code=(! empty($this->civilite_id)?$this->civilite_id:(! empty($this->civility_id)?$this->civility_id:'')); + $code=(empty($this->civility_id)?'':$this->civility_id); if (empty($code)) return ''; return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); } @@ -1779,7 +1779,7 @@ class Adherent extends CommonObject // Initialise parametres $this->id=0; $this->specimen=1; - $this->civilite_id = 0; + $this->civility_id = 0; $this->lastname = 'DOLIBARR'; $this->firstname = 'SPECIMEN'; $this->login='dolibspec'; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 1e3342d69f0..e57e2b9eb1c 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -266,7 +266,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $object->oldcopy=dol_clone($object); // Change values - $object->civilite_id = trim($_POST["civilite_id"]); + $object->civility_id = trim($_POST["civility_id"]); $object->firstname = trim($_POST["firstname"]); $object->lastname = trim($_POST["lastname"]); $object->login = trim($_POST["login"]); @@ -415,7 +415,7 @@ if ($action == 'add' && $user->rights->adherent->creer) } $typeid=$_POST["typeid"]; - $civilite_id=$_POST["civilite_id"]; + $civility_id=$_POST["civility_id"]; $lastname=$_POST["lastname"]; $firstname=$_POST["firstname"]; $societe=$_POST["societe"]; @@ -441,7 +441,7 @@ if ($action == 'add' && $user->rights->adherent->creer) $userid=$_POST["userid"]; $socid=$_POST["socid"]; - $object->civilite_id = $civilite_id; + $object->civility_id = $civility_id; $object->firstname = $firstname; $object->lastname = $lastname; $object->societe = $societe; @@ -794,7 +794,7 @@ else // Civility print ''.$langs->trans("UserTitle").''; - print $formcompany->select_civility(GETPOST('civilite_id','int')?GETPOST('civilite_id','int'):$object->civilite_id,'civilite_id').''; + print $formcompany->select_civility(GETPOST('civility_id','int')?GETPOST('civility_id','int'):$object->civility_id,'civility_id').''; print ''; // Lastname @@ -1044,9 +1044,9 @@ else // Company print ''.$langs->trans("Company").'societe).'">'; - // Civilite + // Civility print ''.$langs->trans("UserTitle").''; - print $formcompany->select_civility(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$object->civilite_id)."\n"; + print $formcompany->select_civility(isset($_POST["civility_id"])?$_POST["civility_id"]:$object->civility_id)."\n"; print ''; print ''; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 135431316a6..a2612e51e47 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -273,7 +273,7 @@ abstract class ActionsContactCardCommon } // Civility - $this->tpl['select_civility'] = $formcompany->select_civility($this->object->civilite_id); + $this->tpl['select_civility'] = $formcompany->select_civility($this->object->civility_id); // Predefined with third party if ((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE') || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) @@ -429,7 +429,7 @@ abstract class ActionsContactCardCommon $this->object->socid = $_POST["socid"]; $this->object->lastname = $_POST["name"]; $this->object->firstname = $_POST["firstname"]; - $this->object->civilite_id = $_POST["civilite_id"]; + $this->object->civility_id = $_POST["civility_id"]; $this->object->poste = $_POST["poste"]; $this->object->address = $_POST["address"]; $this->object->zip = $_POST["zipcode"]; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 4a9077d498a..6d41a9ca4f5 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -42,7 +42,7 @@ class Contact extends CommonObject var $id; var $ref_ext; - var $civilite_id; // In fact we store civility_code + var $civility_id; // In fact we store civility_code var $lastname; var $firstname; var $address; @@ -251,7 +251,7 @@ class Contact extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET "; if ($this->socid > 0) $sql .= " fk_soc='".$this->db->escape($this->socid)."',"; else if ($this->socid == -1) $sql .= " fk_soc=null,"; - $sql .= " civilite='".$this->db->escape($this->civilite_id)."'"; + $sql .= " civilite='".$this->db->escape($this->civility_id)."'"; $sql .= ", lastname='".$this->db->escape($this->lastname)."'"; $sql .= ", firstname='".$this->db->escape($this->firstname)."'"; $sql .= ", address='".$this->db->escape($this->address)."'"; @@ -504,7 +504,7 @@ class Contact extends CommonObject $langs->load("companies"); - $sql = "SELECT c.rowid, c.fk_soc, c.ref_ext, c.civilite as civilite_id, c.lastname, c.firstname,"; + $sql = "SELECT c.rowid, c.fk_soc, c.ref_ext, c.civilite as civility_id, c.lastname, c.firstname,"; $sql.= " c.address, c.statut, c.zip, c.town,"; $sql.= " c.fk_pays as country_id,"; $sql.= " c.fk_departement,"; @@ -534,7 +534,7 @@ class Contact extends CommonObject $this->id = $obj->rowid; $this->ref = $obj->rowid; $this->ref_ext = $obj->ref_ext; - $this->civilite_id = $obj->civilite_id; + $this->civility_id = $obj->civility_id; $this->lastname = $obj->lastname; $this->firstname = $obj->firstname; $this->address = $obj->address; @@ -887,7 +887,7 @@ class Contact extends CommonObject /** * Return name of contact with link (and eventually picto) - * Use $this->id, $this->lastname, $this->firstname, this->civilite_id + * Use $this->id, $this->lastname, $this->firstname, this->civility_id * * @param int $withpicto Include picto with link * @param string $option Where the link point to @@ -924,7 +924,7 @@ class Contact extends CommonObject global $langs; $langs->load("dict"); - $code=(! empty($this->civilite_id)?$this->civilite_id:(! empty($this->civility_id)?$this->civility_id:'')); + $code=(! empty($this->civility_id)?$this->civility_id:(! empty($this->civility_id)?$this->civility_id:'')); if (empty($code)) return ''; return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); } diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 7d682dfebd2..eeecd63718d 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -162,7 +162,7 @@ if (empty($reshook)) $object->socid = $_POST["socid"]; $object->lastname = $_POST["lastname"]; $object->firstname = $_POST["firstname"]; - $object->civilite_id = $_POST["civilite_id"]; + $object->civility_id = $_POST["civility_id"]; $object->poste = $_POST["poste"]; $object->address = $_POST["address"]; $object->zip = $_POST["zipcode"]; @@ -260,7 +260,7 @@ if (empty($reshook)) $object->socid = $_POST["socid"]; $object->lastname = $_POST["lastname"]; $object->firstname = $_POST["firstname"]; - $object->civilite_id = $_POST["civilite_id"]; + $object->civility_id = $_POST["civility_id"]; $object->poste = $_POST["poste"]; $object->address = $_POST["address"]; @@ -447,7 +447,7 @@ else // Civility print ''.$langs->trans("UserTitle").''; - print $formcompany->select_civility(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$object->civilite_id); + print $formcompany->select_civility(isset($_POST["civility_id"])?$_POST["civility_id"]:$object->civility_id); print ''; print ''.$langs->trans("PostOrFunction").'poste).'">'; @@ -663,7 +663,7 @@ else // Civility print ''.$langs->trans("UserTitle").''; - print $formcompany->select_civility(isset($_POST["civilite_id"])?$_POST["civilite_id"]:$object->civilite_id); + print $formcompany->select_civility(isset($_POST["civility_id"])?$_POST["civility_id"]:$object->civility_id); print ''; print ''.$langs->trans("PostOrFunction").'poste).'">'; diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 56192aef51e..1afc0d09e41 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -61,7 +61,7 @@ class box_contacts extends ModeleBoxes if ($user->rights->societe->lire) { - $sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.civilite, sp.datec, sp.tms, sp.fk_soc,"; + $sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.civilite as civility_id, sp.datec, sp.tms, sp.fk_soc,"; $sql.= " s.nom as socname"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid"; @@ -89,7 +89,7 @@ class box_contacts extends ModeleBoxes $contactstatic->lastname=$objp->lastname; $contactstatic->firstname=$objp->firstname; - $contactstatic->civilite_id=$objp->civilite; + $contactstatic->civility_id=$objp->civility_id; $societestatic->id=$objp->fk_soc; $societestatic->name=$objp->socname; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 623864ebd1d..a22f0b38c10 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -359,14 +359,14 @@ class FormCompany * @param string $htmlname Name of HTML select combo field * @return string String with HTML select */ - function select_civility($selected='',$htmlname='civilite_id') + function select_civility($selected='',$htmlname='civility_id') { global $conf,$langs,$user; $langs->load("dict"); $out=''; - $sql = "SELECT rowid, code, civilite, active FROM ".MAIN_DB_PREFIX."c_civilite"; + $sql = "SELECT rowid, code, civilite as civility_label, active FROM ".MAIN_DB_PREFIX."c_civilite"; $sql.= " WHERE active = 1"; dol_syslog("Form::select_civility sql=".$sql); @@ -391,7 +391,7 @@ class FormCompany $out.= ''; $i++; } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 841df7b5d40..0851fb0b7c1 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -648,7 +648,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays as country_id, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.skype, p.statut "; - $sql .= ", p.civilite, p.address, p.zip, p.town"; + $sql .= ", p.civilite as civility_id, p.address, p.zip, p.town"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql .= " WHERE p.fk_soc = ".$object->id; if ($search_status!='') $sql .= " AND p.statut = ".$db->escape($search_status); @@ -675,7 +675,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $contactstatic->statut = $obj->statut; $contactstatic->lastname = $obj->lastname; $contactstatic->firstname = $obj->firstname; - $contactstatic->civilite = $obj->civilite; + $contactstatic->civility_id = $obj->civility_id; print $contactstatic->getNomUrl(1); print ''; diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 5143ffd3fc3..3d0b0946b8f 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -197,7 +197,7 @@ class mailing_contacts1 extends MailingTargets // La requete doit retourner: id, email, fk_contact, name, firstname, other $sql = "SELECT c.rowid as id, c.email as email, c.rowid as fk_contact,"; - $sql.= " c.lastname, c.firstname, c.civilite,"; + $sql.= " c.lastname, c.firstname, c.civilite as civility_id,"; $sql.= " s.nom as companyname"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc"; @@ -239,7 +239,7 @@ class mailing_contacts1 extends MailingTargets 'firstname' => $obj->firstname, 'other' => ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civilite?$langs->transnoentities("Civility".$obj->civilite):'')), + ($langs->transnoentities("UserTitle").'='.($obj->civilite_id?$langs->transnoentities("Civility".$obj->civilite_id):'')), 'source_url' => $this->url($obj->id), 'source_id' => $obj->id, 'source_type' => 'contact' diff --git a/htdocs/core/modules/mailings/contacts2.modules.php b/htdocs/core/modules/mailings/contacts2.modules.php index c1018284a4c..7f07cc7fa0a 100644 --- a/htdocs/core/modules/mailings/contacts2.modules.php +++ b/htdocs/core/modules/mailings/contacts2.modules.php @@ -79,7 +79,7 @@ class mailing_contacts2 extends MailingTargets // La requete doit retourner: id, email, fk_contact, name, firstname, other $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,"; - $sql.= " sp.lastname, sp.firstname as firstname, sp.civilite,"; + $sql.= " sp.lastname, sp.firstname as firstname, sp.civilite as civility_id,"; $sql.= " s.nom as companyname"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; @@ -105,7 +105,7 @@ class mailing_contacts2 extends MailingTargets 'firstname' => $obj->firstname, 'other' => ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civilite?$langs->transnoentities("Civility".$obj->civilite):'')), + ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')), 'source_url' => $this->url($obj->id), 'source_id' => $obj->id, 'source_type' => 'contact' diff --git a/htdocs/core/modules/mailings/contacts3.modules.php b/htdocs/core/modules/mailings/contacts3.modules.php index bbc763af06d..4c6480b8812 100644 --- a/htdocs/core/modules/mailings/contacts3.modules.php +++ b/htdocs/core/modules/mailings/contacts3.modules.php @@ -77,7 +77,7 @@ class mailing_contacts3 extends MailingTargets // La requete doit retourner: id, email, fk_contact, name, firstname, other $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,"; - $sql.= " sp.lastname, sp.firstname, sp.civilite,"; + $sql.= " sp.lastname, sp.firstname, sp.civilite as civility_id,"; $sql.= " s.nom as companyname"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; @@ -109,7 +109,7 @@ class mailing_contacts3 extends MailingTargets 'firstname' => $obj->firstname, 'other' => ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civilite?$langs->transnoentities("Civility".$obj->civilite):'')), + ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')), 'source_url' => $this->url($obj->id), 'source_id' => $obj->id, 'source_type' => 'contact' diff --git a/htdocs/core/modules/mailings/contacts4.modules.php b/htdocs/core/modules/mailings/contacts4.modules.php index 780393cc908..cbd05d1b15d 100644 --- a/htdocs/core/modules/mailings/contacts4.modules.php +++ b/htdocs/core/modules/mailings/contacts4.modules.php @@ -78,7 +78,7 @@ class mailing_contacts4 extends MailingTargets // La requete doit retourner: id, email, fk_contact, name, firstname, other $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,"; - $sql.= " sp.lastname, sp.firstname, sp.civilite,"; + $sql.= " sp.lastname, sp.firstname, sp.civility_id,"; $sql.= " s.nom as companyname"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; if ($filtersarray[0] <> 'all')$sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie_contact as cs ON cs.fk_socpeople=sp.rowid"; @@ -107,7 +107,7 @@ class mailing_contacts4 extends MailingTargets 'firstname' => $obj->firstname, 'other' => ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civilite?$langs->transnoentities("Civility".$obj->civilite):'')), + ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')), 'source_url' => $this->url($obj->id), 'source_id' => $obj->id, 'source_type' => 'contact' @@ -215,7 +215,7 @@ class mailing_contacts4 extends MailingTargets $sql.= " ORDER BY c.label"; $resql = $this->db->query($sql); - + dol_syslog(get_class($this).':: formFilter sql='.$sql,LOG_DEBUG); if ($resql) { $s=''; @@ -240,7 +240,7 @@ class mailing_contacts4 extends MailingTargets dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR); return -1; } - + } } diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 9c482410686..6df8204695a 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -167,7 +167,7 @@ class mailing_fraise extends MailingTargets // La requete doit retourner: id, email, fk_contact, name, firstname $sql = "SELECT a.rowid as id, a.email as email, null as fk_contact, "; $sql.= " a.lastname, a.firstname,"; - $sql.= " a.datefin, a.civilite, a.login, a.societe"; // Other fields + $sql.= " a.datefin, a.civilite as civility_id, a.login, a.societe"; // Other fields $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a"; $sql.= " WHERE a.email <> ''"; // Note that null != '' is false $sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; @@ -204,7 +204,7 @@ class mailing_fraise extends MailingTargets 'firstname' => $obj->firstname, 'other' => ($langs->transnoentities("Login").'='.$obj->login).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civilite?$langs->transnoentities("Civility".$obj->civilite):'')).';'. + ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')).';'. ($langs->transnoentities("DateEnd").'='.dol_print_date($this->db->jdate($obj->datefin),'day')).';'. ($langs->transnoentities("Company").'='.$obj->societe), 'source_url' => $this->url($obj->id), diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 47da1d870b7..e038cfd3ceb 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -148,7 +148,7 @@ class mailing_pomme extends MailingTargets // La requete doit retourner: id, email, fk_contact, name, firstname $sql = "SELECT u.rowid as id, u.email as email, null as fk_contact,"; - $sql.= " u.lastname as name, u.firstname as firstname, u.login, u.office_phone"; + $sql.= " u.lastname as name, u.firstname as firstname, u.civilite as civility_id, u.login, u.office_phone"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicite dans ce test $sql.= " AND u.entity IN (0,".$conf->entity.")"; @@ -183,7 +183,7 @@ class mailing_pomme extends MailingTargets 'firstname' => $obj->firstname, 'other' => ($langs->transnoentities("Login").'='.$obj->login).';'. -// ($langs->transnoentities("UserTitle").'='.$obj->civilite).';'. + ($langs->transnoentities("UserTitle").'='.$obj->civility_id).';'. ($langs->transnoentities("PhonePro").'='.$obj->office_phone), 'source_url' => $this->url($obj->id), 'source_id' => $obj->id, diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 9fd4f660285..24a9ee5ef94 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -181,7 +181,7 @@ class modCategorie extends DolibarrModules 'u.label' => "Label", 'u.description' => "Description", 'p.rowid' => 'ContactId', - 'p.civilite' => 'Civitity', + 'p.civilite' => 'Civility', 'p.lastname' => 'LastName', 'p.firstname' => 'Firstname', 'p.address' => 'Address', diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index e335fd0e6a6..f9c5b8a95a5 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -38,7 +38,7 @@ define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOCSRFCHECK",1); // We accept to go on this page from external web site. -// For MultiCompany module. +// For MultiCompany module. // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php // TODO This should be useless. Because entity must be retreive from object ref and not from url. $entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); @@ -226,7 +226,7 @@ if ($action == 'add') $adh->public = $_POST["public"]; $adh->firstname = $_POST["firstname"]; $adh->lastname = $_POST["lastname"]; - $adh->civilite_id = $_POST["civilite_id"]; + $adh->civility_id = $_POST["civility_id"]; $adh->societe = $_POST["societe"]; $adh->address = $_POST["address"]; $adh->zip = $_POST["zipcode"]; @@ -445,7 +445,7 @@ else } // Civility print ''.$langs->trans('UserTitle').''; -print $formcompany->select_civility(GETPOST('civilite_id'),'civilite_id').''."\n"; +print $formcompany->select_civility(GETPOST('civility_id'),'civility_id').''."\n"; // Lastname print ''.$langs->trans("Lastname").' *'."\n"; // Firstname diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 9c3607cc412..1ee163038bb 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -120,7 +120,7 @@ abstract class ActionsCardCommon $this->object->particulier = GETPOST("private"); $this->object->name = empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?trim($_POST["firstname"].' '.$_POST["lastname"]):trim($_POST["lastname"].' '.$_POST["firstname"]); - $this->object->civilite_id = $_POST["civilite_id"]; + $this->object->civility_id = $_POST["civility_id"]; // Add non official properties $this->object->name_bis = $_POST["lastname"]; $this->object->firstname = $_POST["firstname"]; @@ -216,7 +216,7 @@ abstract class ActionsCardCommon dol_syslog(get_class($this)."::doActions This thirdparty is a personal people",LOG_DEBUG); $contact=new Contact($this->db); - $contact->civilite_id = $this->object->civilite_id; + $contact->civility_id = $this->object->civility_id; $contact->name = $this->object->name_bis; $contact->firstname = $this->object->firstname; $contact->address = $this->object->address; diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php index 85449440f7b..d64adde4cb6 100644 --- a/htdocs/societe/canvas/individual/actions_card_individual.class.php +++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php @@ -109,7 +109,7 @@ class ActionsCardIndividual extends ActionsCardCommon if ($action == 'create' || $action == 'edit') { - $this->tpl['select_civility'] = $formcompany->select_civility(GETPOST('civilite_id')); + $this->tpl['select_civility'] = $formcompany->select_civility(GETPOST('civility_id')); } else { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ecfb0c7cb3f..e257531766d 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -464,7 +464,7 @@ class Societe extends CommonObject $contact->name = $this->name_bis; $contact->firstname = $this->firstname; - $contact->civilite_id = $this->civility_id; + $contact->civility_id = $this->civility_id; $contact->socid = $this->id; // fk_soc $contact->statut = 1; $contact->priv = 0; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index b80d6445f0a..f2d2e64791d 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -119,7 +119,7 @@ if (empty($reshook)) $object->particulier = GETPOST("private"); $object->name = dolGetFirstLastname(GETPOST('firstname'),GETPOST('nom')?GETPOST('nom'):GETPOST('name')); - $object->civility_id = GETPOST('civilite_id'); + $object->civility_id = GETPOST('civility_id'); // Add non official properties $object->name_bis = GETPOST('name')?GETPOST('name'):GETPOST('nom'); $object->firstname = GETPOST('firstname'); @@ -651,7 +651,7 @@ else $object->idprof6 = GETPOST('idprof6'); $object->typent_id = GETPOST('typent_id'); $object->effectif_id = GETPOST('effectif_id'); - $object->civility_id = GETPOST('civilite_id'); + $object->civility_id = GETPOST('civility_id'); $object->tva_assuj = GETPOST('assujtva_value'); $object->status = GETPOST('status'); diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index 212fc44e60f..570777b0972 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -302,24 +302,24 @@ function getContact($authentication,$id,$ref='',$ref_ext='') 'ref_propal' => $contact->ref_propal, 'user_id' => $contact->user_id, 'user_login' => $contact->user_login, - 'civilite_id' => $contact->civility_id, + 'civility_id' => $contact->civility_id, 'poste' => $contact->poste, 'statut' => $contact->statut ); - + //Retreive all extrafield for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); $extralabels=$extrafields->fetch_name_optionals_label('socpeople',true); //Get extrafield values $contact->fetch_optionals($contact->id,$extralabels); - + foreach($extrafields->attribute_label as $key=>$label) { $contact_result_fields=array_merge($contact_result_fields,array('options_'.$key => $contact->array_options['options_'.$key])); } - - + + // Create $objectresp = array( 'result'=>array('result_code'=>'OK', 'result_label'=>''), @@ -378,12 +378,12 @@ function createContact($authentication,$contact) if (! $error) { - + $newobject=new Contact($db); - + $newobject->id=$contact['id']; - $newobject->civilite_id=$contact['civility_id']; + $newobject->civility_id=$contact['civility_id']; $newobject->lastname=$contact['lastname']; $newobject->firstname=$contact['firstname']; $newobject->address=$contact['address']; @@ -415,7 +415,7 @@ function createContact($authentication,$contact) $newobject->user_login=$contact['user_login']; $newobject->poste=$contact['poste']; $newobject->statut=$contact['statut']; - + //Retreive all extrafield for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); @@ -425,9 +425,9 @@ function createContact($authentication,$contact) $key='options_'.$key; $newobject->array_options[$key]=$contact[$key]; } - - + + //... $db->begin(); @@ -508,7 +508,7 @@ function getContactsForThirdParty($authentication,$idthirdparty) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid"; $sql.= " WHERE c.fk_soc=$idthirdparty"; - + $resql=$db->query($sql); if ($resql) @@ -528,37 +528,37 @@ function getContactsForThirdParty($authentication,$idthirdparty) $linescontact[]=array( 'id' => $contact->id, 'ref' => $contact->ref, - 'civility_id' => $contact->civilite_id?$contact->civilite_id:'', + 'civility_id' => $contact->civility_id?$contact->civility_id:'', 'lastname' => $contact->lastname?$contact->lastname:'', 'firstname' => $contact->firstname?$contact->firstname:'', 'address' => $contact->address?$contact->address:'', 'zip' => $contact->zip?$contact->zip:'', 'town' => $contact->town?$contact->town:'', - + 'state_id' => $contact->state_id?$contact->state_id:'', 'state_code' => $contact->state_code?$contact->state_code:'', 'state' => $contact->state?$contact->state:'', - + 'country_id' => $contact->country_id?$contact->country_id:'', 'country_code' => $contact->country_code?$contact->country_code:'', 'country' => $contact->country?$contact->country:'', - + 'socid' => $contact->socid?$contact->socid:'', 'socname' => $contact->socname?$contact->socname:'', 'poste' => $contact->poste?$contact->poste:'', - - - + + + 'phone_pro' => $contact->phone_pro?$contact->phone_pro:'', 'fax' => $contact->fax?$contact->fax:'', 'phone_perso' => $contact->phone_perso?$contact->phone_perso:'', 'phone_mobile' => $contact->phone_mobile?$contact->phone_mobile:'', - + 'email' => $contact->email?$contact->email:'', 'jabberid' => $contact->jabberid?$contact->jabberid:'', 'priv' => $contact->priv?$contact->priv:'', 'mail' => $contact->mail?$contact->mail:'', - + 'birthday' => $contact->birthday?$contact->birthday:'', 'default_lang' => $contact->default_lang?$contact->default_lang:'', 'note' => $contact->note?$contact->note:'', @@ -570,11 +570,11 @@ function getContactsForThirdParty($authentication,$idthirdparty) 'user_id' => $contact->user_id?$contact->user_id:'', 'user_login' => $contact->user_login?$contact->user_login:'', 'statut' => $contact->statut?$contact->statut:'' - - - - - + + + + + ); $i++; @@ -641,11 +641,11 @@ function updateContact($authentication,$contact) if (!empty($object->id)) { $objectfound=true; - - + + $object->firstname=$contact['firstname']; $object->lastname=$contact['lastname']; - + $object->address=$contact['address']; $object->zip=$contact['zip']; $object->town=$contact['town']; @@ -653,18 +653,18 @@ function updateContact($authentication,$contact) $object->country_id=$contact['country_id']; if ($contact['country_code']) $object->country_id=getCountry($contact['country_code'],3); $object->province_id=$contact['province_id']; - + $object->phone_perso=$contact['phone_perso']; $object->phone_mobile=$contact['phone_mobile']; $object->fax=$contact['fax']; $object->email=$contact['email']; - - $object->civilite_id=$contact['civility_id']; + + $object->civility_id=$contact['civility_id']; $object->poste=$contact['poste']; - + $object->statut=$contact['statut']; - + //Retreive all extrafield for contact // fetch optionals attributes and labels diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index 0a8071bf524..eff032fab67 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -583,7 +583,7 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser) $contact->socid = $thirdparty->id; $contact->lastname = $thirdpartywithuser['name']; $contact->firstname = $thirdpartywithuser['firstname']; - $contact->civilite_id = $thirdparty->civilite_id; + $contact->civility_id = $thirdparty->civility_id; $contact->address = $thirdparty->address; $contact->zip = $thirdparty->zip; $contact->town = $thirdparty->town; diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index 459050a7ba6..f9db37ab79e 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -238,7 +238,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase $timestamp = dol_now(); - $localobject->civilite_id = 0; + $localobject->civility_id = 0; $localobject->login='newlogin'; $localobject->societe='New company'; $localobject->note='New note after update'; @@ -271,7 +271,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0); - $this->assertEquals($localobject->civilite_id, $newobject->civilite_id); + $this->assertEquals($localobject->civility_id, $newobject->civility_id); $this->assertEquals($localobject->login, $newobject->login); $this->assertEquals($localobject->societe, $newobject->societe); $this->assertEquals($localobject->note, $newobject->note); @@ -313,7 +313,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase $langs=$this->savlangs; $db=$this->savdb; - $template = '%DOL_MAIN_URL_ROOT%,%ID%,%CIVILITE%,%FIRSTNAME%,%LASTNAME%,%FULLNAME%,%COMPANY%,'. + $template = '%DOL_MAIN_URL_ROOT%,%ID%,%CIVILITY%,%FIRSTNAME%,%LASTNAME%,%FULLNAME%,%COMPANY%,'. '%ADDRESS%,%ZIP%,%TOWN%,%COUNTRY%,%EMAIL%,%BIRTH%,%PHOTO%,%LOGIN%,%PASSWORD%,%PRENOM%,'. '%NOM%,%SOCIETE%,%ADDRESS%,%ZIP%,%TOWN%,%COUNTRY%';