diff --git a/config.html b/config.html
index f5bb3ec..f4bab4a 100644
--- a/config.html
+++ b/config.html
@@ -11,7 +11,7 @@
Configuration enregistrée.
{{/if}}
-{{* lecture config (défaut ou enregistrée) *}}
+{{* lecture config *}}
{{:include file="./_get_config.html" keep="config_defaut, config, directions"}}
{{* interdire la modification et la suppression des types de mouvement prédéfinis *}}
@@ -41,6 +41,13 @@
{{:assign var="nature" from="config.%s_nature"|args:$direction}}
{{#foreach from=$nature key=key}}
+ {{:assign sortie_temp=false}}
+ {{if $direction == 'output'}}
+ {{:assign var="type" from="nature.%s.type"|args:$key}}
+ {{if $type == 'temporaire'}}
+ {{:assign sortie_temp=true}}
+ {{/if}}
+ {{/if}}
| {{$label}} |
{{$type}} |
@@ -48,7 +55,7 @@
{{if ! $default_keys|has:$key && ! $locked|has:$key}}
{{:linkbutton label="Supprimer" shape="delete" href="config/delete_movement_type.html?dir=%s&op_key=%s"|args:$direction:$key target="_dialog"}}
{{/if}}
- {{if ! $default_keys|has:$key}}
+ {{if ! $default_keys|has:$key || $sortie_temp}}
{{:linkbutton label="Modifier" shape="edit" href="config/modify_movement_type.html?dir=%s&op_key=%s"|args:$direction:$key target="_dialog"}}
{{/if}}
diff --git a/config/misc.html b/config/misc.html
index f58c655..ba11eec 100644
--- a/config/misc.html
+++ b/config/misc.html
@@ -2,57 +2,35 @@
{{#restrict block=true section="accounting" level="write"}}{{/restrict}}
-{{* lecture config (défaut ou enregistrée) *}}
-{{:include file="../_get_config.html" keep="loan_duration"}}
-
{{#form on="save"}}
- {{* vérifier si les boutons ont été cochés *}}
- {{#foreach from=$module.config.output_nature item="elem"}}
- {{if $elem.type == 'temporaire'}}
- {{if $_POST|has_key:$elem.key}}
- {{:assign var="fee" from="_POST.%s"|args:$elem.key}}
- {{:assign var="elem" key=$elem.key label=$elem.label type=$elem.type fee=$fee}}
- {{else}}
- {{:error message="Vous n'avez pas fait de choix pour la sortie « %s »"|args:$elem.label}}
- {{/if}}
- {{/if}}
- {{:assign var="output_nature." value=$elem}}
- {{/foreach}}
+ {{* vérifier la valisité de la durée saisie *}}
+ {{if $_POST.loan_duration <= 0}}
+ {{:error message="Durée (%s) erronée ; doit être > 0"|args:$_POST.loan_duration}}
+ {{/if}}
{{:save
key="config"
- output_nature=$output_nature
loan_duration=$_POST.loan_duration
}}
{{/form}}
-{{:include file="../_nav.html" current="config" subcurrent="divers"}}
{{:admin_header title="Configuration" current="module_equipment"}}
+{{:include file="../_nav.html" current="config" subcurrent="divers"}}
{{:form_errors}}
{{if $_GET.ok}}
Configuration enregistrée.
{{/if}}
+{{* lecture config *}}
+{{:include file="../_get_config.html" keep="loan_duration"}}
+