Modification: les produits ne faisant pas partie d'une catgorie seront visible

This commit is contained in:
Regis Houssin 2006-04-03 08:06:35 +00:00
parent 2f81defde4
commit 33098783c8
3 changed files with 9 additions and 12 deletions

View File

@ -69,10 +69,9 @@ class box_produits extends ModeleBoxes {
$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 cp.fk_product = p.rowid";
$sql .= " AND cp.fk_categorie = c.rowid AND c.visible = 1";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid";
$sql.= " WHERE IFNULL(c.visible,1)=1";
}
$sql .= " ORDER BY p.datec DESC";
$sql .= $db->plimit($max, 0);

View File

@ -1955,14 +1955,13 @@ function get_each_prod()
$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 ca";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid";
}
$sql.= " WHERE p.fk_product_type = 0";
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql .= " AND cp.fk_product = p.rowid";
$sql .= " AND cp.fk_categorie = ca.rowid AND ca.visible = 1";
$sql.= " AND IFNULL(c.visible,1)=1";
}
$resql=$this->db->query($sql);
if ($resql)

View File

@ -208,14 +208,13 @@ class Service
$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 ca";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid";
}
$sql.= " WHERE p.fk_product_type = 1";
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql .= " AND cp.fk_product = p.rowid";
$sql .= " AND cp.fk_categorie = ca.rowid AND ca.visible = 1";
$sql.= " AND IFNULL(c.visible,1)=1";
}
$resql=$this->db->query($sql);
if ($resql)