Properties "civilite_id" were renamed into "civility_id".

This commit is contained in:
Laurent Destailleur 2014-05-05 00:23:09 +02:00
parent bcdf3e8a51
commit 63100c9c06
25 changed files with 99 additions and 99 deletions

View File

@ -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" - 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 So check that return value is 0 to keep default standard behaviour after hook or 1 to disable
default standard behaviour. default standard behaviour.
- Properties "civilite_id" were renamed into "civility_id".
***** ChangeLog for 3.5.3 compared to 3.5.2 ***** ***** ChangeLog for 3.5.3 compared to 3.5.2 *****

View File

@ -273,7 +273,7 @@ abstract class ActionsAdherentCardCommon
} }
// Civility // 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 // Predefined with third party
if ((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE')) 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->fk_soc = $_POST["fk_soc"];
$this->object->lastname = $_POST["lastname"]; $this->object->lastname = $_POST["lastname"];
$this->object->firstname = $_POST["firstname"]; $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->address = $_POST["address"];
$this->object->zip = $_POST["zipcode"]; $this->object->zip = $_POST["zipcode"];
$this->object->town = $_POST["town"]; $this->object->town = $_POST["town"];

View File

@ -45,7 +45,7 @@ class Adherent extends CommonObject
var $id; var $id;
var $ref; var $ref;
var $civilite_id; var $civility_id;
var $firstname; var $firstname;
var $lastname; var $lastname;
var $login; var $login;
@ -184,7 +184,7 @@ class Adherent extends CommonObject
if (dol_textishtml($text,1)) $msgishtml = 1; if (dol_textishtml($text,1)) $msgishtml = 1;
$infos=''; $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("id").": ".$this->id."\n";
$infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n"; $infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n";
$infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n"; $infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n";
@ -207,7 +207,7 @@ class Adherent extends CommonObject
$substitutionarray=array( $substitutionarray=array(
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
'%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id, '%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, '%FIRSTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
'%LASTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, '%LASTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
'%FULLNAME%'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs), '%FULLNAME%'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
@ -425,7 +425,7 @@ class Adherent extends CommonObject
$this->db->begin(); $this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; $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.= ", firstname = ".($this->firstname?"'".$this->db->escape($this->firstname)."'":"null");
$sql.= ", lastname=" .($this->lastname?"'".$this->db->escape($this->lastname)."'":"null"); $sql.= ", lastname=" .($this->lastname?"'".$this->db->escape($this->lastname)."'":"null");
$sql.= ", login=" .($this->login?"'".$this->db->escape($this->login)."'":"null"); $sql.= ", login=" .($this->login?"'".$this->db->escape($this->login)."'":"null");
@ -526,7 +526,7 @@ class Adherent extends CommonObject
if ($result >= 0) if ($result >= 0)
{ {
$luser->civilite_id=$this->civilite_id; $luser->civility_id=$this->civility_id;
$luser->firstname=$this->firstname; $luser->firstname=$this->firstname;
$luser->lastname=$this->lastname; $luser->lastname=$this->lastname;
$luser->login=$this->user_login; $luser->login=$this->user_login;
@ -1056,7 +1056,7 @@ class Adherent extends CommonObject
{ {
global $langs; 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.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.photo, d.fk_adherent_type, d.morphy, d.entity,";
$sql.= " d.datec as datec,"; $sql.= " d.datec as datec,";
@ -1098,7 +1098,7 @@ class Adherent extends CommonObject
$this->ref = $obj->rowid; $this->ref = $obj->rowid;
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref_ext = $obj->ref_ext; $this->ref_ext = $obj->ref_ext;
$this->civilite_id = $obj->civilite; $this->civility_id = $obj->civility;
$this->firstname = $obj->firstname; $this->firstname = $obj->firstname;
$this->lastname = $obj->lastname; $this->lastname = $obj->lastname;
$this->login = $obj->login; $this->login = $obj->login;
@ -1552,7 +1552,7 @@ class Adherent extends CommonObject
global $langs; global $langs;
$langs->load("dict"); $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 ''; if (empty($code)) return '';
return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code);
} }
@ -1779,7 +1779,7 @@ class Adherent extends CommonObject
// Initialise parametres // Initialise parametres
$this->id=0; $this->id=0;
$this->specimen=1; $this->specimen=1;
$this->civilite_id = 0; $this->civility_id = 0;
$this->lastname = 'DOLIBARR'; $this->lastname = 'DOLIBARR';
$this->firstname = 'SPECIMEN'; $this->firstname = 'SPECIMEN';
$this->login='dolibspec'; $this->login='dolibspec';

View File

@ -266,7 +266,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
$object->oldcopy=dol_clone($object); $object->oldcopy=dol_clone($object);
// Change values // Change values
$object->civilite_id = trim($_POST["civilite_id"]); $object->civility_id = trim($_POST["civility_id"]);
$object->firstname = trim($_POST["firstname"]); $object->firstname = trim($_POST["firstname"]);
$object->lastname = trim($_POST["lastname"]); $object->lastname = trim($_POST["lastname"]);
$object->login = trim($_POST["login"]); $object->login = trim($_POST["login"]);
@ -415,7 +415,7 @@ if ($action == 'add' && $user->rights->adherent->creer)
} }
$typeid=$_POST["typeid"]; $typeid=$_POST["typeid"];
$civilite_id=$_POST["civilite_id"]; $civility_id=$_POST["civility_id"];
$lastname=$_POST["lastname"]; $lastname=$_POST["lastname"];
$firstname=$_POST["firstname"]; $firstname=$_POST["firstname"];
$societe=$_POST["societe"]; $societe=$_POST["societe"];
@ -441,7 +441,7 @@ if ($action == 'add' && $user->rights->adherent->creer)
$userid=$_POST["userid"]; $userid=$_POST["userid"];
$socid=$_POST["socid"]; $socid=$_POST["socid"];
$object->civilite_id = $civilite_id; $object->civility_id = $civility_id;
$object->firstname = $firstname; $object->firstname = $firstname;
$object->lastname = $lastname; $object->lastname = $lastname;
$object->societe = $societe; $object->societe = $societe;
@ -794,7 +794,7 @@ else
// Civility // Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>'; print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
print $formcompany->select_civility(GETPOST('civilite_id','int')?GETPOST('civilite_id','int'):$object->civilite_id,'civilite_id').'</td>'; print $formcompany->select_civility(GETPOST('civility_id','int')?GETPOST('civility_id','int'):$object->civility_id,'civility_id').'</td>';
print '</tr>'; print '</tr>';
// Lastname // Lastname
@ -1044,9 +1044,9 @@ else
// Company // Company
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.(isset($_POST["societe"])?$_POST["societe"]:$object->societe).'"></td></tr>'; print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.(isset($_POST["societe"])?$_POST["societe"]:$object->societe).'"></td></tr>';
// Civilite // Civility
print '<tr><td width="20%">'.$langs->trans("UserTitle").'</td><td width="35%">'; print '<tr><td width="20%">'.$langs->trans("UserTitle").'</td><td width="35%">';
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 '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -273,7 +273,7 @@ abstract class ActionsContactCardCommon
} }
// Civility // 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 // Predefined with third party
if ((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE') || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) 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->socid = $_POST["socid"];
$this->object->lastname = $_POST["name"]; $this->object->lastname = $_POST["name"];
$this->object->firstname = $_POST["firstname"]; $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->poste = $_POST["poste"];
$this->object->address = $_POST["address"]; $this->object->address = $_POST["address"];
$this->object->zip = $_POST["zipcode"]; $this->object->zip = $_POST["zipcode"];

View File

@ -42,7 +42,7 @@ class Contact extends CommonObject
var $id; var $id;
var $ref_ext; var $ref_ext;
var $civilite_id; // In fact we store civility_code var $civility_id; // In fact we store civility_code
var $lastname; var $lastname;
var $firstname; var $firstname;
var $address; var $address;
@ -251,7 +251,7 @@ class Contact extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET "; $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET ";
if ($this->socid > 0) $sql .= " fk_soc='".$this->db->escape($this->socid)."',"; if ($this->socid > 0) $sql .= " fk_soc='".$this->db->escape($this->socid)."',";
else if ($this->socid == -1) $sql .= " fk_soc=null,"; 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 .= ", lastname='".$this->db->escape($this->lastname)."'";
$sql .= ", firstname='".$this->db->escape($this->firstname)."'"; $sql .= ", firstname='".$this->db->escape($this->firstname)."'";
$sql .= ", address='".$this->db->escape($this->address)."'"; $sql .= ", address='".$this->db->escape($this->address)."'";
@ -504,7 +504,7 @@ class Contact extends CommonObject
$langs->load("companies"); $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.address, c.statut, c.zip, c.town,";
$sql.= " c.fk_pays as country_id,"; $sql.= " c.fk_pays as country_id,";
$sql.= " c.fk_departement,"; $sql.= " c.fk_departement,";
@ -534,7 +534,7 @@ class Contact extends CommonObject
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->rowid; $this->ref = $obj->rowid;
$this->ref_ext = $obj->ref_ext; $this->ref_ext = $obj->ref_ext;
$this->civilite_id = $obj->civilite_id; $this->civility_id = $obj->civility_id;
$this->lastname = $obj->lastname; $this->lastname = $obj->lastname;
$this->firstname = $obj->firstname; $this->firstname = $obj->firstname;
$this->address = $obj->address; $this->address = $obj->address;
@ -887,7 +887,7 @@ class Contact extends CommonObject
/** /**
* Return name of contact with link (and eventually picto) * 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 int $withpicto Include picto with link
* @param string $option Where the link point to * @param string $option Where the link point to
@ -924,7 +924,7 @@ class Contact extends CommonObject
global $langs; global $langs;
$langs->load("dict"); $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 ''; if (empty($code)) return '';
return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code);
} }

View File

@ -162,7 +162,7 @@ if (empty($reshook))
$object->socid = $_POST["socid"]; $object->socid = $_POST["socid"];
$object->lastname = $_POST["lastname"]; $object->lastname = $_POST["lastname"];
$object->firstname = $_POST["firstname"]; $object->firstname = $_POST["firstname"];
$object->civilite_id = $_POST["civilite_id"]; $object->civility_id = $_POST["civility_id"];
$object->poste = $_POST["poste"]; $object->poste = $_POST["poste"];
$object->address = $_POST["address"]; $object->address = $_POST["address"];
$object->zip = $_POST["zipcode"]; $object->zip = $_POST["zipcode"];
@ -260,7 +260,7 @@ if (empty($reshook))
$object->socid = $_POST["socid"]; $object->socid = $_POST["socid"];
$object->lastname = $_POST["lastname"]; $object->lastname = $_POST["lastname"];
$object->firstname = $_POST["firstname"]; $object->firstname = $_POST["firstname"];
$object->civilite_id = $_POST["civilite_id"]; $object->civility_id = $_POST["civility_id"];
$object->poste = $_POST["poste"]; $object->poste = $_POST["poste"];
$object->address = $_POST["address"]; $object->address = $_POST["address"];
@ -447,7 +447,7 @@ else
// Civility // Civility
print '<tr><td width="15%">'.$langs->trans("UserTitle").'</td><td colspan="3">'; print '<tr><td width="15%">'.$langs->trans("UserTitle").'</td><td colspan="3">';
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 '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td>'; print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td>';
@ -663,7 +663,7 @@ else
// Civility // Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
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 '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td></tr>'; print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td></tr>';

View File

@ -61,7 +61,7 @@ class box_contacts extends ModeleBoxes
if ($user->rights->societe->lire) 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.= " s.nom as socname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid"; $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->lastname=$objp->lastname;
$contactstatic->firstname=$objp->firstname; $contactstatic->firstname=$objp->firstname;
$contactstatic->civilite_id=$objp->civilite; $contactstatic->civility_id=$objp->civility_id;
$societestatic->id=$objp->fk_soc; $societestatic->id=$objp->fk_soc;
$societestatic->name=$objp->socname; $societestatic->name=$objp->socname;

View File

@ -359,14 +359,14 @@ class FormCompany
* @param string $htmlname Name of HTML select combo field * @param string $htmlname Name of HTML select combo field
* @return string String with HTML select * @return string String with HTML select
*/ */
function select_civility($selected='',$htmlname='civilite_id') function select_civility($selected='',$htmlname='civility_id')
{ {
global $conf,$langs,$user; global $conf,$langs,$user;
$langs->load("dict"); $langs->load("dict");
$out=''; $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"; $sql.= " WHERE active = 1";
dol_syslog("Form::select_civility sql=".$sql); dol_syslog("Form::select_civility sql=".$sql);
@ -391,7 +391,7 @@ class FormCompany
$out.= '<option value="'.$obj->code.'">'; $out.= '<option value="'.$obj->code.'">';
} }
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
$out.= ($langs->trans("Civility".$obj->code)!="Civility".$obj->code ? $langs->trans("Civility".$obj->code) : ($obj->civilite!='-'?$obj->civilite:'')); $out.= ($langs->trans("Civility".$obj->code)!="Civility".$obj->code ? $langs->trans("Civility".$obj->code) : ($obj->civility_label!='-'?$obj->civility_label:''));
$out.= '</option>'; $out.= '</option>';
$i++; $i++;
} }

View File

@ -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 = "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 .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql .= " WHERE p.fk_soc = ".$object->id; $sql .= " WHERE p.fk_soc = ".$object->id;
if ($search_status!='') $sql .= " AND p.statut = ".$db->escape($search_status); 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->statut = $obj->statut;
$contactstatic->lastname = $obj->lastname; $contactstatic->lastname = $obj->lastname;
$contactstatic->firstname = $obj->firstname; $contactstatic->firstname = $obj->firstname;
$contactstatic->civilite = $obj->civilite; $contactstatic->civility_id = $obj->civility_id;
print $contactstatic->getNomUrl(1); print $contactstatic->getNomUrl(1);
print '</td>'; print '</td>';

View File

@ -197,7 +197,7 @@ class mailing_contacts1 extends MailingTargets
// La requete doit retourner: id, email, fk_contact, name, firstname, other // 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 = "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.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc"; $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, 'firstname' => $obj->firstname,
'other' => 'other' =>
($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. ($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_url' => $this->url($obj->id),
'source_id' => $obj->id, 'source_id' => $obj->id,
'source_type' => 'contact' 'source_type' => 'contact'

View File

@ -79,7 +79,7 @@ class mailing_contacts2 extends MailingTargets
// La requete doit retourner: id, email, fk_contact, name, firstname, other // 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 = "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.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; $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, 'firstname' => $obj->firstname,
'other' => 'other' =>
($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. ($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_url' => $this->url($obj->id),
'source_id' => $obj->id, 'source_id' => $obj->id,
'source_type' => 'contact' 'source_type' => 'contact'

View File

@ -77,7 +77,7 @@ class mailing_contacts3 extends MailingTargets
// La requete doit retourner: id, email, fk_contact, name, firstname, other // 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 = "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.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; $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, 'firstname' => $obj->firstname,
'other' => 'other' =>
($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. ($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_url' => $this->url($obj->id),
'source_id' => $obj->id, 'source_id' => $obj->id,
'source_type' => 'contact' 'source_type' => 'contact'

View File

@ -78,7 +78,7 @@ class mailing_contacts4 extends MailingTargets
// La requete doit retourner: id, email, fk_contact, name, firstname, other // 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 = "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.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $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"; 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, 'firstname' => $obj->firstname,
'other' => 'other' =>
($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. ($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_url' => $this->url($obj->id),
'source_id' => $obj->id, 'source_id' => $obj->id,
'source_type' => 'contact' 'source_type' => 'contact'

View File

@ -167,7 +167,7 @@ class mailing_fraise extends MailingTargets
// La requete doit retourner: id, email, fk_contact, name, firstname // 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 = "SELECT a.rowid as id, a.email as email, null as fk_contact, ";
$sql.= " a.lastname, a.firstname,"; $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.= " FROM ".MAIN_DB_PREFIX."adherent as a";
$sql.= " WHERE a.email <> ''"; // Note that null != '' is false $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.")"; $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, 'firstname' => $obj->firstname,
'other' => 'other' =>
($langs->transnoentities("Login").'='.$obj->login).';'. ($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("DateEnd").'='.dol_print_date($this->db->jdate($obj->datefin),'day')).';'.
($langs->transnoentities("Company").'='.$obj->societe), ($langs->transnoentities("Company").'='.$obj->societe),
'source_url' => $this->url($obj->id), 'source_url' => $this->url($obj->id),

View File

@ -148,7 +148,7 @@ class mailing_pomme extends MailingTargets
// La requete doit retourner: id, email, fk_contact, name, firstname // 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 = "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.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicite dans ce test $sql.= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicite dans ce test
$sql.= " AND u.entity IN (0,".$conf->entity.")"; $sql.= " AND u.entity IN (0,".$conf->entity.")";
@ -183,7 +183,7 @@ class mailing_pomme extends MailingTargets
'firstname' => $obj->firstname, 'firstname' => $obj->firstname,
'other' => 'other' =>
($langs->transnoentities("Login").'='.$obj->login).';'. ($langs->transnoentities("Login").'='.$obj->login).';'.
// ($langs->transnoentities("UserTitle").'='.$obj->civilite).';'. ($langs->transnoentities("UserTitle").'='.$obj->civility_id).';'.
($langs->transnoentities("PhonePro").'='.$obj->office_phone), ($langs->transnoentities("PhonePro").'='.$obj->office_phone),
'source_url' => $this->url($obj->id), 'source_url' => $this->url($obj->id),
'source_id' => $obj->id, 'source_id' => $obj->id,

View File

@ -181,7 +181,7 @@ class modCategorie extends DolibarrModules
'u.label' => "Label", 'u.label' => "Label",
'u.description' => "Description", 'u.description' => "Description",
'p.rowid' => 'ContactId', 'p.rowid' => 'ContactId',
'p.civilite' => 'Civitity', 'p.civilite' => 'Civility',
'p.lastname' => 'LastName', 'p.lastname' => 'LastName',
'p.firstname' => 'Firstname', 'p.firstname' => 'Firstname',
'p.address' => 'Address', 'p.address' => 'Address',

View File

@ -226,7 +226,7 @@ if ($action == 'add')
$adh->public = $_POST["public"]; $adh->public = $_POST["public"];
$adh->firstname = $_POST["firstname"]; $adh->firstname = $_POST["firstname"];
$adh->lastname = $_POST["lastname"]; $adh->lastname = $_POST["lastname"];
$adh->civilite_id = $_POST["civilite_id"]; $adh->civility_id = $_POST["civility_id"];
$adh->societe = $_POST["societe"]; $adh->societe = $_POST["societe"];
$adh->address = $_POST["address"]; $adh->address = $_POST["address"];
$adh->zip = $_POST["zipcode"]; $adh->zip = $_POST["zipcode"];
@ -445,7 +445,7 @@ else
} }
// Civility // Civility
print '<tr><td>'.$langs->trans('UserTitle').'</td><td>'; print '<tr><td>'.$langs->trans('UserTitle').'</td><td>';
print $formcompany->select_civility(GETPOST('civilite_id'),'civilite_id').'</td></tr>'."\n"; print $formcompany->select_civility(GETPOST('civility_id'),'civility_id').'</td></tr>'."\n";
// Lastname // Lastname
print '<tr><td>'.$langs->trans("Lastname").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="lastname" size="40" value="'.dol_escape_htmltag(GETPOST('lastname')).'"></td></tr>'."\n"; print '<tr><td>'.$langs->trans("Lastname").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="lastname" size="40" value="'.dol_escape_htmltag(GETPOST('lastname')).'"></td></tr>'."\n";
// Firstname // Firstname

View File

@ -120,7 +120,7 @@ abstract class ActionsCardCommon
$this->object->particulier = GETPOST("private"); $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->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 // Add non official properties
$this->object->name_bis = $_POST["lastname"]; $this->object->name_bis = $_POST["lastname"];
$this->object->firstname = $_POST["firstname"]; $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); dol_syslog(get_class($this)."::doActions This thirdparty is a personal people",LOG_DEBUG);
$contact=new Contact($this->db); $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->name = $this->object->name_bis;
$contact->firstname = $this->object->firstname; $contact->firstname = $this->object->firstname;
$contact->address = $this->object->address; $contact->address = $this->object->address;

View File

@ -109,7 +109,7 @@ class ActionsCardIndividual extends ActionsCardCommon
if ($action == 'create' || $action == 'edit') 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 else
{ {

View File

@ -464,7 +464,7 @@ class Societe extends CommonObject
$contact->name = $this->name_bis; $contact->name = $this->name_bis;
$contact->firstname = $this->firstname; $contact->firstname = $this->firstname;
$contact->civilite_id = $this->civility_id; $contact->civility_id = $this->civility_id;
$contact->socid = $this->id; // fk_soc $contact->socid = $this->id; // fk_soc
$contact->statut = 1; $contact->statut = 1;
$contact->priv = 0; $contact->priv = 0;

View File

@ -119,7 +119,7 @@ if (empty($reshook))
$object->particulier = GETPOST("private"); $object->particulier = GETPOST("private");
$object->name = dolGetFirstLastname(GETPOST('firstname'),GETPOST('nom')?GETPOST('nom'):GETPOST('name')); $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 // Add non official properties
$object->name_bis = GETPOST('name')?GETPOST('name'):GETPOST('nom'); $object->name_bis = GETPOST('name')?GETPOST('name'):GETPOST('nom');
$object->firstname = GETPOST('firstname'); $object->firstname = GETPOST('firstname');
@ -651,7 +651,7 @@ else
$object->idprof6 = GETPOST('idprof6'); $object->idprof6 = GETPOST('idprof6');
$object->typent_id = GETPOST('typent_id'); $object->typent_id = GETPOST('typent_id');
$object->effectif_id = GETPOST('effectif_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->tva_assuj = GETPOST('assujtva_value');
$object->status = GETPOST('status'); $object->status = GETPOST('status');

View File

@ -302,7 +302,7 @@ function getContact($authentication,$id,$ref='',$ref_ext='')
'ref_propal' => $contact->ref_propal, 'ref_propal' => $contact->ref_propal,
'user_id' => $contact->user_id, 'user_id' => $contact->user_id,
'user_login' => $contact->user_login, 'user_login' => $contact->user_login,
'civilite_id' => $contact->civility_id, 'civility_id' => $contact->civility_id,
'poste' => $contact->poste, 'poste' => $contact->poste,
'statut' => $contact->statut 'statut' => $contact->statut
); );
@ -383,7 +383,7 @@ function createContact($authentication,$contact)
$newobject=new Contact($db); $newobject=new Contact($db);
$newobject->id=$contact['id']; $newobject->id=$contact['id'];
$newobject->civilite_id=$contact['civility_id']; $newobject->civility_id=$contact['civility_id'];
$newobject->lastname=$contact['lastname']; $newobject->lastname=$contact['lastname'];
$newobject->firstname=$contact['firstname']; $newobject->firstname=$contact['firstname'];
$newobject->address=$contact['address']; $newobject->address=$contact['address'];
@ -528,7 +528,7 @@ function getContactsForThirdParty($authentication,$idthirdparty)
$linescontact[]=array( $linescontact[]=array(
'id' => $contact->id, 'id' => $contact->id,
'ref' => $contact->ref, 'ref' => $contact->ref,
'civility_id' => $contact->civilite_id?$contact->civilite_id:'', 'civility_id' => $contact->civility_id?$contact->civility_id:'',
'lastname' => $contact->lastname?$contact->lastname:'', 'lastname' => $contact->lastname?$contact->lastname:'',
'firstname' => $contact->firstname?$contact->firstname:'', 'firstname' => $contact->firstname?$contact->firstname:'',
'address' => $contact->address?$contact->address:'', 'address' => $contact->address?$contact->address:'',
@ -660,7 +660,7 @@ function updateContact($authentication,$contact)
$object->fax=$contact['fax']; $object->fax=$contact['fax'];
$object->email=$contact['email']; $object->email=$contact['email'];
$object->civilite_id=$contact['civility_id']; $object->civility_id=$contact['civility_id'];
$object->poste=$contact['poste']; $object->poste=$contact['poste'];
$object->statut=$contact['statut']; $object->statut=$contact['statut'];

View File

@ -583,7 +583,7 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser)
$contact->socid = $thirdparty->id; $contact->socid = $thirdparty->id;
$contact->lastname = $thirdpartywithuser['name']; $contact->lastname = $thirdpartywithuser['name'];
$contact->firstname = $thirdpartywithuser['firstname']; $contact->firstname = $thirdpartywithuser['firstname'];
$contact->civilite_id = $thirdparty->civilite_id; $contact->civility_id = $thirdparty->civility_id;
$contact->address = $thirdparty->address; $contact->address = $thirdparty->address;
$contact->zip = $thirdparty->zip; $contact->zip = $thirdparty->zip;
$contact->town = $thirdparty->town; $contact->town = $thirdparty->town;

View File

@ -238,7 +238,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase
$timestamp = dol_now(); $timestamp = dol_now();
$localobject->civilite_id = 0; $localobject->civility_id = 0;
$localobject->login='newlogin'; $localobject->login='newlogin';
$localobject->societe='New company'; $localobject->societe='New company';
$localobject->note='New note after update'; $localobject->note='New note after update';
@ -271,7 +271,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase
print __METHOD__." id=".$localobject->id." result=".$result."\n"; print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0); $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->login, $newobject->login);
$this->assertEquals($localobject->societe, $newobject->societe); $this->assertEquals($localobject->societe, $newobject->societe);
$this->assertEquals($localobject->note, $newobject->note); $this->assertEquals($localobject->note, $newobject->note);
@ -313,7 +313,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase
$langs=$this->savlangs; $langs=$this->savlangs;
$db=$this->savdb; $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%,'. '%ADDRESS%,%ZIP%,%TOWN%,%COUNTRY%,%EMAIL%,%BIRTH%,%PHOTO%,%LOGIN%,%PASSWORD%,%PRENOM%,'.
'%NOM%,%SOCIETE%,%ADDRESS%,%ZIP%,%TOWN%,%COUNTRY%'; '%NOM%,%SOCIETE%,%ADDRESS%,%ZIP%,%TOWN%,%COUNTRY%';