From c329cdfacd082091aab237fa634b5addf43d1b44 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 31 Mar 2006 15:06:28 +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/comm/propal.php | 26 +++++++++++++++++--------- htdocs/html.form.class.php | 13 ++++++++++++- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 6e9b67de7e3..64882eee6a9 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -924,10 +924,14 @@ if ($_GET['propalid'] > 0) print '\n"; print ''; print ''; - if($societe->tva_assuj == "0") - print '0'; - else - $html->select_tva('np_tva_tx', $conf->defaulttx, $mysoc, $societe); + if($societe->tva_assuj == "0") + { + print '0'; + } + else + { + $html->select_tva('np_tva_tx', $conf->defaulttx, $mysoc, $societe); + } print "\n"; print ''; print ''; @@ -948,11 +952,15 @@ if ($_GET['propalid'] > 0) print ''; print ''; - // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) - $html->select_produits('','idprod','',$conf->produit->limit_size,$societe->price_level); - else - $html->select_produits('','idprod','',$conf->produit->limit_size); + // multiprix + if($conf->global->PRODUIT_MULTIPRICES == 1) + { + $html->select_produits('','idprod','',$conf->produit->limit_size,$societe->price_level); + } + else + { + $html->select_produits('','idprod','',$conf->produit->limit_size); + } print '
'; print ''; print ''; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index e64d2140884..8c45d79ea9f 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2006 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * * This program is free software; you can redistribute it and/or modify @@ -606,11 +607,21 @@ class Form */ function select_produits($selected='',$htmlname='productid',$filtretype='',$limit=20,$price_level=0) { - global $langs,$conf; + global $langs,$conf,$user; $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration"; $sql.= " FROM ".MAIN_DB_PREFIX."product as 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 p.envente = 1"; + 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 ($filtretype && $filtretype != '') $sql.=" AND p.fk_product_type=".$filtretype; $sql.= " ORDER BY p.nbvente DESC"; if ($limit) $sql.= " LIMIT $limit";