Merge pull request #1164 from PaulPoulain/966-develop

T966-develop : Put the poste of the contact in the list
This commit is contained in:
Laurent Destailleur 2013-08-07 16:51:27 -07:00
commit bf95cf40d9

View File

@ -1580,7 +1580,7 @@ class Societe extends CommonObject
{ {
$contact_property = array(); $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.= " FROM ".MAIN_DB_PREFIX."socpeople";
$sql.= " WHERE fk_soc = '".$this->id."'"; $sql.= " WHERE fk_soc = '".$this->id."'";
@ -1596,7 +1596,13 @@ class Societe extends CommonObject
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
if ($mode == 'email') $property=$obj->email; if ($mode == 'email') $property=$obj->email;
else if ($mode == 'mobile') $property=$obj->phone_mobile; else if ($mode == 'mobile') $property=$obj->phone_mobile;
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.">"; $contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))." <".$property.">";
}
$i++; $i++;
} }
} }