From 897f40d763638d882976cab23fa7aee446573bd1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 May 2007 21:13:11 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20La=20recup=20des=20contacts=20d'entit=E9?= =?UTF-8?q?=20=E9chouait=20dans=20certains=20cas.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/commonobject.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php index 8624f5d00f0..2fbe318e4ac 100644 --- a/htdocs/commonobject.class.php +++ b/htdocs/commonobject.class.php @@ -120,7 +120,7 @@ class CommonObject { // Insertion dans la base $sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set"; - $sql.= " statut = $statut,"; + $sql.= " statut = ".$statut.","; $sql.= " fk_c_type_contact = '".$type_contact_id ."'"; $sql.= " where rowid = ".$rowid; // Retour @@ -221,11 +221,11 @@ class CommonObject function detail_contact($rowid) { $sql = "SELECT ec.datecreate, ec.statut, ec.fk_socpeople, ec.fk_c_type_contact,"; - $sql.= " tc.code, tc.libelle, s.fk_soc"; - $sql.= " FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc, "; - $sql.= " ".MAIN_DB_PREFIX."socpeople as s"; + $sql.= " tc.code, tc.libelle,"; + $sql.= " s.fk_soc"; + $sql.= " FROM (".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc)"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as s ON ec.fk_socpeople=s.idp"; // Si contact de type external, alors il est lié à une societe $sql.= " WHERE ec.rowid =".$rowid; - $sql.= " AND ec.fk_socpeople=s.idp"; $sql.= " AND ec.fk_c_type_contact=tc.rowid"; $sql.= " AND tc.element = '".$this->element."'";