diff --git a/htdocs/categories/create.php b/htdocs/categories/create.php index 3691ee2fcff..05dcea62885 100644 --- a/htdocs/categories/create.php +++ b/htdocs/categories/create.php @@ -29,7 +29,7 @@ require "./pre.inc.php"; -if (!$user->rights->categorie->creer) accessforbidden(); +if (!$user->rights->categorie->lire) accessforbidden(); if (isset ($_REQUEST['choix'])) { @@ -45,50 +45,31 @@ else llxHeader("","",$langs->trans("Categories")); -print_fiche_titre($langs->trans("CreateCat")); +/* + * Action création du produit + */ +if ($_GET["action"] == 'create' && $user->rights->produit->creer) +{ + print '
'; + print ''; + print ''; -print ''; + print_fiche_titre($langs->trans("CreateCat")); -print '
'; + print ''; + print ''; + print ''; + print ' - - - -
'.$langs->trans("Label").''; + if ($_error == 1) + { + print $lang->trans("ErrCatAlreadyExists"); + } + print'
'.$langs->trans("Description").''; + print '
trans ("In"); ?> trans ("categories"); ?> diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 4d328b435ac..f34efe8c8d5 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -912,6 +912,34 @@ class Form } } + /** + * \brief Retourne la liste déroulante de création en sous catégories possible + * \param selected nombre de sous catégorie pré-sélectionnée + */ + function select_nombre_sous_categorie($selected='', $nbcats=1) + { + global $conf,$langs; + $langs->load("categorie"); + + $categorie = new Categorie ($db); + $nb = $categorie->get_nb_categories(); + + for ($i = 0 ; $i <= $nb ; $i++) + { + print ''; + } + } /** * \brief Retourne la liste déroulante des civilite actives