Ajout modification catégorie
This commit is contained in:
parent
c9b150c0cc
commit
42540b8c53
|
@ -18,6 +18,7 @@
|
|||
<td>{{$key}}</td>
|
||||
<td class="actions">
|
||||
{{: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"}}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -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 *}}
|
||||
<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>
|
||||
|
||||
{{:admin_footer}}
|
Loading…
Reference in New Issue