From 79fdcc9855b40d0af38b2a169cf4fc4b968ee1a2 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 26 Apr 2016 13:00:42 -0400 Subject: [PATCH] Bug 16372 - Replace the use of "onclick" for deletion confirmation in some templates This patch removes the use of event attributes from several templates where the attributes were used to handle deletion operations. I've grouped these changes in one patch because each template had only small changes to be made. Unrelated change: Reformatted the "no news items" message which is displayed if there are no news items. To test, apply the patch and test deletion operations on the following pages. Clicking "delete" should prompty you to confirm. Test both the confirm and cancel actions. - On the staff client home page, test deletion of a news item. - On the patron lists page, test deletion of a patron list. - In the patron card creator, choose Manage -> Images. Test the "Delete" button for a single image. - On the news page, test deletion of a single news item. - On the news page, test deletion of multiple items. Signed-off-by: Arslan Farooq Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- .../prog/en/modules/intranet-main.tt | 7 ++++++- .../prog/en/modules/patron_lists/lists.tt | 11 ++++++----- .../prog/en/modules/patroncards/image-manage.tt | 6 ++++-- .../prog/en/modules/tools/koha-news.tt | 15 +++++++++------ 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt index 26d583cac6..b251d9b465 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -7,6 +7,11 @@ @@ -183,7 +188,7 @@ var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this news item? This

Posted on [% koha_new.newdate %][% IF( ( newsdisp == 'staff' || newsdisp == 'both' ) && koha_new.borrowernumber ) %] by [% koha_new.author_title %] [% koha_new.author_firstname %] [% koha_new.author_surname %]
[% END %] [% IF ( CAN_user_tools ) %] Edit - | Delete + | Delete | New [% END %]

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt index 3e4ba75239..8dd0b603e3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt @@ -15,11 +15,12 @@ ], "sPaginationType": "four_button" } )); + $(".delete_patron").on("click", function(){ + $(".dropdown").removeClass("open"); + var list = $(this).data("list-name"); + return confirmDelete( _("Are you sure you want to delete the list %s?").format(list) ); + }); }); - - function ConfirmDelete( list ) { - return confirm( _("Are you sure you want to delete the list %s?").format(list) ); - } //]]> @@ -67,7 +68,7 @@