From d18d23f2e6cbb02ce46291115a1a0ace53ef8d93 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 22 Feb 2006 17:37:32 +0000 Subject: [PATCH] =?UTF-8?q?d=E9but=20restructuration=20du=20code=20des=20c?= =?UTF-8?q?at=E9gories?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/categories/fiche.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) 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 ''; /*