From 4cb3c5641a1743e30e1b1b6f6ae5e9647f848914 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 7 Nov 2009 10:49:52 +0000 Subject: [PATCH] Works on multicompany module Fix: uniformize code --- htdocs/adherents/adherent_type.class.php | 2 +- htdocs/adherents/liste.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/adherent_type.class.php b/htdocs/adherents/adherent_type.class.php index 4548c5a542f..4e0f916f1a1 100644 --- a/htdocs/adherents/adherent_type.class.php +++ b/htdocs/adherents/adherent_type.class.php @@ -217,7 +217,7 @@ class AdherentType extends CommonObject $sql = "SELECT rowid, libelle"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type"; - $sql.= "WHERE entity = ".$conf->entity; + $sql.= " WHERE entity = ".$conf->entity; $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index 90c392fe1f9..3ff427d5cf4 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -77,6 +77,7 @@ $sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,"; $sql.= " t.libelle as type, t.cotisation"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; $sql.= " WHERE d.fk_adherent_type = t.rowid "; +$sql.= " AND d.entity = ".$conf->entity; if ($sall) { $sql.=" AND (d.prenom like '%".$sall."%' OR d.nom like '%".$sall."%' OR d.societe like '%".$sall."%'"; @@ -89,7 +90,7 @@ if ($_REQUEST["type"] > 0) } if (isset($_GET["statut"])) { - $sql.=" AND d.statut in ($statut)"; // Peut valoir un nombre ou liste de nombre s�par�s par virgules + $sql.=" AND d.statut in ($statut)"; // Peut valoir un nombre ou liste de nombre separes par virgules } if ( $_POST["action"] == 'search') { @@ -121,7 +122,7 @@ if ($filter == 'outofdate') $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $resql = $db->query($sql); + $resql = $db->query($sql); if ($resql) $nbtotalofrecords = $db->num_rows($result); else dol_print_error($db); }