début ajout possibilité de déterminer si le contenu d'une catégorie 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:
parent
2c193f6470
commit
304142fab1
@ -274,8 +274,18 @@ else
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$sql = "SELECT p.rowid as rowid, p.label as produit, ps.reel as value ";
|
$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 ";
|
$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 .= " WHERE ps.fk_product = p.rowid ";
|
||||||
$sql .= " AND ps.reel >0 AND ps.fk_entrepot = ".$entrepot->id;
|
$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);
|
//$sql .= $db->plimit($limit + 1 ,$offset);
|
||||||
|
|
||||||
|
|||||||
@ -47,9 +47,18 @@ if (! $sortfield) $sortfield="m.datem";
|
|||||||
if (! $sortorder) $sortorder="DESC";
|
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 = "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";
|
$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 .= " ORDER BY $sortfield $sortorder ";
|
||||||
$sql .= $db->plimit($limit + 1 ,$offset);
|
$sql .= $db->plimit($limit + 1 ,$offset);
|
||||||
$result = $db->query($sql) ;
|
$result = $db->query($sql) ;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user