From 7dd8eba29e8b65e2f951aa6b41bbd5e0db9fa331 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 22 Apr 2016 10:30:13 +0200 Subject: [PATCH] New contact gender according to civility --- htdocs/contact/class/contact.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 5c0dede1bbc..88cd24af359 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -593,8 +593,15 @@ class Contact extends CommonObject $this->canvas = $obj->canvas; $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 .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.fk_socpeople = ". $this->id;