2023-12-04 10:56:36 +01:00
|
|
|
{{#restrict section="accounting" level="write" block=true}}{{/restrict}}
|
2023-10-26 11:55:01 +02:00
|
|
|
{{:admin_header title="Modifier une catégorie" current="module_equipment"}}
|
2023-10-21 10:56:29 +02:00
|
|
|
|
2023-10-27 08:54:05 +02:00
|
|
|
{{#load key=$_GET.key assign="category"}}
|
2023-10-21 10:56:29 +02:00
|
|
|
{{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
|
|
|
|
}}
|
2023-12-05 19:17:08 +01:00
|
|
|
{{:redirect force="./index.html?ok=1&msg=modification"}}
|
2023-10-21 10:56:29 +02:00
|
|
|
{{/form}}
|
|
|
|
|
|
|
|
{{:form_errors}}
|
|
|
|
|
|
|
|
{{* formulaire de modification de catégorie *}}
|
|
|
|
<form method="post" action="">
|
|
|
|
<fieldset class="modif_categorie">
|
|
|
|
<legend>Modifier la catégorie « {{$category.name}} »</legend>
|
|
|
|
<dl>
|
|
|
|
{{:input type="text" name="name" label="Nom" default=$category.name required=true maxlength="100"}}
|
|
|
|
</dl>
|
|
|
|
<p class="submit">
|
|
|
|
{{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}}
|
|
|
|
</p>
|
|
|
|
</fieldset>
|
|
|
|
</form>
|