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"
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 *****

View File

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

View File

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

View File

@ -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 '<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>';
// Lastname
@ -1044,9 +1044,9 @@ else
// 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>';
// Civilite
// Civility
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 '</tr>';

View File

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

View File

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

View File

@ -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 '<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 '<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
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 '<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)
{
$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;

View File

@ -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.= '<option value="'.$obj->code.'">';
}
// 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>';
$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 .= ", 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 '</td>';

View File

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

View File

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

View File

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

View File

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

View File

@ -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),

View File

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

View File

@ -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',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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