Mutualisation E/S et petites simplifications
This commit is contained in:
parent
55e649ce0d
commit
262d1935ca
10 changed files with 126 additions and 193 deletions
|
|
@ -61,17 +61,16 @@
|
|||
{{/if}}
|
||||
|
||||
{{* 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"}}
|
||||
{{: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"}}
|
||||
{{:assign prop=0}}
|
||||
{{else}}
|
||||
{{:assign prop=1}}
|
||||
{{/if}}
|
||||
{{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"}}
|
||||
{{:assign prop=0}}
|
||||
{{else}}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
{{/load}}
|
||||
|
||||
{{* 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 *}}
|
||||
{{: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}}
|
||||
{{/load}}
|
||||
|
||||
{{if $mvt_new.direction == "input"}}
|
||||
{{* types d'entrées *}}
|
||||
{{#foreach from=$config.input_nature key=key}}
|
||||
{{:assign var="input_labels.%s"|args:$key value=$label}}
|
||||
{{#foreach from=$directions key="direction"}}
|
||||
{{:assign var="nature" from="config.%s_nature"|args:$direction}}
|
||||
{{#foreach from=$nature key="key"}}
|
||||
{{:assign var="%s_labels.%s"|args:$direction:$key value=$label}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
{{* types de sorties *}}
|
||||
{{#foreach from=$config.output_nature key=key}}
|
||||
{{:assign var="output_labels.%s"|args:$key value=$label}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{*
|
||||
-------------------- Traiter la saisie --------------------
|
||||
|
|
@ -53,17 +48,16 @@
|
|||
{{/if}}
|
||||
|
||||
{{* 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"}}
|
||||
{{: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"}}
|
||||
{{:assign prop=0}}
|
||||
{{else}}
|
||||
{{:assign prop=1}}
|
||||
{{/if}}
|
||||
{{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"}}
|
||||
{{:assign prop=0}}
|
||||
{{else}}
|
||||
|
|
|
|||
|
|
@ -6,18 +6,11 @@
|
|||
- 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"}}
|
||||
{{else}}
|
||||
{{:error message="Aucun mouvement avec la clé « %s »"|args:$_GET.key}}
|
||||
{{/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 *}}
|
||||
{{#load type="equipment" where="key = :key" :key=$mvt_suppr.equipment assign="equipment"}}
|
||||
{{else}}
|
||||
|
|
@ -28,7 +21,7 @@
|
|||
{{* récupérer la config des entrées/sorties *}}
|
||||
{{: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'}}
|
||||
{{:assign dispo=0}}
|
||||
{{:assign nonprop=0}}
|
||||
|
|
@ -121,6 +114,8 @@
|
|||
{{:admin_header title="Supprimer un mouvement" current="module_equipment"}}
|
||||
{{:form_errors}}
|
||||
|
||||
{{:assign var="date_suppr" value="%s"|args:$mvt_suppr.date|date_short}}
|
||||
|
||||
{{:delete_form
|
||||
legend="Supprimer ?"
|
||||
warning="Supprimer « %s (%d) en date du %s » ?"|args:$equipment.name:$mvt_suppr.amount:$date_suppr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue