From 2fd9c1d33d3e33095287f6f9b7ed215d05a55975 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 31 Mar 2006 15:26:38 +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/includes/boxes/box_services_vendus.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/includes/boxes/box_services_vendus.php b/htdocs/includes/boxes/box_services_vendus.php index 85511414b34..4e0f3317f15 100644 --- a/htdocs/includes/boxes/box_services_vendus.php +++ b/htdocs/includes/boxes/box_services_vendus.php @@ -69,8 +69,18 @@ class box_services_vendus extends ModeleBoxes { if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."product as p"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + 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 s.idp = c.fk_soc AND c.rowid = cd.fk_contrat AND cd.fk_product = p.rowid"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= " AND s.idp = sc.fk_soc AND sc.fk_user = " .$user->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"; + } if($user->societe_id) { $sql .= " AND s.idp = $user->societe_id";