|
@@ -1789,6 +1789,8 @@ class Contact extends CommonObject
|
|
|
$sql = "SELECT sc.fk_socpeople as id, sc.fk_c_type_contact";
|
|
|
$sql .= " FROM ".MAIN_DB_PREFIX."c_type_contact tc";
|
|
|
$sql .= ", ".MAIN_DB_PREFIX."societe_contacts sc";
|
|
|
+ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."socpeople sp";
|
|
|
+ $sql .= " ON sc.fk_socpeople = sp.rowid AND sp.statut = 1";
|
|
|
$sql .= " WHERE sc.fk_soc =".((int) $this->socid);
|
|
|
$sql .= " AND sc.fk_c_type_contact=tc.rowid";
|
|
|
$sql .= " AND tc.element = '".$this->db->escape($element)."'";
|