diff --git a/htdocs/societe.class.php3 b/htdocs/societe.class.php3 index ab8e7b977f9..d6939db59d9 100644 --- a/htdocs/societe.class.php3 +++ b/htdocs/societe.class.php3 @@ -287,6 +287,39 @@ class Societe { * * */ + Function contact_array() + { + $contacts = array(); + + $sql = "SELECT idp, name, firstname FROM llx_socpeople WHERE fk_soc = $this->id"; + + if ($this->db->query($sql) ) + { + $nump = $this->db->num_rows(); + + if ($nump) + { + $i = 0; + while ($i < $nump) + { + $obj = $this->db->fetch_object($i); + + $contacts[$obj->idp] = "$obj->firstname $obj->name"; + $i++; + } + } + return $contacts; + } + else + { + print $this->db->error(); + } + + } + /* + * + * + */ Function contact_get_email($rowid) {