Mutualisation E/S et petites simplifications
This commit is contained in:
parent
55e649ce0d
commit
262d1935ca
@ -9,28 +9,22 @@
|
|||||||
{{:read file="./defaut.json" assign="config_defaut"}}
|
{{:read file="./defaut.json" assign="config_defaut"}}
|
||||||
{{:assign config_defaut=$config_defaut|json_decode}}
|
{{:assign config_defaut=$config_defaut|json_decode}}
|
||||||
|
|
||||||
{{if $module.config.input_nature != null}}
|
{{:assign var="directions.input" value="entrée"}}
|
||||||
{{#foreach from=$module.config.input_nature item="elem"}}
|
{{:assign var="directions.output" value="sortie"}}
|
||||||
{{:assign var="item" label=$label type=$type}}
|
|
||||||
{{:assign var="config.input_nature.%s"|args:$key value=$item}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{else}}
|
|
||||||
{{* pas de config enregistrée : utiliser la config par défaut *}}
|
|
||||||
{{#foreach from=$config_defaut.inputs item="elem"}}
|
|
||||||
{{:assign var="item" label=$label type=$type}}
|
|
||||||
{{:assign var="config.input_nature.%s"|args:$key value=$item}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{if $module.config.output_nature != null}}
|
{{#foreach from=$directions key="direction"}}
|
||||||
{{#foreach from=$module.config.output_nature item="elem"}}
|
{{:assign var="nature" from="module.config.%s_nature"|args:$direction}}
|
||||||
{{:assign var="item" label=$label type=$type}}
|
{{if $nature != null}}
|
||||||
{{:assign var="config.output_nature.%s"|args:$key value=$item}}
|
{{#foreach from=$nature item="elem"}}
|
||||||
{{/foreach}}
|
{{:assign var="item" label=$label type=$type}}
|
||||||
{{else}}
|
{{:assign var="config.%s_nature.%s"|args:$direction:$key value=$item}}
|
||||||
{{* pas de config enregistrée : utiliser la config par défaut *}}
|
{{/foreach}}
|
||||||
{{#foreach from=$config_defaut.outputs item="elem"}}
|
{{else}}
|
||||||
{{:assign var="item" label=$label type=$type}}
|
{{* pas de config enregistrée : utiliser la config par défaut *}}
|
||||||
{{:assign var="config.output_nature.%s"|args:$key value=$item}}
|
{{:assign var="nature" from="config_defaut.%ss"|args:$direction}}
|
||||||
{{/foreach}}
|
{{#foreach from=$nature item="elem"}}
|
||||||
{{/if}}
|
{{:assign var="item" label=$label type=$type}}
|
||||||
|
{{:assign var="config.%s_nature.%s"|args:$direction:$key value=$item}}
|
||||||
|
{{/foreach}}
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
@ -10,9 +10,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* lecture config (défaut ou enregistrée) *}}
|
{{* lecture config (défaut ou enregistrée) *}}
|
||||||
{{:include file="./_get_config.html" keep="config"}}
|
{{:include file="./_get_config.html" keep="config, directions"}}
|
||||||
{{:assign var="directions.input" value="d'entrées"}}
|
|
||||||
{{:assign var="directions.output" value="de sorties"}}
|
|
||||||
|
|
||||||
{{#foreach from=$directions key="direction" item="item"}}
|
{{#foreach from=$directions key="direction" item="item"}}
|
||||||
|
|
||||||
@ -22,7 +20,7 @@
|
|||||||
{{:assign var="locked_%ss."|args:$direction value=$op_label}}
|
{{:assign var="locked_%ss."|args:$direction value=$op_label}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
<h2>Types {{$item}}</h2>
|
<h2>{{$item|ucfirst}}s</h2>
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
paramètres :
|
||||||
|
- dir : input ou output
|
||||||
|
*}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
{{if ! $dialog}}
|
{{if ! $dialog}}
|
||||||
{{:include file="../_nav.html" current="config" subcurrent="typesES"}}
|
{{:include file="../_nav.html" current="config" subcurrent="typesES"}}
|
||||||
@ -8,49 +13,35 @@
|
|||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
|
|
||||||
{{* lecture config (défaut ou enregistrée) *}}
|
{{* lecture config (défaut ou enregistrée) *}}
|
||||||
{{:include file="../_get_config.html" keep="config"}}
|
{{:include file="../_get_config.html" keep="config, directions"}}
|
||||||
|
|
||||||
{{#form on="save"}}
|
{{#form on="save"}}
|
||||||
{{* vérifier l'existence d'une entrée de même nom et générer le résultat *}}
|
{{* vérifier s'il existe un type de mouvement de même nom *}}
|
||||||
{{#foreach from=$config.input_nature key=key}}
|
{{#foreach from=$directions key="direction"}}
|
||||||
{{if $label|trim|tolower == $_POST.input_fields.label|trim|tolower}}
|
{{:assign var="nature" from="config.%s_nature"|args:$direction}}
|
||||||
{{:error message="Ce libellé d'entrée est déjà présent"}}
|
{{#foreach from=$nature key="key"}}
|
||||||
|
{{:assign var="fields" from="_POST.%s_fields"|args:$_GET.dir}}
|
||||||
|
{{if $label|trim|tolower == $fields.label|trim|tolower}}
|
||||||
|
{{:error message="Ce libellé est déjà présent"}}
|
||||||
|
{{/if}}
|
||||||
|
{{:assign var="%s_nature.key"|args:$direction value=$key}}
|
||||||
|
{{:assign var="%s_nature.label"|args:$direction value=$label}}
|
||||||
|
{{:assign var="%s_nature.type"|args:$direction value=$type}}
|
||||||
|
{{:assign var="%s_natures."|args:$direction from="%s_nature"|args:$direction}}
|
||||||
|
{{/foreach}}
|
||||||
|
|
||||||
|
{{* ajouter le nouveau type de mouvement *}}
|
||||||
|
{{if $_GET.dir == $direction}}
|
||||||
|
{{:assign var="newlabel" from="_POST.%s_fields.label|args:$direction}}
|
||||||
|
{{:assign newlabel=$newlabel|trim|tolower|ucfirst}}
|
||||||
|
{{:assign var="%s_nature.key"|args:$direction value=""|uuid}}
|
||||||
|
{{:assign var="%s_nature.label"|args:$direction value=$newlabel}}
|
||||||
|
{{:assign var="%s_nature.type"|args:$direction from="_POST.%s_fields.type"|args:$direction}}
|
||||||
|
{{:assign var="%s_natures."|args:$direction from="%s_nature"|args:$direction}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:assign var="input_nature.key" value=$key}}
|
|
||||||
{{:assign var="input_nature.label" value=$label}}
|
|
||||||
{{:assign var="input_nature.type" value=$type}}
|
|
||||||
{{:assign var="input_natures." from=input_nature}}
|
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
||||||
{{* ajouter la nouvelle entrée *}}
|
|
||||||
{{if $_GET.dir == 'input'}}
|
|
||||||
{{:assign input_label=$_POST.input_fields.label|trim|tolower|ucfirst}}
|
|
||||||
{{:assign var="input_nature.key" value=""|uuid}}
|
|
||||||
{{:assign var="input_nature.label" value=$_POST.input_fields.label|trim|tolower|ucfirst}}
|
|
||||||
{{:assign var="input_nature.type" value=$_POST.input_fields.type}}
|
|
||||||
{{:assign var="input_natures." from=input_nature}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* vérifier l'existence d'une sortie de même nom et générer le résultat *}}
|
|
||||||
{{#foreach from=$config.output_nature key=key}}
|
|
||||||
{{if $label|trim|tolower == $_POST.output_fields.label|trim|tolower}}
|
|
||||||
{{:error message="Ce libellé de sortie est déjà présent"}}
|
|
||||||
{{/if}}
|
|
||||||
{{:assign var="output_nature.key" value=$key}}
|
|
||||||
{{:assign var="output_nature.label" value=$label}}
|
|
||||||
{{:assign var="output_nature.type" value=$type}}
|
|
||||||
{{:assign var="output_natures." from=output_nature}}
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
||||||
{{* ajouter la nouvelle sortie *}}
|
|
||||||
{{if $_GET.dir == 'output'}}
|
|
||||||
{{:assign output_label=$_POST.output_fields.label|trim|tolower|ucfirst}}
|
|
||||||
{{:assign var="output_nature.key" value=""|uuid}}
|
|
||||||
{{:assign var="output_nature.label" value=$_POST.output_fields.label|trim|tolower|ucfirst}}
|
|
||||||
{{:assign var="output_nature.type" value=$_POST.output_fields.type}}
|
|
||||||
{{:assign var="output_natures." from=output_nature}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{:save
|
{{:save
|
||||||
key="config"
|
key="config"
|
||||||
validate_schema="../config.schema.json"
|
validate_schema="../config.schema.json"
|
||||||
|
@ -12,38 +12,25 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* lecture config (défaut ou enregistrée) *}}
|
{{* lecture config (défaut ou enregistrée) *}}
|
||||||
{{:include file="../_get_config.html" keep="config"}}
|
{{:include file="../_get_config.html" keep="config, directions"}}
|
||||||
|
|
||||||
{{#form on="save"}}
|
{{#form on="save"}}
|
||||||
{{:assign input_nature=null}}
|
{{#foreach from=$directions key="direction"}}
|
||||||
{{#foreach from=$config.input_nature key=key}}
|
{{:assign var="nature" from="config.%s_nature"|args:$direction}}
|
||||||
{{:assign var="input_nature.key" value=$key}}
|
{{#foreach from=$nature key="key"}}
|
||||||
{{if $_GET.dir == 'input'}}
|
{{:assign var="%s_nature.key"|args:$direction value=$key}}
|
||||||
{{if $key == $_GET.op_key}}
|
{{if $_GET.dir == $direction}}
|
||||||
{{:assign var="input_nature.label" value=$_POST.name|trim|tolower|ucfirst}}
|
{{if $key == $_GET.op_key}}
|
||||||
|
{{:assign var="%s_nature.label"|args:$direction value=$_POST.name|trim|tolower|ucfirst}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign var="%s_nature.label"|args:$direction value=$label}}
|
||||||
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign var="input_nature.label" value=$label}}
|
{{:assign var="%s_nature.label"|args:$direction value=$label}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
{{:assign var="%s_nature.type"|args:$direction value=$type}}
|
||||||
{{:assign var="input_nature.label" value=$label}}
|
{{:assign var="%s_natures."|args:$direction from="%s_nature"|args:$direction}}
|
||||||
{{/if}}
|
{{/foreach}}
|
||||||
{{:assign var="input_nature.type" value=$type}}
|
|
||||||
{{:assign var="input_natures." from=input_nature}}
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
||||||
{{#foreach from=$config.output_nature key=key}}
|
|
||||||
{{:assign var="output_nature.key" value=$key}}
|
|
||||||
{{if $_GET.dir == 'output'}}
|
|
||||||
{{if $key == $_GET.op_key}}
|
|
||||||
{{:assign var="output_nature.label" value=$_POST.name|trim|tolower|ucfirst}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign var="output_nature.label" value=$label}}
|
|
||||||
{{/if}}
|
|
||||||
{{else}}
|
|
||||||
{{:assign var="output_nature.label" value=$label}}
|
|
||||||
{{/if}}
|
|
||||||
{{:assign var="output_nature.type" value=$type}}
|
|
||||||
{{:assign var="output_natures." from=output_nature}}
|
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
||||||
{{:save
|
{{:save
|
||||||
|
@ -12,25 +12,19 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* lecture config (défaut ou enregistrée) *}}
|
{{* lecture config (défaut ou enregistrée) *}}
|
||||||
{{:include file="../_get_config.html" keep="config"}}
|
{{:include file="../_get_config.html" keep="config, directions"}}
|
||||||
|
|
||||||
{{#form on="delete"}}
|
{{#form on="delete"}}
|
||||||
{{#foreach from=$config.input_nature key=key}}
|
{{#foreach from=$directions key="direction"}}
|
||||||
{{if $_GET.dir == 'input' && $key != $_GET.op_key || $_GET.dir == 'output'}}
|
{{:assign var="nature" from="config.%s_nature"|args:$direction}}
|
||||||
{{:assign var="input_nature.key" value=$key}}
|
{{#foreach from=$nature key="key"}}
|
||||||
{{:assign var="input_nature.label" value=$label}}
|
{{if $_GET.dir == $direction && $key != $_GET.op_key || $_GET.dir != $direction}}
|
||||||
{{:assign var="input_nature.type" value=$type}}
|
{{:assign var="%s_nature.key"|args:$direction value=$key}}
|
||||||
{{:assign var="input_natures." from=input_nature}}
|
{{:assign var="%s_nature.label"|args:$direction value=$label}}
|
||||||
{{/if}}
|
{{:assign var="%s_nature.type"|args:$direction value=$type}}
|
||||||
{{/foreach}}
|
{{:assign var="%s_natures."|args:$direction from="%s_nature"|args:$direction}}
|
||||||
|
{{/if}}
|
||||||
{{#foreach from=$config.output_nature key=key}}
|
{{/foreach}}
|
||||||
{{if $_GET.dir == 'output' && $key != $_GET.op_key || $_GET.dir == 'input'}}
|
|
||||||
{{:assign var="output_nature.key" value=$key}}
|
|
||||||
{{:assign var="output_nature.label" value=$label}}
|
|
||||||
{{:assign var="output_nature.type" value=$type}}
|
|
||||||
{{:assign var="output_natures." from=output_nature}}
|
|
||||||
{{/if}}
|
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
||||||
{{:save
|
{{:save
|
||||||
@ -45,16 +39,11 @@
|
|||||||
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
|
{{:admin_header title="Gestion des matériels" current="module_equipment"}}
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
|
|
||||||
{{if $_GET.dir == 'input'}}
|
{{:assign var="mvt_label" from="config.%s_nature.%s.label"|args:$_GET.dir:$_GET.op_key}}
|
||||||
{{:delete_form
|
{{:assign var="dir_label" from="directions.%s"|args:$_GET.dir}}
|
||||||
legend="Supprimer cette entrée ?"
|
{{:delete_form
|
||||||
warning="Supprimer l'entrée « %s » ?"|args:$_GET.mvt
|
legend="Supprimer cette %s ?"|args:$dir_label
|
||||||
}}
|
warning="Supprimer « %s » ?"|args:$mvt_label
|
||||||
{{else}}
|
}}
|
||||||
{{:delete_form
|
|
||||||
legend="Supprimer cette sortie ?"
|
|
||||||
warning="Supprimer la sortie « %s » ?"|args:$_GET.mvt
|
|
||||||
}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
@ -30,28 +30,21 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{* types d'entrées et sorties *}}
|
{{* types d'entrées et sorties *}}
|
||||||
{{:include file="./_get_config.html" keep="config"}}
|
{{:include file="./_get_config.html" keep="config, directions"}}
|
||||||
|
|
||||||
{{#foreach from=$config.input_nature key=key}}
|
{{#foreach from=$directions key="direction"}}
|
||||||
{{:assign var="types.input.%s."|args:$type value=$key}}
|
{{:assign var="nature" from="config.%s_nature"|args:$direction}}
|
||||||
{{/foreach}}
|
{{#foreach from=$nature key="key"}}
|
||||||
|
{{:assign var="types.%s.%s."|args:$direction:$type value=$key}}
|
||||||
|
{{/foreach}}
|
||||||
|
|
||||||
{{#foreach from=$types.input key=key}}
|
{{:assign var="iotypes" from="types.%s"|args:$direction}}
|
||||||
{{:assign var=elem from="types.input.%s"|args:$key}}
|
{{#foreach from=$iotypes key="key"}}
|
||||||
{{:assign elem=$elem|quote_sql|implode:","}}
|
{{:assign var=elem from="iotypes.%s"|args:$key}}
|
||||||
{{:assign elem="("|cat:$elem|cat:")"}}
|
{{:assign elem=$elem|quote_sql|implode:","}}
|
||||||
{{:assign var="input_types.%s"|args:$key value=$elem}}
|
{{:assign elem="("|cat:$elem|cat:")"}}
|
||||||
{{/foreach}}
|
{{:assign var="%s_types.%s"|args:$direction:$key value=$elem}}
|
||||||
|
{{/foreach}}
|
||||||
{{#foreach from=$config.output_nature key=key}}
|
|
||||||
{{:assign var="types.output.%s."|args:$type value=$key}}
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
||||||
{{#foreach from=$types.output key=key}}
|
|
||||||
{{:assign var=elem from="types.output.%s"|args:$key}}
|
|
||||||
{{:assign elem=$elem|quote_sql|implode:","}}
|
|
||||||
{{:assign elem="("|cat:$elem|cat:")"}}
|
|
||||||
{{:assign var="output_types.%s"|args:$key value=$elem}}
|
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
||||||
{{* filtrer selon la catégorie *}}
|
{{* filtrer selon la catégorie *}}
|
||||||
|
@ -30,28 +30,21 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{* types d'entrées et sorties *}}
|
{{* types d'entrées et sorties *}}
|
||||||
{{:include file="./_get_config.html" keep="config"}}
|
{{:include file="./_get_config.html" keep="config, directions"}}
|
||||||
|
|
||||||
{{#foreach from=$config.input_nature key=key}}
|
{{#foreach from=$directions key="direction"}}
|
||||||
{{:assign var="types.input.%s."|args:$type value=$key}}
|
{{:assign var="nature" from="config.%s_nature"|args:$direction}}
|
||||||
{{/foreach}}
|
{{#foreach from=$nature key="key"}}
|
||||||
|
{{:assign var="types.%s.%s."|args:$direction:$type value=$key}}
|
||||||
|
{{/foreach}}
|
||||||
|
|
||||||
{{#foreach from=$types.input key=key}}
|
{{:assign var="iotypes" from="types.%s"|args:$direction}}
|
||||||
{{:assign var=elem from="types.input.%s"|args:$key}}
|
{{#foreach from=$iotypes key="key"}}
|
||||||
{{:assign elem=$elem|quote_sql|implode:","}}
|
{{:assign var=elem from="iotypes.%s"|args:$key}}
|
||||||
{{:assign elem="("|cat:$elem|cat:")"}}
|
{{:assign elem=$elem|quote_sql|implode:","}}
|
||||||
{{:assign var="input_types.%s"|args:$key value=$elem}}
|
{{:assign elem="("|cat:$elem|cat:")"}}
|
||||||
{{/foreach}}
|
{{:assign var="%s_types.%s"|args:$direction:$key value=$elem}}
|
||||||
|
{{/foreach}}
|
||||||
{{#foreach from=$config.output_nature key=key}}
|
|
||||||
{{:assign var="types.output.%s."|args:$type value=$key}}
|
|
||||||
{{/foreach}}
|
|
||||||
|
|
||||||
{{#foreach from=$types.output key=key}}
|
|
||||||
{{:assign var=elem from="types.output.%s"|args:$key}}
|
|
||||||
{{:assign elem=$elem|quote_sql|implode:","}}
|
|
||||||
{{:assign elem="("|cat:$elem|cat:")"}}
|
|
||||||
{{:assign var="output_types.%s"|args:$key value=$elem}}
|
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
||||||
{{* filtrer selon la catégorie *}}
|
{{* filtrer selon la catégorie *}}
|
||||||
@ -70,23 +63,23 @@
|
|||||||
WHERE cat.key = @TABLE.$$.category) AS 'Catégorie' ;
|
WHERE cat.key = @TABLE.$$.category) AS 'Catégorie' ;
|
||||||
(SELECT
|
(SELECT
|
||||||
SUM($$.amount)
|
SUM($$.amount)
|
||||||
FROM module_data_equipment AS mvt
|
FROM @TABLE AS mvt
|
||||||
WHERE
|
WHERE
|
||||||
$$.type = 'movement'
|
$$.type = 'movement'
|
||||||
AND
|
AND
|
||||||
$$.operation IN %s
|
$$.operation IN %s
|
||||||
AND
|
AND
|
||||||
$$.equipment = module_data_equipment.key
|
$$.equipment = @TABLE.key
|
||||||
) -
|
) -
|
||||||
(SELECT
|
(SELECT
|
||||||
COALESCE(SUM($$.amount), 0)
|
COALESCE(SUM($$.amount), 0)
|
||||||
FROM module_data_equipment AS mvt
|
FROM @TABLE AS mvt
|
||||||
WHERE
|
WHERE
|
||||||
$$.type = 'movement'
|
$$.type = 'movement'
|
||||||
AND
|
AND
|
||||||
$$.operation IN %s
|
$$.operation IN %s
|
||||||
AND
|
AND
|
||||||
$$.equipment = module_data_equipment.key
|
$$.equipment = @TABLE.key
|
||||||
) AS 'Quantité'
|
) AS 'Quantité'
|
||||||
"|args:$input_types.temporaire:$output_types.retour
|
"|args:$input_types.temporaire:$output_types.retour
|
||||||
type="equipment"
|
type="equipment"
|
||||||
|
@ -61,17 +61,16 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* préparer le mouvement copié *}}
|
{{* préparer le mouvement copié *}}
|
||||||
|
{{:assign var="mvt_new.operation" value=$_POST.operation}}
|
||||||
|
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$mvt_new.direction:$mvt_new.operation}}
|
||||||
|
|
||||||
{{if $mvt_new.direction == "input"}}
|
{{if $mvt_new.direction == "input"}}
|
||||||
{{:assign var="mvt_new.operation" value=$_POST.operation}}
|
|
||||||
{{:assign var="type_mvt" from="config.input_nature.%s.type"|args:$mvt_new.operation}}
|
|
||||||
{{if $type_mvt == "temporaire"}}
|
{{if $type_mvt == "temporaire"}}
|
||||||
{{:assign prop=0}}
|
{{:assign prop=0}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign prop=1}}
|
{{:assign prop=1}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign var="mvt_new.operation" value=$_POST.operation}}
|
|
||||||
{{:assign var="type_mvt" from="config.output_nature.%s.type"|args:$mvt_new.operation}}
|
|
||||||
{{if $type_mvt == "retour"}}
|
{{if $type_mvt == "retour"}}
|
||||||
{{:assign prop=0}}
|
{{:assign prop=0}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{* récupérer la config des entrées/sorties *}}
|
{{* récupérer la config des entrées/sorties *}}
|
||||||
{{:include file="../_get_config.html" keep="config"}}
|
{{:include file="../_get_config.html" keep="config, directions"}}
|
||||||
|
|
||||||
{{* infos pour affichage *}}
|
{{* infos pour affichage *}}
|
||||||
{{:assign var="op_label" from="config.%s_nature.%s.label"|args:$mvt_new.direction:$mvt_new.operation}}
|
{{:assign var="op_label" from="config.%s_nature.%s.label"|args:$mvt_new.direction:$mvt_new.operation}}
|
||||||
@ -27,17 +27,12 @@
|
|||||||
{{:error message="Aucun matériel avec la clé « %s »"|args:$eqpmt_key}}
|
{{:error message="Aucun matériel avec la clé « %s »"|args:$eqpmt_key}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{if $mvt_new.direction == "input"}}
|
{{#foreach from=$directions key="direction"}}
|
||||||
{{* types d'entrées *}}
|
{{:assign var="nature" from="config.%s_nature"|args:$direction}}
|
||||||
{{#foreach from=$config.input_nature key=key}}
|
{{#foreach from=$nature key="key"}}
|
||||||
{{:assign var="input_labels.%s"|args:$key value=$label}}
|
{{:assign var="%s_labels.%s"|args:$direction:$key value=$label}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{else}}
|
{{/foreach}}
|
||||||
{{* types de sorties *}}
|
|
||||||
{{#foreach from=$config.output_nature key=key}}
|
|
||||||
{{:assign var="output_labels.%s"|args:$key value=$label}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
-------------------- Traiter la saisie --------------------
|
-------------------- Traiter la saisie --------------------
|
||||||
@ -53,17 +48,16 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{* préparer le mouvement modifié *}}
|
{{* préparer le mouvement modifié *}}
|
||||||
|
{{:assign var="mvt_new.operation" value=$_POST.operation}}
|
||||||
|
{{:assign var="type_mvt" from="config.%s_nature.%s.type"|args:$mvt_new.direction:$mvt_new.operation}}
|
||||||
|
|
||||||
{{if $mvt_new.direction == "input"}}
|
{{if $mvt_new.direction == "input"}}
|
||||||
{{:assign var="mvt_new.operation" value=$_POST.operation}}
|
|
||||||
{{:assign var="type_mvt" from="config.input_nature.%s.type"|args:$mvt_new.operation}}
|
|
||||||
{{if $type_mvt == "temporaire"}}
|
{{if $type_mvt == "temporaire"}}
|
||||||
{{:assign prop=0}}
|
{{:assign prop=0}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign prop=1}}
|
{{:assign prop=1}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign var="mvt_new.operation" value=$_POST.operation}}
|
|
||||||
{{:assign var="type_mvt" from="config.output_nature.%s.type"|args:$mvt_new.operation}}
|
|
||||||
{{if $type_mvt == "retour"}}
|
{{if $type_mvt == "retour"}}
|
||||||
{{:assign prop=0}}
|
{{:assign prop=0}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -6,18 +6,11 @@
|
|||||||
- prop : = 1 si matériel propriété de l'asso
|
- prop : = 1 si matériel propriété de l'asso
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{:assign var="libelles.input" value="entrée"}}
|
|
||||||
{{:assign var="libelles.output" value="sortie"}}
|
|
||||||
|
|
||||||
{{#load key=$_GET.key assign="mvt_suppr"}}
|
{{#load key=$_GET.key assign="mvt_suppr"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:error message="Aucun mouvement avec la clé « %s »"|args:$_GET.key}}
|
{{:error message="Aucun mouvement avec la clé « %s »"|args:$_GET.key}}
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{:assign var="libelle" from="libelles.%s"|args:$mvt_suppr.direction}}
|
|
||||||
{{:assign key_eqpmt_suppr=$mvt_suppr.equipment}}
|
|
||||||
{{:assign var="date_suppr" value="%s"|args:$mvt_suppr.date|date_short}}
|
|
||||||
|
|
||||||
{{* trouver le matériel concerné par ce mouvement *}}
|
{{* trouver le matériel concerné par ce mouvement *}}
|
||||||
{{#load type="equipment" where="key = :key" :key=$mvt_suppr.equipment assign="equipment"}}
|
{{#load type="equipment" where="key = :key" :key=$mvt_suppr.equipment assign="equipment"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
@ -28,7 +21,7 @@
|
|||||||
{{* récupérer la config des entrées/sorties *}}
|
{{* récupérer la config des entrées/sorties *}}
|
||||||
{{:include file="../_get_config.html" keep="config"}}
|
{{:include file="../_get_config.html" keep="config"}}
|
||||||
|
|
||||||
{{* TODO vérifier s'il est possible de supprimer le mouvement *}}
|
{{* vérifier s'il est possible de supprimer le mouvement *}}
|
||||||
{{if $mvt_suppr.direction == 'input'}}
|
{{if $mvt_suppr.direction == 'input'}}
|
||||||
{{:assign dispo=0}}
|
{{:assign dispo=0}}
|
||||||
{{:assign nonprop=0}}
|
{{:assign nonprop=0}}
|
||||||
@ -121,6 +114,8 @@
|
|||||||
{{:admin_header title="Supprimer un mouvement" current="module_equipment"}}
|
{{:admin_header title="Supprimer un mouvement" current="module_equipment"}}
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
|
|
||||||
|
{{:assign var="date_suppr" value="%s"|args:$mvt_suppr.date|date_short}}
|
||||||
|
|
||||||
{{:delete_form
|
{{:delete_form
|
||||||
legend="Supprimer ?"
|
legend="Supprimer ?"
|
||||||
warning="Supprimer « %s (%d) en date du %s » ?"|args:$equipment.name:$mvt_suppr.amount:$date_suppr
|
warning="Supprimer « %s (%d) en date du %s » ?"|args:$equipment.name:$mvt_suppr.amount:$date_suppr
|
||||||
|
Loading…
Reference in New Issue
Block a user