diff --git a/_get_config.html b/_get_config.html
index 9273f17..0ebc002 100644
--- a/_get_config.html
+++ b/_get_config.html
@@ -8,22 +8,21 @@
{{* config par défaut *}}
{{:read file="./default.json" assign="config_defaut"}}
{{:assign config_defaut=$config_defaut|json_decode}}
+
{{:assign var="directions.input" value="entrée"}}
{{:assign var="directions.output" value="sortie"}}
{{#foreach from=$directions key="direction"}}
- {{* config par défaut *}}
- {{:assign var="nature_defaut" from="config_defaut.%ss"|args:$direction}}
- {{:assign keys_defaut=$nature_defaut|keys}}
- {{#foreach from=$nature_defaut item="elem"}}
- {{:assign var="config.%s_nature.%s"|args:$direction:$key value=$elem}}
- {{/foreach}}
-
- {{* config enregistrée *}}
{{:assign var="nature" from="module.config.%s_nature"|args:$direction}}
- {{#foreach from=$nature item="elem"}}
- {{if ! $elem.key|in:$keys_defaut}}
+ {{if $nature != null}}
+ {{#foreach from=$nature item="elem"}}
{{:assign var="config.%s_nature.%s"|args:$direction:$key value=$elem}}
- {{/if}}
- {{/foreach}}
+ {{/foreach}}
+ {{else}}
+ {{* pas de config enregistrée : utiliser la config par défaut *}}
+ {{:assign var="nature" from="config_defaut.%ss"|args:$direction}}
+ {{#foreach from=$nature item="elem"}}
+ {{:assign var="config.%s_nature.%s"|args:$direction:$key value=$elem}}
+ {{/foreach}}
+ {{/if}}
{{/foreach}}
diff --git a/_inventory.html b/_inventory.html
index 896634e..ce8cffc 100644
--- a/_inventory.html
+++ b/_inventory.html
@@ -122,11 +122,11 @@
{{:linkbutton
label="Mouvements"
- href="equipment_history.html?key=%s&prop=%s"|args:$key:$selected_prop
+ href="equipment_history.html?key=%s&prop=1"|args:$key
shape="table"}}
{{:linkbutton
label="Modifier"
- href="modify_equipment.html?key=%s&prop=%s"|args:$key:$selected_prop
+ href="modify_equipment.html?key=%s&prop=1"|args:$key
shape="edit"
target="_dialog"}}
|
diff --git a/_nav.html b/_nav.html
index e37bd3d..c615e3d 100644
--- a/_nav.html
+++ b/_nav.html
@@ -3,7 +3,7 @@
diff --git a/_temp_inventory.html b/_temp_inventory.html
new file mode 100644
index 0000000..df4f8aa
--- /dev/null
+++ b/_temp_inventory.html
@@ -0,0 +1,76 @@
+{{* -*- brindille -*- *}}
+
+{{*
+ inventaire des entrées/sorties des matériels temporaires
+*}}
+
+{{* Sélecteur catégories *}}
+{{:assign var="options." value="" label="Toutes les catégories" href="?prop=0"}}
+{{#load type="category" order="$$.name"}}
+ {{:assign var="categories.%s"|args:$key value=$name}}
+ {{:assign
+ var="options."
+ value=$key
+ label=$name
+ href="?cat_key=%s&prop=0"|args:$key
+ }}
+{{/load}}
+
+
+
+
+
+{{* 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}}
+
+{{#list
+ select="
+ $$.name AS 'Matériel' ;
+ (SELECT $$.name
+ FROM @TABLE as cat
+ WHERE cat.key = @TABLE.$$.category) AS 'Catégorie' ;
+ $$.notowned AS 'Quantité'
+ "
+ type="equipment"
+ where="$$.status <> 'archived' AND $$.notowned != 0 AND %s"|args:$condition
+ order=1
+ }}
+ {{:assign var=cat_name from=categories.%s|args:$category}}
+
+ | {{:link href="equipment_history.html?key=%s&prop=0"|args:$key" label=$name}} |
+ {{$cat_name}} |
+ {{$col3}} |
+
+ {{:linkbutton
+ label="Entrée"
+ shape="plus"
+ href="movements/input_equipment.html?key=%s"|args:$key
+ target="_dialog"}}
+ {{:linkbutton
+ label="Historique"
+ href="equipment_history.html?key=%s&prop=0"|args:$key
+ shape="table"}}
+ {{:linkbutton
+ label="Modifier"
+ href="modify_equipment.html?key=%s&prop=0"|args:$key
+ shape="edit"
+ target="_dialog"}}
+ |
+
+{{else}}
+ Aucun matériel.
+{{/list}}
diff --git a/equipment_history.html b/equipment_history.html
index ebd9370..5db0fb6 100644
--- a/equipment_history.html
+++ b/equipment_history.html
@@ -26,7 +26,11 @@
{{:admin_header title="Gestion des matériels" custom_css="./style.css" current="module_equipment"}}
{{* barre de navigation *}}
-{{:assign current=$_GET.current|or:"inventaire"}}
+{{if $_GET.current != null}}
+ {{:assign current=$_GET.current}}
+{{else}}
+ {{:assign current="inventaire"}}
+{{/if}}
{{* récupérer la config des entrées/sorties *}}
{{:include file="./_get_config.html" keep="config"}}
diff --git a/index.html b/index.html
index d2401c2..d05fab9 100644
--- a/index.html
+++ b/index.html
@@ -15,7 +15,7 @@
{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
{{#load type="category" count=true limit=1 assign="result"}}{{/load}}
- {{:include file="_nav.html" current="inventaire" cat="%d"|args:$result.count}}
+ {{:include file="_nav.html" current="inventaire" cat="%d"|args:$result.count subcurrent="stock"}}
{{if $_GET.ok}}
{{if $_GET.msg == "ajout" }}
diff --git a/module.ini b/module.ini
index 1fd0b2c..5415cfb 100644
--- a/module.ini
+++ b/module.ini
@@ -1,5 +1,5 @@
name="Gestion des matériels"
-description="Permet de gérer un inventaire de matériels, ainsi que de suivre les prêts.\nversion 0.71.1"
+description="Permet de gérer un inventaire de matériels, ainsi que de suivre les prêts."
author="Jean-Christophe Engel"
author_url="https://gitea.zaclys.com/lesanges"
home_button=true
diff --git a/movements/movement_details.html b/movements/movement_details.html
index 5135ec9..7011d81 100644
--- a/movements/movement_details.html
+++ b/movements/movement_details.html
@@ -68,7 +68,7 @@
Matériel
{{:link href="../equipment_history.html?key=%s&prop=%s"|args:$equipment.key:$_GET.prop label=$equipment.name}}
Catégorie
- {{:link href="../index.html?cat_key=%s&prop=%s"|args:$category.key:$_GET.prop label=$category.name}}
+ {{:link href="../index.html?cat_key=%s&prop=1"|args:$category.key label=$category.name}}
Date
{{$mvt.date|date_short}}
Quantité