diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index ce4d0d8e2dd..eb264ac5f77 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -44,9 +44,21 @@ else llxHeader("","",$langs->trans("Categories")); $html = new Form($db); +// Action ajout d'un produit ou service +if ($_POST["action"] == 'add' && $user->rights->produit->creer) +{ + $categorie = new Categorie($db); + + $categorie->label = stripslashes($_POST["nom"]); + $categorie->description = stripslashes($_POST["description"]); + $cats_meres = isset($_POST['cats_meres']) ? $_POST['cats_meres'] : array(); + + $_GET["action"] = 'confirmed'; +} + /* - * Action création de la catégorie + * Fiche en mode création */ if ($user->rights->produit->creer) @@ -85,14 +97,14 @@ if ($user->rights->produit->creer) print ''; } -} + /* * Action confirmation de création de la catégorie */ -if ($_GET["action"] == 'confirmed' && $$user->rights->produit->creer) -{ + if ($_GET["action"] == 'confirmed') + { print_titre($langs->trans("CatCreated")); print ''; @@ -127,11 +139,11 @@ if ($_GET["action"] == 'confirmed' && $$user->rights->produit->creer) } } print '
'; + } } - print ''; /*