dbut ajout possibilit de dterminer si le contenu d'une catgorie sera visible ou

non dans la liste des produits/services, ceci afin de pouvoir cacher les sous-produits
 par exemple.
This commit is contained in:
Regis Houssin 2006-03-31 14:42:22 +00:00
parent bd40959922
commit c3804bdac3
3 changed files with 17 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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) ;