From c0d3ed0d60e5797abe7703235d6f82fc4c9edcb2 Mon Sep 17 00:00:00 2001 From: lalaina rasamoelina Date: Wed, 7 Aug 2013 10:17:18 +0200 Subject: [PATCH] T966-develop : Put the poste of the contact in the list In the list of contact when we send a mail,i added the post of person in () after the name htdocs/commande/fiche.php?id=481&action=presend&mode=init --- htdocs/societe/class/societe.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6278b7bd8ab..aba3215820c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1576,7 +1576,7 @@ class Societe extends CommonObject { $contact_property = array(); - $sql = "SELECT rowid, email, phone_mobile, lastname, firstname"; + $sql = "SELECT rowid, email, phone_mobile, lastname, poste, firstname"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople"; $sql.= " WHERE fk_soc = '".$this->id."'"; @@ -1592,7 +1592,13 @@ class Societe extends CommonObject $obj = $this->db->fetch_object($resql); if ($mode == 'email') $property=$obj->email; else if ($mode == 'mobile') $property=$obj->phone_mobile; - $contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))." <".$property.">"; + if(!empty($obj->poste)){ + $contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))."(".$obj->poste.")"." <".$property.">"; + } + else + { + $contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))." <".$property.">"; + } $i++; } }