From 304142fab15668c14d97b4afcd1bad242c0074d1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 31 Mar 2006 13:44:15 +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/stock/fiche.php | 10 ++++++++++ htdocs/product/stock/mouvement.php | 13 +++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index ccb5be36969..6366c5c54d6 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -274,8 +274,18 @@ else print "\n"; $sql = "SELECT p.rowid as rowid, p.label as produit, ps.reel as value "; $sql .= " FROM ".MAIN_DB_PREFIX."product_stock ps, ".MAIN_DB_PREFIX."product p "; + if ($conf->categorie->enabled && !$user->rights->categorie->voir) + { + $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; + $sql .= ", ".MAIN_DB_PREFIX."categorie as c"; + } $sql .= " WHERE ps.fk_product = p.rowid "; $sql .= " AND ps.reel >0 AND ps.fk_entrepot = ".$entrepot->id; + if ($conf->categorie->enabled && !$user->rights->categorie->voir) + { + $sql .= " AND cp.fk_product = p.rowid"; + $sql .= " AND cp.fk_categorie = c.rowid AND c.visible = 1"; + } //$sql .= $db->plimit($limit + 1 ,$offset); diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 1711dda7f3a..5b81ad74a49 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -47,9 +47,18 @@ if (! $sortfield) $sortfield="m.datem"; if (! $sortorder) $sortorder="DESC"; $sql = "SELECT p.rowid, p.label as produit, s.label as stock, m.value, ".$db->pdate("m.datem")." as datem, s.rowid as entrepot_id"; -$sql .= " FROM llx_product as p, llx_entrepot as s, llx_stock_mouvement as m"; +$sql .= " FROM ".MAIN_DB_PREFIX."product as p, ".MAIN_DB_PREFIX."entrepot as s, ".MAIN_DB_PREFIX."stock_mouvement as m"; +if ($conf->categorie->enabled && !$user->rights->categorie->voir) +{ + $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; + $sql .= ", ".MAIN_DB_PREFIX."categorie as c"; +} $sql .= " WHERE m.fk_product = p.rowid AND m.fk_entrepot = s.rowid"; - +if ($conf->categorie->enabled && !$user->rights->categorie->voir) +{ + $sql .= " AND cp.fk_product = p.rowid"; + $sql .= " AND cp.fk_categorie = c.rowid AND c.visible = 1"; +} $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit($limit + 1 ,$offset); $result = $db->query($sql) ;