Compare commits
No commits in common. "3be1f40ffb7aec83b9b41e739252fd4fa7f97c1f" and "3fd5d1927907fe74f56e15d2e2a2dfc653ed4469" have entirely different histories.
3be1f40ffb
...
3fd5d19279
5 changed files with 105 additions and 16 deletions
|
|
@ -8,22 +8,21 @@
|
||||||
{{* config par défaut *}}
|
{{* config par défaut *}}
|
||||||
{{:read file="./default.json" assign="config_defaut"}}
|
{{:read file="./default.json" assign="config_defaut"}}
|
||||||
{{:assign config_defaut=$config_defaut|json_decode}}
|
{{:assign config_defaut=$config_defaut|json_decode}}
|
||||||
|
|
||||||
{{:assign var="directions.input" value="entrée"}}
|
{{:assign var="directions.input" value="entrée"}}
|
||||||
{{:assign var="directions.output" value="sortie"}}
|
{{:assign var="directions.output" value="sortie"}}
|
||||||
|
|
||||||
{{#foreach from=$directions key="direction"}}
|
{{#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}}
|
{{:assign var="nature" from="module.config.%s_nature"|args:$direction}}
|
||||||
{{#foreach from=$nature item="elem"}}
|
{{if $nature != null}}
|
||||||
{{if ! $elem.key|in:$keys_defaut}}
|
{{#foreach from=$nature item="elem"}}
|
||||||
{{:assign var="config.%s_nature.%s"|args:$direction:$key value=$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}}
|
{{/foreach}}
|
||||||
|
|
|
||||||
|
|
@ -122,11 +122,11 @@
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Mouvements"
|
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"}}
|
shape="table"}}
|
||||||
{{:linkbutton
|
{{:linkbutton
|
||||||
label="Modifier"
|
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"
|
shape="edit"
|
||||||
target="_dialog"}}
|
target="_dialog"}}
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
90
_temp_inventory.html
Normal file
90
_temp_inventory.html
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
inventaire des entrées/sorties des matériels temporaires
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{* filtrer selon la catégorie *}}
|
||||||
|
{{if $_GET.cat_key == null}}
|
||||||
|
{{:assign selected_category=$module.config.temp_cat_key}}
|
||||||
|
{{if $module.config.temp_cat_key != null}}
|
||||||
|
{{:assign cat_key=$selected_category|quote_sql}}
|
||||||
|
{{/if}}
|
||||||
|
{{elseif $_GET.cat_key == -1}}
|
||||||
|
{{:assign selected_category=null}}
|
||||||
|
{{:save key="config" temp_cat_key=null}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign selected_category=$_GET.cat_key}}
|
||||||
|
{{:assign cat_key=$selected_category|quote_sql}}
|
||||||
|
{{:save key="config" temp_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}}
|
||||||
|
|
||||||
|
{{* Sélecteur catégories *}}
|
||||||
|
{{:assign var="cat_options." value="" label="Toutes les catégories" href="?cat_key=-1&prop=0"}}
|
||||||
|
{{#load type="category" order="$$.name"}}
|
||||||
|
{{:assign var="categories.%s"|args:$key value=$name}}
|
||||||
|
{{:assign
|
||||||
|
var="cat_options."
|
||||||
|
value=$key
|
||||||
|
label=$name
|
||||||
|
href="?cat_key=%s&prop=0"|args:$key
|
||||||
|
}}
|
||||||
|
{{/load}}
|
||||||
|
|
||||||
|
<fieldset class="shortFormRight">
|
||||||
|
<legend>Filtrer par catégorie</legend>
|
||||||
|
{{:dropdown
|
||||||
|
title="Filtrer par catégorie"
|
||||||
|
options=$cat_options
|
||||||
|
value="%s"|args:$selected_category
|
||||||
|
}}
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<div class="shortFormLeft">
|
||||||
|
<p class="help">Inventaire des matériels empruntés ou loués</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{#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:$cat_condition
|
||||||
|
order=1
|
||||||
|
}}
|
||||||
|
{{:assign var=cat_name from=categories.%s|args:$category}}
|
||||||
|
<tr>
|
||||||
|
<td>{{:link href="equipment_history.html?key=%s&prop=0"|args:$key" label=$name}}</td>
|
||||||
|
<td>{{$cat_name}}</td>
|
||||||
|
<td class="num">{{$col3}}</td>
|
||||||
|
<td class="actions">
|
||||||
|
{{: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"}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{else}}
|
||||||
|
<p class="block alert">Aucun matériel.</p>
|
||||||
|
{{/list}}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
name="Gestion des matériels"
|
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
|
description="Permet de gérer un inventaire de matériels, ainsi que de suivre les prêts.\nversion 0.7"
|
||||||
author="Jean-Christophe Engel"
|
author="Jean-Christophe Engel"
|
||||||
author_url="https://gitea.zaclys.com/lesanges"
|
author_url="https://gitea.zaclys.com/lesanges"
|
||||||
home_button=true
|
home_button=true
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
<dt>Matériel</dt>
|
<dt>Matériel</dt>
|
||||||
<dd>{{:link href="../equipment_history.html?key=%s&prop=%s"|args:$equipment.key:$_GET.prop label=$equipment.name}}</dd>
|
<dd>{{:link href="../equipment_history.html?key=%s&prop=%s"|args:$equipment.key:$_GET.prop label=$equipment.name}}</dd>
|
||||||
<dt>Catégorie</dt>
|
<dt>Catégorie</dt>
|
||||||
<dd>{{:link href="../index.html?cat_key=%s&prop=%s"|args:$category.key:$_GET.prop label=$category.name}}</dd>
|
<dd>{{:link href="../index.html?cat_key=%s&prop=1"|args:$category.key label=$category.name}}</dd>
|
||||||
<dt>Date</dt>
|
<dt>Date</dt>
|
||||||
<dd>{{$mvt.date|date_short}}</dd>
|
<dd>{{$mvt.date|date_short}}</dd>
|
||||||
<dt>Quantité</dt>
|
<dt>Quantité</dt>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue