diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index a6c6f0f1333..02a696f5b11 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -46,7 +46,7 @@ $html = new Form($db); /* - * Action création du produit + * Action création de la catégorie */ if ($_GET["action"] == 'create' && $user->rights->produit->creer) { @@ -74,12 +74,16 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer) print ''; print ''; print ''; + print $html->select_all_categories($nbcats); + print ''; + print ''; + print ''; } /* - * Affichage page accueil + * Action confirmation de création de la catégorie */ if ($_GET["action"] == 'confirmed' && $$user->rights->produit->creer) @@ -125,9 +129,7 @@ if ($_GET["action"] == 'confirmed' && $$user->rights->produit->creer) print ''; /* - - " name="ok" id="ok" /> - + get_all_categories();//on récupère toutes les catégories et leurs attributs diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index e5221bc4d01..a1c8ba5ba9e 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -915,6 +915,7 @@ 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 + * \param htmlname nom du select */ function select_nombre_sous_categorie($selected='',$htmlname) { @@ -943,6 +944,37 @@ class Form print ''; } } + + /** + * \brief Retourne la ou les listes déroulante des catégories en fonction du nombre choisi + * \param selected nombre de catégorie à créer + */ + function select_all_categories($nbcats='') + { + global $langs; + $langs->load("categorie"); + + $all_categories = $categorie->get_all_categories();//on récupère toutes les catégories et leurs attributs + + for ($i = 0; $i < $nbcats ; $i++) + { + print ''.$langs->trans ("Categorie").' '.($i+1).''; + } + } + + /** * \brief Retourne la liste déroulante des civilite actives