{{* -*- brindille -*- *}} {{* paramètres : - dir : input ou output - mvt : libellé du type de mouvement à modifier *}} {{:admin_header title="Gestion des matériels" current="module_equipment"}} {{* barre de navigation *}} {{if ! $dialog}} {{:include file="../_nav.html" current="config" subcurrent="typesES"}} {{/if}} {{* lecture config (défaut ou enregistrée) *}} {{:include file="../_get_config.html" keep="config"}} {{:debug config.input_nature=$config.input_nature config.input_nature=$config.input_nature}} {{:debug mvt=$_GET.mvt}} {{#form on="save"}} {{#foreach from=$config.input_nature key="label" item="type"}} {{:debug key=$label item=$type}} {{if $_GET.dir == 'input' && $label|trim|tolower == $_GET.mvt|trim|tolower}} {{:assign var="input_nature.label" value=$_POST.name|trim|tolower|ucfirst}} {{else} {{:assign var="input_nature.label" value=$label}} {{/if}} {{:assign var="input_nature.type" value=$type}} {{:assign var="input_natures." from=input_nature}} {{/foreach}} {{#foreach from=$config.output_nature key="label" item="type"}} {{if $_GET.dir == 'output' && $label|trim|tolower == $_GET.mvt|trim|tolower}} {{:assign var="output_nature.label" value=$_POST.name|trim|tolower|ucfirst}} {{else}} {{:assign var="output_nature.label" value=$label}} {{/if}} {{:assign var="output_nature.type" value=$type}} {{:assign var="output_natures." from=output_nature}} {{/foreach}} {{:debug input_natures=$input_natures output_natures=$output_natures}} {{* {{:save key="config" validate_schema="../config.schema.json" input_nature=$input_natures output_nature=$output_natures }} {{:redirect to="./config.html?ok=1"}} *}} {{/form}} {{:form_errors}}