New contact gender according to civility
This commit is contained in:
parent
2d558174f2
commit
7dd8eba29e
@ -593,8 +593,15 @@ class Contact extends CommonObject
|
|||||||
$this->canvas = $obj->canvas;
|
$this->canvas = $obj->canvas;
|
||||||
|
|
||||||
$this->import_key = $obj->import_key;
|
$this->import_key = $obj->import_key;
|
||||||
|
|
||||||
|
// Define gender according to civility
|
||||||
|
if(in_array($this->civility_id, array('MR'))) {
|
||||||
|
$this->gender = 'man';
|
||||||
|
} else if(in_array($this->civility_id, array('MME','MLE'))) {
|
||||||
|
$this->gender = 'woman';
|
||||||
|
}
|
||||||
|
|
||||||
// Recherche le user Dolibarr lie a ce contact
|
// Search Dolibarr user linked to this contact
|
||||||
$sql = "SELECT u.rowid ";
|
$sql = "SELECT u.rowid ";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql .= " WHERE u.fk_socpeople = ". $this->id;
|
$sql .= " WHERE u.fk_socpeople = ". $this->id;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user