Merge pull request #10942 from ptibogxiv/patch-147

ADD civility label in fetch contact / API
This commit is contained in:
Laurent Destailleur 2019-04-11 17:57:26 +02:00 committed by GitHub
commit aa14b1b39c
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;
public $address; public $address;
public $zip; public $zip;
public $town; public $town;
@ -695,6 +696,8 @@ class Contact extends CommonObject
{ {
global $langs; global $langs;
$langs->load("dict");
dol_syslog(get_class($this)."::fetch id=".$id, LOG_DEBUG); dol_syslog(get_class($this)."::fetch id=".$id, LOG_DEBUG);
if (empty($id) && empty($ref_ext)) if (empty($id) && empty($ref_ext))
@ -749,6 +752,7 @@ class Contact extends CommonObject
$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_id;
$this->civility = $langs->trans("Civility".$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;