Simplification opérations catégories
This commit is contained in:
parent
b2d6254a0c
commit
a0293c3e92
2 changed files with 5 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
{{#form on="delete"}}
|
||||
{{* Vérifier s'il reste des matériels dans cette catégorie *}}
|
||||
{{#load type="equipment" category=$_GET.key assign="equipment"}}
|
||||
{{#load type="equipment" category=$_GET.key limit="1"}}
|
||||
{{:redirect force="./index.html?err=1&msg=suppression"}}
|
||||
{{else}}
|
||||
{{* supprimer la catégorie sélectionnée*}}
|
||||
|
|
|
@ -27,15 +27,17 @@
|
|||
{{:assign category_key=$key}}
|
||||
{{* voir s'il y a des matériels dans cette catégorie *}}
|
||||
{{:assign materiel_present=true}}
|
||||
{{#load type="equipment" where="$$.category = :category_key" :category_key=$category_key}}
|
||||
{{#load type="equipment" where="$$.category = :category_key" :category_key=$category_key limit=1}}
|
||||
{{else}}
|
||||
{{:assign materiel_present=false}}
|
||||
{{/load}}
|
||||
<tr>
|
||||
<th>{{$name}}</th>
|
||||
<td class="actions">
|
||||
{{:linkbutton label="Modifier" href="modify_category.html?key=%s"|args:$key shape="edit" target="_dialog"}}
|
||||
{{if ! $materiel_present}}
|
||||
{{:linkbutton label="Supprimer" href="delete_category.html?key=%s"|args:$key shape="delete" target="_dialog"}}
|
||||
{{/if}}
|
||||
{{:linkbutton label="Modifier" href="modify_category.html?key=%s"|args:$key shape="edit" target="_dialog"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{else}}
|
||||
|
|
Loading…
Add table
Reference in a new issue