début restructuration du code des catégories

This commit is contained in:
Regis Houssin 2006-02-22 17:37:32 +00:00
parent 43eb4e0ff7
commit d18d23f2e6

View File

@ -44,9 +44,21 @@ else
llxHeader("","",$langs->trans("Categories")); llxHeader("","",$langs->trans("Categories"));
$html = new Form($db); $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) if ($user->rights->produit->creer)
@ -85,14 +97,14 @@ if ($user->rights->produit->creer)
print '</td></tr></form>'; print '</td></tr></form>';
} }
}
/* /*
* Action confirmation de création de la catégorie * 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_titre($langs->trans("CatCreated"));
print '<table border="0" width="100%">'; print '<table border="0" width="100%">';
@ -127,11 +139,11 @@ if ($_GET["action"] == 'confirmed' && $$user->rights->produit->creer)
} }
} }
print '</td></tr></table>'; print '</td></tr></table>';
}
} }
print '</table>'; print '</table>';
/* /*