ADD cilivity label in fetch contact / API

This commit is contained in:
ptibogxiv 2019-03-29 12:11:50 +01:00 committed by GitHub
parent 822552defb
commit 013b8a61ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,6 +81,7 @@ class Contact extends CommonObject
public $civility_id; // In fact we store civility_code public $civility_id; // In fact we store civility_code
public $civility_code; public $civility_code;
public $civility_label;
public $address; public $address;
public $zip; public $zip;
public $town; public $town;
@ -717,12 +718,14 @@ class Contact extends CommonObject
$sql.= " c.import_key,"; $sql.= " c.import_key,";
$sql.= " c.datec as date_creation, c.tms as date_modification,"; $sql.= " c.datec as date_creation, c.tms as date_modification,";
$sql.= " co.label as country, co.code as country_code,"; $sql.= " co.label as country, co.code as country_code,";
$sql.= " ci.label as civility,";
$sql.= " d.nom as state, d.code_departement as state_code,"; $sql.= " d.nom as state, d.code_departement as state_code,";
$sql.= " u.rowid as user_id, u.login as user_login,"; $sql.= " u.rowid as user_id, u.login as user_login,";
$sql.= " s.nom as socname, s.address as socaddress, s.zip as soccp, s.town as soccity, s.default_lang as socdefault_lang"; $sql.= " s.nom as socname, s.address as socaddress, s.zip as soccp, s.town as soccity, s.default_lang as socdefault_lang";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON c.fk_pays = co.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON c.fk_pays = co.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_civility as ci ON c.civility = ci.code";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople"; $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.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid";
if ($id) $sql.= " WHERE c.rowid = ". $id; if ($id) $sql.= " WHERE c.rowid = ". $id;
@ -749,7 +752,8 @@ class Contact extends CommonObject
$this->ref = $obj->rowid; $this->ref = $obj->rowid;
$this->ref_ext = $obj->ref_ext; $this->ref_ext = $obj->ref_ext;
$this->civility_id = $obj->civility_id; $this->civility_id = $obj->civility_id;
$this->civility_code = $obj->civility_id; $this->civility_code = $obj->civility_code;
$this->civility = $obj->civility;
$this->lastname = $obj->lastname; $this->lastname = $obj->lastname;
$this->firstname = $obj->firstname; $this->firstname = $obj->firstname;
$this->address = $obj->address; $this->address = $obj->address;