From 74216fd4fa94eec57d40023560f319457dfcddb9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 30 Mar 2006 17:21:57 +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/liste.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index be7fb6cb44a..2b8c290a14e 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -79,11 +79,16 @@ $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) +if ($catid || !$user->rights->categorie->voir) { $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; } +if (!$user->rights->categorie->voir) +{ + $sql .= ", ".MAIN_DB_PREFIX."categorie as c"; +} + if ($_GET["fourn_id"] > 0) { $fourn_id = $_GET["fourn_id"]; @@ -110,11 +115,18 @@ if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0) { $sql .= " AND p.envente = ".$_GET["envente"]; } -if($catid) +if($catid || !$user->rights->categorie->voir) { $sql .= " AND cp.fk_product = p.rowid"; +} +if($catid) +{ $sql .= " AND cp.fk_categorie = ".$catid; } +if (!$user->rights->categorie->voir) +{ + $sql .= " AND cp.fk_categorie = c.rowid AND c.visible = 1"; +} if ($fourn_id > 0) { $sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id;