diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 72ecf928bf9..22a7b42f09b 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -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 '
';
$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";
diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php
index 2b8c290a14e..5112fa4b05a 100644
--- a/htdocs/product/liste.php
+++ b/htdocs/product/liste.php
@@ -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";
}
|