Compare commits
3 commits
3fd5d19279
...
3be1f40ffb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3be1f40ffb | ||
|
|
e3dc23d6d8 | ||
|
|
5eb21a3138 |
5 changed files with 16 additions and 105 deletions
|
|
@ -8,21 +8,22 @@
|
|||
{{* 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}}
|
||||
{{if $nature != null}}
|
||||
{{#foreach from=$nature item="elem"}}
|
||||
{{#foreach from=$nature item="elem"}}
|
||||
{{if ! $elem.key|in:$keys_defaut}}
|
||||
{{:assign var="config.%s_nature.%s"|args:$direction:$key value=$elem}}
|
||||
{{/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}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/foreach}}
|
||||
|
|
|
|||
|
|
@ -122,11 +122,11 @@
|
|||
<td class="actions">
|
||||
{{:linkbutton
|
||||
label="Mouvements"
|
||||
href="equipment_history.html?key=%s&prop=1"|args:$key
|
||||
href="equipment_history.html?key=%s&prop=%s"|args:$key:$selected_prop
|
||||
shape="table"}}
|
||||
{{:linkbutton
|
||||
label="Modifier"
|
||||
href="modify_equipment.html?key=%s&prop=1"|args:$key
|
||||
href="modify_equipment.html?key=%s&prop=%s"|args:$key:$selected_prop
|
||||
shape="edit"
|
||||
target="_dialog"}}
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -1,90 +0,0 @@
|
|||
{{* -*- 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"
|
||||
description="Permet de gérer un inventaire de matériels, ainsi que de suivre les prêts.\nversion 0.7"
|
||||
description="Permet de gérer un inventaire de matériels, ainsi que de suivre les prêts.\nversion 0.71
|
||||
author="Jean-Christophe Engel"
|
||||
author_url="https://gitea.zaclys.com/lesanges"
|
||||
home_button=true
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
<dt>Matériel</dt>
|
||||
<dd>{{:link href="../equipment_history.html?key=%s&prop=%s"|args:$equipment.key:$_GET.prop label=$equipment.name}}</dd>
|
||||
<dt>Catégorie</dt>
|
||||
<dd>{{:link href="../index.html?cat_key=%s&prop=1"|args:$category.key label=$category.name}}</dd>
|
||||
<dd>{{:link href="../index.html?cat_key=%s&prop=%s"|args:$category.key:$_GET.prop label=$category.name}}</dd>
|
||||
<dt>Date</dt>
|
||||
<dd>{{$mvt.date|date_short}}</dd>
|
||||
<dt>Quantité</dt>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue