Ajout filtrage archives par catégorie

This commit is contained in:
Jean-Christophe Engel 2025-02-20 11:39:51 +01:00
parent 4a46099275
commit cb91f0a624

View File

@ -14,7 +14,7 @@
var="options." var="options."
value=$key value=$key
label=$name label=$name
href="?cat_key=%s&prop=1"|args:$key href="?cat_key=%s"|args:$key
}} }}
{{/load}} {{/load}}
@ -31,6 +31,14 @@
<p class="help">Inventaire des matériels archivés</p> <p class="help">Inventaire des matériels archivés</p>
</div> </div>
{{* filtrer selon la catégorie *}}
{{if $_GET.cat_key == null}}
{{:assign condition="1"}}
{{else}}
{{:assign cat_key=$_GET.cat_key|quote_sql}}
{{:assign condition="$$.category == %s"|args:$cat_key}}
{{/if}}
{{* Liste des matériels archivés *}} {{* Liste des matériels archivés *}}
{{#list {{#list
select=" select="
@ -40,9 +48,10 @@
WHERE cat.key = @TABLE.$$.category) AS "Catégorie" WHERE cat.key = @TABLE.$$.category) AS "Catégorie"
" "
type="equipment" type="equipment"
where="$$.status='archived'" where="$$.status='archived' AND %s"|args:$condition
order=1 order=1
}} }}
<tr> <tr>
<td>{{$name}}</td> <td>{{$name}}</td>
<td>{{$col2}}</td> <td>{{$col2}}</td>
@ -58,4 +67,6 @@
target="_dialog"}} target="_dialog"}}
</td> </td>
</tr> </tr>
{{else}}
<p class="block alert">Aucun matériel.</p>
{{/list}} {{/list}}