From 8351d64e03be9b2952cb8fe1db0da497abbb9286 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 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 --- .../prog/en/modules/admin/smart-rules.tt | 23 ++++++++++++++++---- 1 file changed, 19 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 b8b9dfd..9d8af8f 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,22 @@ function clear_edit(){ $(edit_row).find("td:last input[name='clear']").remove(); } +var MSG_CONFIRM_UNSET = _("Are you sure you want to unset this rule?"); +var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this rule? This cannot be undone."); + +function confirmUnsetDel(message) { + return (confirm(message) ? true : false); +} + $(document).ready(function() { + $("#unset").on("click",function(){ + return confirmUnsetDel(MSG_CONFIRM_UNSET); + }); + + $(".delete").on("click",function(){ + return confirmUnsetDel(MSG_CONFIRM_DELETE); + }); + $('#cap_fine_to_replacement_price').on('change', function(){ $('#overduefinescap').prop('disabled', $(this).is(':checked') ); }); @@ -253,7 +268,7 @@ for="tobranch">Clone these rules to: Edit - Delete + Delete [% END %] @@ -438,7 +453,7 @@ for="tobranch">Clone these rules to: - Unset + Unset @@ -489,7 +504,7 @@ for="tobranch">Clone these rules to: - Delete + Delete [% END %] @@ -569,7 +584,7 @@ for="tobranch">Clone these rules to: - Delete + Delete [% END %] -- 1.7.10.4