From dee0ed4ede04cac2826353a8831c1719479a1415 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 20 Mar 2024 10:53:11 +0100 Subject: [PATCH] Bug 36246: Add the confirmation text directly to the attribute To avoid the eval and have all the values together. For discussion. Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt | 3 +-- koha-tmpl/intranet-tmpl/prog/js/form-submit.js | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt index d72da4fe9f..7fbc3b995d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt @@ -230,7 +230,7 @@ [% END # /IF adjustment.encumber_open %] [% UNLESS readonly %] - + Delete [% END %] @@ -538,7 +538,6 @@ [% MACRO jsinclude BLOCK %] - [% Asset.js("js/acquisitions-menu.js") | $raw %] [% Asset.js("js/form-submit.js") | $raw %] [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/form-submit.js b/koha-tmpl/intranet-tmpl/prog/js/form-submit.js index 5f2ff44eda..05625b8d8b 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/form-submit.js +++ b/koha-tmpl/intranet-tmpl/prog/js/form-submit.js @@ -4,11 +4,11 @@ $(document).ready(function(){ e.preventDefault(); let form_data = $(this).data(); - form_confirm = form_data.confirmation; + let confirm_msg = form_data.confirmationMsg; let confirmation = 1; - if( form_confirm ){ - delete form_data.confirmation; - confirmation = confirm( eval(form_confirm) ); + if( confirm_msg ){ + delete form_data.confirmationMsg; + confirmation = confirm( confirm_msg ); } if( !confirmation ){ return false } -- 2.39.5