From e703a108a06cd2cc828f6c599936a7d5049f5c5e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 31 Mar 2006 12:55:23 +0000 Subject: [PATCH] =?UTF-8?q?d=E9but=20ajout=20possibilit=E9=20de=20d=E9term?= =?UTF-8?q?iner=20si=20le=20contenu=20d'une=20cat=E9gorie=20sera=20visible?= =?UTF-8?q?=20ou=20=20non=20dans=20la=20liste=20des=20produits/services,?= =?UTF-8?q?=20ceci=20afin=20de=20pouvoir=20cacher=20les=20sous-produits=20?= =?UTF-8?q?=20par=20exemple.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/product/index.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index a9909057e85..72ecf928bf9 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -72,7 +72,16 @@ print "
"; $prodser = array(); $prodser[0][0]=$prodser[0][1]=$prodser[1][0]=$prodser[1][1]=0; -$sql = "SELECT count(*), fk_product_type, envente FROM ".MAIN_DB_PREFIX."product as p GROUP BY fk_product_type, envente"; +$sql = "SELECT count(*), p.fk_product_type, p.envente"; +$sql .= " FROM ".MAIN_DB_PREFIX."product as p"; +if (!$user->rights->categorie->voir) +{ + $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; + $sql .= ", ".MAIN_DB_PREFIX."categorie as c"; + $sql .= " WHERE cp.fk_product = p.rowid"; + $sql .= " AND cp.fk_categorie = c.rowid AND c.visible = 1"; +} +$sql .= " GROUP BY p.fk_product_type, p.envente"; $result=$db->query($sql); if ($result) {