This commit is contained in:
Regis Houssin 2006-02-23 11:45:53 +00:00
parent c829c28b77
commit 39c87f9695

View File

@ -55,14 +55,14 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer)
$categorie->description = stripslashes($_POST["description"]); $categorie->description = stripslashes($_POST["description"]);
$cats_meres = isset($_POST['catsMeres']) ? $_POST['catsMeres'] : array(); $cats_meres = isset($_POST['catsMeres']) ? $_POST['catsMeres'] : array();
if (sizeof ($cats_meres) > 1 && sizeof (array_unique ($cats_meres)) != sizeof ($cats_meres)) if (!$categorie->label || !$categorie->description)
{ // alors il y a des valeurs en double {
print '<p>'.$langs->trans("ErrSameCatSelected").'</p>';
$_GET["action"] = 'create'; $_GET["action"] = 'create';
} }
else 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 '<p>'.$langs->trans("ErrSameCatSelected").'</p>';
$_GET["action"] = 'create'; $_GET["action"] = 'create';
} }
else else
@ -82,11 +82,16 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer)
{ {
$_error = 2; $_error = 2;
} }
} else
} {
$_GET["action"] = 'confirmed'; $_GET["action"] = 'confirmed';
$_POST["addcat"] = ''; $_POST["addcat"] = '';
} }
}
}
}
} }