Rationnalisation param GET

This commit is contained in:
Jean-Christophe Engel 2023-10-27 08:54:05 +02:00
parent 0206238b23
commit f3fd16615f
7 changed files with 18 additions and 16 deletions

View file

@ -1,14 +1,14 @@
{{#restrict section="config" level="admin" block=true}}{{/restrict}}
{{:admin_header title="Supprimer une catégorie" current="module_equipment"}}
{{#load key=$_GET.id assign="category"}}
{{#load key=$_GET.key assign="category"}}
{{else}}
{{:error message="Catégorie introuvable"}}
{{/load}}
{{#form on="delete"}}
{{* Vérifier s'il reste des matériels dans cette catégorie *}}
{{#load type="equipment" category=$_GET.id assign="equipment"}}
{{#load type="equipment" category=$_GET.key assign="equipment"}}
{{:redirect force="./index.html?err=1&msg=Cette catégorie ne peut être supprimée car elle contient encore des matériels"}}
{{else}}
{{* supprimer la catégorie sélectionnée*}}

View file

@ -21,9 +21,9 @@
<td>{{$type}}
<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"}}
{{:linkbutton label="Liste des matériels" href="list_equipment.html?key=%s&dialog"|args:$key shape="search" target="_dialog"}}
{{:linkbutton label="Modifier" href="modify_category.html?key=%s"|args:$key shape="edit" target="_dialog"}}
{{:linkbutton label="Supprimer" href="delete_category.html?key=%s"|args:$key shape="delete" target="_dialog"}}
</td>
</tr>
{{else}}

View file

@ -1,6 +1,6 @@
{{#restrict section="config" level="admin" block=true}}{{/restrict}}
{{#load key=$_GET.id}}
{{#load key=$_GET.key}}
{{:assign cat_name=$name}}
{{/load}}
@ -21,7 +21,7 @@
{{#list
select="$$.designation AS 'Désignation'; '' AS 'Stock' ; '' AS 'Sortie' ; '' AS 'Disponible'"
type="equipment"
category=$_GET.id
category=$_GET.key
order=1}}
{{:assign equipment_key=$key}}

View file

@ -1,7 +1,7 @@
{{#restrict section="config" level="admin" block=true}}{{/restrict}}
{{:admin_header title="Modifier une catégorie" current="module_equipment"}}
{{#load key=$_GET.id assign="category"}}
{{#load key=$_GET.key assign="category"}}
{{else}}
{{:error message="Catégorie introuvable"}}
{{/load}}