From 819839fd9c24209ee4665f599db15621c51394cc Mon Sep 17 00:00:00 2001 From: Aleisha Date: Sun, 17 Apr 2016 22:35:19 +0000 Subject: [PATCH] Bug 16268: Add confirm message for deleting circ and fines rules MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit EDIT: Removes unnecessary code and uses confirm message in staff-global.js To test: 1) Apply 16267 2) Go to Admin -> Circ and fines rules 3) Try clicking on Delete and Unset buttons 4) Confirm a confirm message pops up and works as expected Sponsored-by: Catalyst IT Signed-off-by: Marc Véron Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- .../prog/en/modules/admin/smart-rules.tt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index 714212f8a9..bdac04be5d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -25,7 +25,13 @@ function clear_edit(){ $(edit_row).find("td:last input[name='clear']").remove(); } +var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this rule? This cannot be undone."); + $(document).ready(function() { + $(".delete").on("click",function(){ + return confirmDelete(MSG_CONFIRM_DELETE); + }); + $('#cap_fine_to_replacement_price').on('change', function(){ $('#overduefinescap').prop('disabled', $(this).is(':checked') ); }); @@ -260,7 +266,7 @@ for="tobranch">Clone these rules to: Edit - Delete + Delete [% END %] @@ -480,7 +486,7 @@ for="tobranch">Clone these rules to: - Unset + Unset @@ -531,7 +537,7 @@ for="tobranch">Clone these rules to: - Delete + Delete [% END %] @@ -620,7 +626,7 @@ for="tobranch">Clone these rules to: - Delete + Delete [% END %] -- 2.39.5