amélioration affichage erreur

This commit is contained in:
Jean-Christophe Engel 2025-04-21 11:26:50 +02:00
parent 99ed711eb7
commit 96251821da
2 changed files with 76 additions and 77 deletions

View File

@ -141,11 +141,10 @@
}} }}
{{if $erreur}} {{if $erreur}}
{{:assign var="mvt_label" from="%s_labels.%s"|args:$mvt_new.direction:$mvt_new.operation}} {{:assign var="mvt_label" from="%s_labels.%s"|args:$mvt_new.direction:$mvt_new.operation}}
<p class="block error"> {{:assign new_date=$mvt_new.date|date_short}}
Impossible d'enregistrer ce mouvement : « {{$mvt_label}} {{:error message="Impossible d'enregistrer ce mouvement : « %s de %s (qté : %s) à la date du %s »"|args:$mvt_label:$equipment.name:$mvt_new.amount:$new_date}}
de {{$equipment.name}} (qté : {{$mvt_new.amount}}) à la date du {{$mvt_new.date|date_short}} » {{/if}}
</p>
{{else}}
{{* calculer la nouvelle quantité du matériel *}} {{* calculer la nouvelle quantité du matériel *}}
{{if $mvt_new.direction == "input"}} {{if $mvt_new.direction == "input"}}
{{:assign var="type_mvt" from="config.input_nature.%s.type"|args:$_POST.operation}} {{:assign var="type_mvt" from="config.input_nature.%s.type"|args:$_POST.operation}}

View File

@ -21,7 +21,7 @@
{{* récupérer la config des entrées/sorties *}} {{* récupérer la config des entrées/sorties *}}
{{:include file="../_get_config.html" keep="config"}} {{:include file="../_get_config.html" keep="config"}}
{{* calculer la quantité sortie *}} {{* calculer la quantité sortie temporairement *}}
{{#foreach from=$config.output_nature key=key}} {{#foreach from=$config.output_nature key=key}}
{{if $type == "temporaire"}} {{if $type == "temporaire"}}
{{:assign var="temp_outputs." value=$key|quote_sql}} {{:assign var="temp_outputs." value=$key|quote_sql}}
@ -112,15 +112,16 @@
movements=$movements_new movements=$movements_new
}} }}
{{if $erreur}} {{if $erreur}}
<p class="block error">Impossible d'enregistrer ce mouvement. {{:assign message="Impossible d'enregistrer ce mouvement."}}
{{if $pb.mvt.key != $mvt_new.key}} {{if $pb.mvt.key != $mvt_new.key}}
{{:assign var="err_mvt_label" from="config.input_nature.%s.label"|args:$pb.mvt.operation}} {{:assign var="err_mvt_label" from="config.input_nature.%s.label"|args:$pb.mvt.operation}}
<br />Mouvement incompatible avec {{:assign date_pb=$pb.mvt.date|date_short}}
« {{$err_mvt_label}} » : « {{$equipment.name}} (qté : {{$pb.mvt.amount}}) {{:assign var=message2 value=" Mouvement incompatible avec « %s » : « %s (qté : %s) en date du %s »."|args:$err_mvt_label:$equipment.name:$pb.mvt.amount:$date_pb}}
en date du {{$pb.mvt.date|date_short}} ». {{:assign message=$message|cat:$message2}}
{{/if}} {{/if}}
</p> {{:error message=$message}}
{{else}} {{/if}}
{{* calculer la nouvelle quantité du matériel *}} {{* calculer la nouvelle quantité du matériel *}}
{{:assign var="type_mvt" from="config.input_nature.%s.type"|args:$_POST.operation}} {{:assign var="type_mvt" from="config.input_nature.%s.type"|args:$_POST.operation}}
{{:assign var="equipment.out" value="%d-%d"|math:$equipment.out:$_POST.amount|intval}} {{:assign var="equipment.out" value="%d-%d"|math:$equipment.out:$_POST.amount|intval}}
@ -165,7 +166,6 @@
{{else}} {{else}}
{{:redirect force="/admin/users/details.php?id=%s"|args:$_GET.user}} {{:redirect force="/admin/users/details.php?id=%s"|args:$_GET.user}}
{{/if}} {{/if}}
{{/if}}
{{/form}} {{/form}}
{{:admin_header title="Retour de matériel" custom_css="./../../style.css" current="module_equipment"}} {{:admin_header title="Retour de matériel" custom_css="./../../style.css" current="module_equipment"}}