From c829c28b77ae093f9698c898729f117d74ea7c6e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 23 Feb 2006 11:09:21 +0000 Subject: [PATCH] bugfix --- htdocs/categories/fiche.php | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 12852bf48fb..267afd605e5 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -44,6 +44,8 @@ else llxHeader("","",$langs->trans("Categories")); $html = new Form($db); + + // Action ajout d'un produit ou service if ($_POST["action"] == 'add' && $user->rights->produit->creer) { @@ -53,7 +55,13 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer) $categorie->description = stripslashes($_POST["description"]); $cats_meres = isset($_POST['catsMeres']) ? $_POST['catsMeres'] : array(); - if (!$categorie->label || !$categorie->description) + if (sizeof ($cats_meres) > 1 && sizeof (array_unique ($cats_meres)) != sizeof ($cats_meres)) + { // alors il y a des valeurs en double + print '

'.$langs->trans("ErrSameCatSelected").'

'; + $_GET["action"] = 'create'; + } + + else if (!$categorie->label || !$categorie->description) { $_GET["action"] = 'create'; } @@ -161,32 +169,6 @@ if ($user->rights->produit->creer) print ''; /* - get_all_categories();//on récupère toutes les catégories et leurs attributs - - for ($i = 0; $i < $nbcats ; $i++) - { - echo "".$langs->trans ("Categorie")." ".($i+1).""; - } - ?> - - - -