From 9d7d6d44eec2e6bbe5a02ce4783a646eb042da10 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 31 Mar 2006 13:08:21 +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 | 4 ++-- htdocs/product/liste.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 72ecf928bf9..22a7b42f09b 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -74,7 +74,7 @@ $prodser[0][0]=$prodser[0][1]=$prodser[1][0]=$prodser[1][1]=0; $sql = "SELECT count(*), p.fk_product_type, p.envente"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; -if (!$user->rights->categorie->voir) +if ($conf->categorie->enabled && !$user->rights->categorie->voir) { $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; $sql .= ", ".MAIN_DB_PREFIX."categorie as c"; @@ -127,7 +127,7 @@ print ''; $max=15; $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.envente"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; -if (!$user->rights->categorie->voir) +if ($conf->categorie->enabled && !$user->rights->categorie->voir) { $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; $sql .= ", ".MAIN_DB_PREFIX."categorie as c"; diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 2b8c290a14e..5112fa4b05a 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -79,12 +79,12 @@ $sql = 'SELECT p.rowid, p.ref, p.label, p.price, p.fk_product_type, '.$db->pdate $sql.= ' p.duration, p.envente as statut'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; // '.MAIN_DB_PREFIX.'product_det as d'; //en attendant le debugage -if ($catid || !$user->rights->categorie->voir) +if ($catid || ($conf->categorie->enabled && !$user->rights->categorie->voir)) { $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; } -if (!$user->rights->categorie->voir) +if ($conf->categorie->enabled && !$user->rights->categorie->voir) { $sql .= ", ".MAIN_DB_PREFIX."categorie as c"; } @@ -115,7 +115,7 @@ if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0) { $sql .= " AND p.envente = ".$_GET["envente"]; } -if($catid || !$user->rights->categorie->voir) +if($catid || ($conf->categorie->enabled && !$user->rights->categorie->voir)) { $sql .= " AND cp.fk_product = p.rowid"; } @@ -123,7 +123,7 @@ if($catid) { $sql .= " AND cp.fk_categorie = ".$catid; } -if (!$user->rights->categorie->voir) +if ($conf->categorie->enabled && !$user->rights->categorie->voir) { $sql .= " AND cp.fk_categorie = c.rowid AND c.visible = 1"; }