Simplification calcul dispo et config par défaut
This commit is contained in:
parent
d7f7ec9423
commit
af9dbf2b22
14 changed files with 260 additions and 304 deletions
|
|
@ -10,21 +10,22 @@
|
|||
{{:include file="../../_get_config.html" keep="config"}}
|
||||
|
||||
{{* types d'entrées *}}
|
||||
{{#foreach from=$config.input_nature item="elem"}}
|
||||
{{if $elem.type != 'retour'}}
|
||||
{{:assign var='input_types.' value="%s"|args:$elem.label}}
|
||||
{{#foreach from=$config.input_nature key="label" item="type"}}
|
||||
{{if $type != 'retour'}}
|
||||
{{:assign var='input_labels.' value="%s"|args:$label}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
{{* Traiter l'envoi du formulaire *}}
|
||||
{{#form on="save"}}
|
||||
|
||||
{{* récupérer les infos du matériel *}}
|
||||
{{#load type="equipment" key=$_POST.equipment assign="equipment"}}
|
||||
{{/load}}
|
||||
|
||||
{{* Enregistrer le mouvement *}}
|
||||
{{:assign mvt_key=""|uuid}}
|
||||
{{:assign var="operation" from="input_types.%d|args:$_POST.type_operation}}
|
||||
{{:assign var="operation" from="input_labels.%d|args:$_POST.type_operation}}
|
||||
|
||||
{{:save
|
||||
key=$mvt_key
|
||||
|
|
@ -60,7 +61,7 @@
|
|||
<fieldset class="entree">
|
||||
<legend>Ajouter une entrée d'un matériel répertorié</legend>
|
||||
<dl>
|
||||
{{:input type="select" name="type_operation" label="Type" required=true options=$input_types}}
|
||||
{{:input type="select" name="type_operation" label="Type" required=true options=$input_labels}}
|
||||
{{:input type="date" name="date" label="Date" required=true default=$now|date_short}}
|
||||
{{:input type="number" name="quantite" label="Quantité" required=true default=1}}
|
||||
</dl>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue