From c3804bdac3ebdf465423c638f1b4ff5ebf49d9ac Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 31 Mar 2006 14:42:22 +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/langs/en_US/products.lang | 2 +- htdocs/langs/fr_FR/products.lang | 2 +- htdocs/product/stock/entrepot.class.php | 16 +++++++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index f600733cfa7..686e6a034f9 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -5,7 +5,7 @@ Services=Services Product=Product Service=Service Create=Create -References=References +Reference=Reference NewProduct=New product NewService=New service ProductCode=Product code diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index b8f239e1350..22ec1f3dc6a 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -5,7 +5,7 @@ Services=Services Product=Produit Service=Service Create=Créer -References=Références +Reference=Référence NewProduct=Nouveau produit NewService=Nouveau service ProductCode=Code produit diff --git a/htdocs/product/stock/entrepot.class.php b/htdocs/product/stock/entrepot.class.php index dcc578f1ce0..f2b513249b1 100644 --- a/htdocs/product/stock/entrepot.class.php +++ b/htdocs/product/stock/entrepot.class.php @@ -281,7 +281,21 @@ class Entrepot */ function nb_products() { - $sql = "SELECT sum(reel) FROM llx_product_stock WHERE fk_entrepot = ".$this->id; + global $conf,$user; + + $sql = "SELECT sum(ps.reel)"; + $sql .= " FROM llx_product_stock as ps"; + 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_entrepot = ".$this->id; + if ($conf->categorie->enabled && !$user->rights->categorie->voir) + { + $sql .= " AND cp.fk_product = ps.fk_product"; + $sql .= " AND cp.fk_categorie = c.rowid AND c.visible = 1"; + } $result = $this->db->query($sql) ;