diff --git a/_inventory.html b/_inventory.html index b74bdbb..752e5f1 100644 --- a/_inventory.html +++ b/_inventory.html @@ -1,18 +1,59 @@ {{* -*- brindille -*- *}} {{* - inventaire des entrées/sorties des matériels permanents + Inventaire des matériels en stock dans l'association *}} -{{* Sélecteur catégories *}} -{{:assign var="options." value="" label="Toutes les catégories" href="?prop=1"}} +{{* filtrer selon la catégorie *}} +{{if $_GET.cat_key == null}} + {{:assign selected_category=$module.config.stock_cat_key}} + {{if $module.config.stock_cat_key != null}} + {{:assign cat_key=$selected_category|quote_sql}} + {{/if}} +{{elseif $_GET.cat_key == -1}} + {{:assign selected_category=null}} + {{:save key="config" stock_cat_key=null}} +{{else}} + {{:assign selected_category=$_GET.cat_key}} + {{:assign cat_key=$selected_category|quote_sql}} + {{:save key="config" stock_cat_key=$selected_category}} +{{/if}} + +{{* condition de filtrage *}} +{{if $selected_category != null}} + {{:assign cat_condition="$$.category = %s"|args:$cat_key}} +{{else}} + {{:assign cat_condition="1"}} +{{/if}} + +{{* filtrer selon appartenance *}} +{{if $_GET.prop == null}} + {{:assign selected_prop=$module.config.stock_prop}} +{{elseif $_GET.prop == -1}} + {{:assign selected_prop=null}} + {{:save key="config" stock_prop=null}} +{{else}} + {{:assign selected_prop=$_GET.prop}} + {{:save key="config" stock_prop=$_GET.prop}} +{{/if}} + +{{if $selected_prop == null}} + {{:assign prop_condition="1"}} +{{elseif $selected_prop == 1}} + {{:assign prop_condition="$$.stock NOT NULL"}} +{{else}} + {{:assign prop_condition="$$.notowned != 0"}} +{{/if}} + +{{* sélecteurs de catégorie et d'appartenance *}} +{{:assign var="cat_options." value="" label="Toutes les catégories" href="?cat_key=-1"}} {{#load type="category" order="$$.name"}} {{:assign var="categories.%s"|args:$key value=$name}} {{:assign - var="options." + var="cat_options." value=$key label=$name - href="?cat_key=%s&prop=1"|args:$key + href="?cat_key=%s"|args:$key }} {{/load}} @@ -20,23 +61,28 @@ {{:dropdown title="Filtrer par catégorie" - options=$options - value="%s"|args:$_GET.cat_key + options=$cat_options + value="%s"|args:$selected_category + }} + + +{{:assign var="prop_options." value="" label="Tous les matériels" href="?prop=-1"}} +{{:assign var="prop_options." value="1" label="Matériels propriété de l'association" href="?prop=1"}} +{{:assign var="prop_options." value="0" label="Matériels NON propriété de l'association" href="?prop=0"}} + +
Inventaire des matériels propriété de l'association
+Inventaire des matériels présents dans l'association
Ajout effectué
@@ -37,14 +28,13 @@Modification refusée
{{/if}} + {{#load type="category" count=true limit=1 assign="result"}}{{/load}} + {{:include file="_nav.html" current="inventaire" cat="%d"|args:$result.count subcurrent="stock"}} + {{if $result.count == 0}}Il n'y a aucune catégorie : vous devez en ajouter.
{{else}} - {{if $_GET.prop == null || $_GET.prop == "1"}} - {{:include file="./_inventory.html"}} - {{else}} - {{:include file="./_temp_inventory.html"}} - {{/if}} + {{:include file="./_inventory.html"}} {{/if}} {{:admin_footer}}