Bugzilla – Attachment 165968 Details for
Bug 36246
Have a centralized method for submitting a form via a link
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36246: Add the confirmation text directly to the attribute
Bug-36246-Add-the-confirmation-text-directly-to-th.patch (text/plain), 3.12 KB, created by
Martin Renvoize (ashimema)
on 2024-05-01 13:22:56 UTC
(
hide
)
Description:
Bug 36246: Add the confirmation text directly to the attribute
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-05-01 13:22:56 UTC
Size:
3.12 KB
patch
obsolete
>From 6c6575f9577a4ed0ce6f4974f4b52cd5020e15ab Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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 <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > 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 d72da4fe9fa..7fbc3b995d8 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 %] > <td> >- <a class="btn btn-default btn-xs submit-form-link" href="#" data-adjustment_id="[% adjustment.adjustment_id | html %]" data-invoiceid="[% invoiceid | html %]" data-action="invoice.pl" data-method="post" data-op="cud-del_adj" data-confirmation="confirm_del_adj"> >+ <a class="btn btn-default btn-xs submit-form-link" href="#" data-adjustment_id="[% adjustment.adjustment_id | html %]" data-invoiceid="[% invoiceid | html %]" data-action="invoice.pl" data-method="post" data-op="cud-del_adj" data-confirmation-msg="[% t('Are you sure you want to delete this adjustment?') %]"> > <i class="fa fa-trash-can"></i> Delete</a> > </td> > [% END %] >@@ -538,7 +538,6 @@ > </span> <!-- /#all_fund_dropdown --> > > [% MACRO jsinclude BLOCK %] >- <script>var confirm_del_adj = _("Are you sure you want to delete this adjustment?");</script> > [% 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 5f2ff44eda3..05625b8d8b5 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.44.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36246
:
162835
|
163098
|
163517
|
164830
|
164831
|
164832
|
165967
| 165968 |
165969
|
165970
|
165971