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
a757357152
commit
74216fd4fa
@ -79,11 +79,16 @@ $sql = 'SELECT p.rowid, p.ref, p.label, p.price, p.fk_product_type, '.$db->pdate
|
|||||||
$sql.= ' p.duration, p.envente as statut';
|
$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
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; // '.MAIN_DB_PREFIX.'product_det as d'; //en attendant le debugage
|
||||||
|
|
||||||
if ($catid)
|
if ($catid || !$user->rights->categorie->voir)
|
||||||
{
|
{
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";
|
$sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$user->rights->categorie->voir)
|
||||||
|
{
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."categorie as c";
|
||||||
|
}
|
||||||
|
|
||||||
if ($_GET["fourn_id"] > 0)
|
if ($_GET["fourn_id"] > 0)
|
||||||
{
|
{
|
||||||
$fourn_id = $_GET["fourn_id"];
|
$fourn_id = $_GET["fourn_id"];
|
||||||
@ -110,11 +115,18 @@ if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0)
|
|||||||
{
|
{
|
||||||
$sql .= " AND p.envente = ".$_GET["envente"];
|
$sql .= " AND p.envente = ".$_GET["envente"];
|
||||||
}
|
}
|
||||||
if($catid)
|
if($catid || !$user->rights->categorie->voir)
|
||||||
{
|
{
|
||||||
$sql .= " AND cp.fk_product = p.rowid";
|
$sql .= " AND cp.fk_product = p.rowid";
|
||||||
|
}
|
||||||
|
if($catid)
|
||||||
|
{
|
||||||
$sql .= " AND cp.fk_categorie = ".$catid;
|
$sql .= " AND cp.fk_categorie = ".$catid;
|
||||||
}
|
}
|
||||||
|
if (!$user->rights->categorie->voir)
|
||||||
|
{
|
||||||
|
$sql .= " AND cp.fk_categorie = c.rowid AND c.visible = 1";
|
||||||
|
}
|
||||||
if ($fourn_id > 0)
|
if ($fourn_id > 0)
|
||||||
{
|
{
|
||||||
$sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id;
|
$sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user