réorganisation (cf remarques Bohwaz)
This commit is contained in:
parent
6006bdd169
commit
0e669a7c21
23 changed files with 279 additions and 236 deletions
36
config.html
36
config.html
|
|
@ -13,8 +13,8 @@
|
|||
|
||||
{{:save key="config"
|
||||
validate_schema="./config.schema.json"
|
||||
inputNature=$_POST.input_fields|array_transpose
|
||||
outputNature=$_POST.output_fields|array_transpose
|
||||
input_nature=$_POST.input_fields|array_transpose
|
||||
output_nature=$_POST.output_fields|array_transpose
|
||||
}}
|
||||
{{:redirect to="./config.html?ok=1"}}
|
||||
{{/form}}
|
||||
|
|
@ -24,16 +24,16 @@
|
|||
{{:assign config_defaut=$config_defaut|json_decode}}
|
||||
|
||||
{{* types d'entrées *}}
|
||||
{{#foreach from=$config_defaut.entrées item="elem"}}
|
||||
{{#foreach from=$config_defaut.inputs item="elem"}}
|
||||
{{#foreach from=$elem key=label item=value}}
|
||||
{{:assign var='types_entrees.%s'|args:$value value=$value}}
|
||||
{{:assign var='input_types.%s'|args:$value value=$value}}
|
||||
{{/foreach}}
|
||||
{{/foreach}}
|
||||
|
||||
{{* types de sorties *}}
|
||||
{{#foreach from=$config_defaut.sorties item="elem"}}
|
||||
{{#foreach from=$config_defaut.outputs item="elem"}}
|
||||
{{#foreach from=$elem key=label item=value}}
|
||||
{{:assign var='types_sorties.%s'|args:$value value=$value}}
|
||||
{{:assign var='output_typess.%s'|args:$value value=$value}}
|
||||
{{/foreach}}
|
||||
{{/foreach}}
|
||||
|
||||
|
|
@ -49,11 +49,11 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody id="input_body">
|
||||
{{#foreach from=$module.config.inputNature item="input_field"}}
|
||||
{{#foreach from=$module.config.input_nature item="input_field"}}
|
||||
|
||||
{{* Vérifier si la suppression de ce type d'entrée est possible *}}
|
||||
{{:assign suppr=true}}
|
||||
{{#load type="movement" where="$$.inputNature = :libelle" :libelle=$input_field.label}}
|
||||
{{#load type="movement" where="$$.input_nature = :libelle" :libelle=$input_field.label}}
|
||||
{{:assign suppr=false}}
|
||||
{{/load}}
|
||||
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
<td>{{:input type="text" name="input_fields[label][]" default=$input_field.label}}</td>
|
||||
<td>{{:input type="select"
|
||||
name="input_fields[type][]"
|
||||
options=$types_entrees
|
||||
options=$input_types
|
||||
default=$input_field.type
|
||||
required=true
|
||||
default_empty="— Choisir un type —"}}
|
||||
|
|
@ -76,12 +76,12 @@
|
|||
</tr>
|
||||
{{else}}
|
||||
{{* pas de config enregistrée : utiliser les valeurs par défaut *}}
|
||||
{{#foreach from=$config_defaut.entrées item="elem"}}
|
||||
{{#foreach from=$config_defaut.inputs item="elem"}}
|
||||
{{#foreach from=$elem key=label item=value}}
|
||||
|
||||
{{* Vérifier si la suppression de ce type d'entrée est possible *}}
|
||||
{{:assign suppr=true}}
|
||||
{{#load type="movement" where="$$.inputNature = :libelle" :libelle=$label}}
|
||||
{{#load type="movement" where="$$.input_nature = :libelle" :libelle=$label}}
|
||||
{{:assign suppr=false}}
|
||||
{{/load}}
|
||||
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
<td>{{:input
|
||||
type="select"
|
||||
name="input_fields[type][]"
|
||||
options=$types_entrees
|
||||
options=$input_types
|
||||
required=true
|
||||
default=$value
|
||||
default_empty="— Choisir un type —"}}
|
||||
|
|
@ -134,11 +134,11 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody id="output_body">
|
||||
{{#foreach from=$module.config.outputNature item="output_field"}}
|
||||
{{#foreach from=$module.config.output_nature item="output_field"}}
|
||||
|
||||
{{* Vérifier si la suppression de ce type de sortie est possible *}}
|
||||
{{:assign suppr=true}}
|
||||
{{#load type="movement" where="$$.outputNature = :libelle" :libelle=$output_field.label}}
|
||||
{{#load type="movement" where="$$.output_nature = :libelle" :libelle=$output_field.label}}
|
||||
{{:assign suppr=false}}
|
||||
{{/load}}
|
||||
|
||||
|
|
@ -147,7 +147,7 @@
|
|||
<td>{{:input
|
||||
type="select"
|
||||
name="output_fields[type][]"
|
||||
options=$types_sorties
|
||||
options=$output_typess
|
||||
default=$output_field.type
|
||||
required=true
|
||||
default_empty="— Choisir un type —"}}
|
||||
|
|
@ -162,12 +162,12 @@
|
|||
</tr>
|
||||
{{else}}
|
||||
{{* pas de config enregistrée : utiliser les valeurs par défaut *}}
|
||||
{{#foreach from=$config_defaut.sorties item="elem"}}
|
||||
{{#foreach from=$config_defaut.outputs item="elem"}}
|
||||
{{#foreach from=$elem key=label item=value}}
|
||||
|
||||
{{* Vérifier si la suppression de ce type de sortie est possible *}}
|
||||
{{:assign suppr=true}}
|
||||
{{#load type="movement" where="$$.inputNature = :libelle" :libelle=$label}}
|
||||
{{#load type="movement" where="$$.input_nature = :libelle" :libelle=$label}}
|
||||
{{:assign suppr=false}}
|
||||
{{/load}}
|
||||
|
||||
|
|
@ -176,7 +176,7 @@
|
|||
<td>{{:input
|
||||
type="select"
|
||||
name="output_fields[type][]"
|
||||
options=$types_sorties
|
||||
options=$output_typess
|
||||
required=true
|
||||
default=$value
|
||||
default_empty="— Choisir un type —"}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue