diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index a4d36e4cf0a..3c44014fa51 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -2284,10 +2284,9 @@ class Commande extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = co.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; } - $sql.= " WHERE 1 = 1"; if ($conf->categorie->enabled && !$user->rights->categorie->voir) { - $sql.= " AND IFNULL(c.visible,1)=1"; + $sql.= " WHERE IFNULL(c.visible,1)=1"; } $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 54517b9be00..12626b8858f 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -2666,10 +2666,9 @@ class Facture extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = f.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; } - $sql.= " WHERE 1 = 1"; if ($conf->categorie->enabled && !$user->rights->categorie->voir) { - $sql.= " AND IFNULL(c.visible,1)=1"; + $sql.= " WHERE IFNULL(c.visible,1)=1"; } $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 50c0440d97b..7d047d714b4 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -2045,10 +2045,9 @@ class Propal extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; } - $sql.= " WHERE 1 = 1"; if ($conf->categorie->enabled && !$user->rights->categorie->voir) { - $sql.= " AND IFNULL(c.visible,1)=1"; + $sql.= " WHERE IFNULL(c.visible,1)=1"; } $resql=$this->db->query($sql); if ($resql)