From 42540b8c53ec73a3d302ac3aefa2aa6447861526 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Sat, 21 Oct 2023 10:56:29 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20modification=20cat=C3=A9gorie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- categories/index.html | 1 + categories/modify_category.html | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 categories/modify_category.html diff --git a/categories/index.html b/categories/index.html index 224b826..2e2652a 100644 --- a/categories/index.html +++ b/categories/index.html @@ -18,6 +18,7 @@ {{$key}} {{:linkbutton label="Liste des matériels" href="list_equipment.html?id=%s&dialog"|args:$key shape="search" target="_dialog"}} + {{:linkbutton label="Modifier" href="modify_category.html?id=%s"|args:$key shape="edit" target="_dialog"}} {{:linkbutton label="Supprimer" href="delete_category.html?id=%s"|args:$key shape="delete" target="_dialog"}} diff --git a/categories/modify_category.html b/categories/modify_category.html new file mode 100644 index 0000000..b11e368 --- /dev/null +++ b/categories/modify_category.html @@ -0,0 +1,35 @@ +{{#restrict section="config" level="admin" block=true}}{{/restrict}} +{{:admin_header title="Supprimer une catégorie" current="module_equipment"}} + +{{#load key=$_GET.id assign="category"}} +{{else}} + {{:error message="Catégorie introuvable"}} +{{/load}} + +{{* Traiter l'envoi du formulaire *}} +{{#form on="save"}} + {{:save + key=$category.key + validate_schema="./category.schema.json" + type="category" + name=$_POST.name|trim + }} + {{:redirect to="./index.html?ok=1"}} +{{/form}} + +{{:form_errors}} + +{{* formulaire de modification de catégorie *}} +
+
+ Modifier la catégorie « {{$category.name}} » +
+ {{:input type="text" name="name" label="Nom" default=$category.name required=true maxlength="100"}} +
+

+ {{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}} +

+
+
+ +{{:admin_footer}}