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 13:08:21 +00:00
parent e703a108a0
commit 9d7d6d44ee
2 changed files with 6 additions and 6 deletions

View File

@ -74,7 +74,7 @@ $prodser[0][0]=$prodser[0][1]=$prodser[1][0]=$prodser[1][1]=0;
$sql = "SELECT count(*), p.fk_product_type, p.envente";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
if (!$user->rights->categorie->voir)
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";
$sql .= ", ".MAIN_DB_PREFIX."categorie as c";
@ -127,7 +127,7 @@ print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
$max=15;
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.envente";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
if (!$user->rights->categorie->voir)
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";
$sql .= ", ".MAIN_DB_PREFIX."categorie as c";

View File

@ -79,12 +79,12 @@ $sql = 'SELECT p.rowid, p.ref, p.label, p.price, p.fk_product_type, '.$db->pdate
$sql.= ' p.duration, p.envente as statut';
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; // '.MAIN_DB_PREFIX.'product_det as d'; //en attendant le debugage
if ($catid || !$user->rights->categorie->voir)
if ($catid || ($conf->categorie->enabled && !$user->rights->categorie->voir))
{
$sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";
}
if (!$user->rights->categorie->voir)
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql .= ", ".MAIN_DB_PREFIX."categorie as c";
}
@ -115,7 +115,7 @@ if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0)
{
$sql .= " AND p.envente = ".$_GET["envente"];
}
if($catid || !$user->rights->categorie->voir)
if($catid || ($conf->categorie->enabled && !$user->rights->categorie->voir))
{
$sql .= " AND cp.fk_product = p.rowid";
}
@ -123,7 +123,7 @@ if($catid)
{
$sql .= " AND cp.fk_categorie = ".$catid;
}
if (!$user->rights->categorie->voir)
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql .= " AND cp.fk_categorie = c.rowid AND c.visible = 1";
}