Fix: Si pas de droits en modif sur produits, alors pas moyen de supprimer une affectation de catégorie
This commit is contained in:
parent
b064e4c272
commit
bf0db736ac
@ -62,22 +62,19 @@ $html = new Form($db);
|
|||||||
if ($_GET["id"] || $_GET["ref"])
|
if ($_GET["id"] || $_GET["ref"])
|
||||||
{
|
{
|
||||||
//on veut supprimer une catégorie
|
//on veut supprimer une catégorie
|
||||||
if ($_REQUEST["cat"])
|
if ($_REQUEST["removecat"] && $user->rights->produit->creer)
|
||||||
{
|
{
|
||||||
$cat = new Categorie($db,$_REQUEST["cat"]);
|
$cat = new Categorie($db,$_REQUEST["removecat"]);
|
||||||
$cat->del_product($product);
|
$cat->del_product($product);
|
||||||
}
|
}
|
||||||
|
|
||||||
//on veut ajouter une catégorie
|
//on veut ajouter une catégorie
|
||||||
if (isset($_REQUEST["catMere"]) && $_REQUEST["catMere"]>=0)
|
if (isset($_REQUEST["catMere"]) && $_REQUEST["catMere"]>=0 && $user->rights->produit->creer)
|
||||||
{
|
{
|
||||||
$cat = new Categorie($db,$_REQUEST["catMere"]);
|
$cat = new Categorie($db,$_REQUEST["catMere"]);
|
||||||
$cat->add_product($product);
|
$cat->add_product($product);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $result )
|
|
||||||
{
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* En mode visu
|
* En mode visu
|
||||||
*/
|
*/
|
||||||
@ -250,8 +247,26 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
foreach ($ways as $way)
|
foreach ($ways as $way)
|
||||||
{
|
{
|
||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
print "<tr ".$bc[$var]."><td>".$way."</td>";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td align="right">'.img_delete($langs->trans("DeleteFromCat"))." <a href= '".DOL_URL_ROOT."/product/categorie.php?id=".$product->id."&cat=".$cat->id."'>".$langs->trans("DeleteFromCat")."</a></td></tr>\n";
|
|
||||||
|
// Categorie
|
||||||
|
print "<td>".$way."</td>";
|
||||||
|
|
||||||
|
// Lien supprimer
|
||||||
|
print '<td align="right">';
|
||||||
|
if ($user->rights->produit->creer)
|
||||||
|
{
|
||||||
|
print "<a href= '".DOL_URL_ROOT."/product/categorie.php?id=".$product->id."&removecat=".$cat->id."'>";
|
||||||
|
print img_delete($langs->trans("DeleteFromCat")).' ';
|
||||||
|
print $langs->trans("DeleteFromCat")."</a>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
print "</td>";
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,8 +284,6 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user