From dfded28802351a368fa4cd86b475b8f80b2562d1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 22 Feb 2006 15:13:11 +0000 Subject: [PATCH] =?UTF-8?q?d=E9but=20restructuration=20du=20code=20des=20c?= =?UTF-8?q?at=E9gories?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/categories/fiche.php | 12 +++++++----- htdocs/html.form.class.php | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 5 deletions(-) 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