début nouvelle config types ES
This commit is contained in:
parent
b6de0c59c0
commit
b19904b05b
10 changed files with 122 additions and 74 deletions
|
|
@ -9,9 +9,9 @@
|
|||
{{:include file="../_get_config.html" keep="config"}}
|
||||
|
||||
{{* types d'entrées *}}
|
||||
{{#foreach from=$config.input_nature key="label" item="type"}}
|
||||
{{#foreach from=$config.input_nature}} {{* key="label" item="type"*}}
|
||||
{{if $type != 'retour'}}
|
||||
{{:assign var='input_labels.' value="%s"|args:$label}}
|
||||
{{:assign var="input_labels.%s"|args:$key value="%s"|args:$label}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
|
||||
|
|
@ -62,13 +62,12 @@
|
|||
{{* Enregistrer le mouvement *}}
|
||||
{{:assign mvt_key=""|uuid}}
|
||||
{{:assign var="operation" from="input_labels.%d"|args:$_POST.type_operation}}
|
||||
|
||||
{{:save
|
||||
key=$mvt_key
|
||||
validate_schema="./movement.schema.json"
|
||||
type="movement"
|
||||
direction="input"
|
||||
input_nature=$operation
|
||||
operation=$_POST.operation
|
||||
amount=$_POST.quantite|intval
|
||||
equipment=$equipment_key
|
||||
date=$_POST.date|parse_date
|
||||
|
|
@ -95,7 +94,7 @@
|
|||
<fieldset class="entree">
|
||||
<legend>Ajouter une entrée de matériel</legend>
|
||||
<dl>
|
||||
{{:input type="select" name="type_operation" label="Type" required=true options=$input_labels}}
|
||||
{{:input type="select" name="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é" min=1 required=true default=1}}
|
||||
</dl>
|
||||
|
|
|
|||
|
|
@ -11,13 +11,9 @@
|
|||
"type": "string",
|
||||
"enum": ["input", "output"]
|
||||
},
|
||||
"input_nature": {
|
||||
"description": "Nature de l'entrée",
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"output_nature": {
|
||||
"description": "Nature de la sortie",
|
||||
"type": ["null", "string"]
|
||||
"operation": {
|
||||
"description": "clé de l'opération",
|
||||
"type": "string"
|
||||
},
|
||||
"amount": {
|
||||
"description": "Quantité ajoutée ou retirée",
|
||||
|
|
@ -38,5 +34,5 @@
|
|||
"type": ["null", "string"]
|
||||
}
|
||||
},
|
||||
"required": ["type", "direction", "amount", "equipment", "date", "comment"]
|
||||
"required": ["type", "direction", "operation", "amount", "equipment", "date", "comment"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue