From f6dda6002d658a71ade7b9192006937d50aed8f9 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 11 May 2016 08:56:15 -0400 Subject: [PATCH] Bug 16602 - Remove the use of "onclick" from several templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch removes the use of "onclick" from several templates, instead defining click events in JavaScript. Also changed: Some markup corrections. To test, apply the patch and: - Go to Circulation -> Upload offline circulation file - Browse for an offline circulation file. - Clicking the 'Upload file' button should work correctly. - After uploading a file, both the 'Add to offline circulation queue' and 'Apply directly' buttons should work to trigger their corresponding processes (keeping Bug 16603 in mind). - Go to Patrons -> Patron lists. - For any patron list containing patrons, click the 'Print patron cards' menu item. This should trigger a modal window which exports the correct list. - Go to Tools -> Batch item modification. - Submit a batch of items for modification. - Clicking the 'Save' button should trigger the background job and the items should be successfully modified. - Go to Tools -> Batch item deletion. - Submit a batch of items for deletion. - Clicking the 'Delete' button should trigger the background job and the items should be successfully deleted. - Go to Tools -> Calendar. - Trigger the 'Add new holiday' panel by clicking a day on the calendar which has no holiday defined. - Clicking the 'Cancel' link should hide the panel. - Trigger the 'Edit this holiday' panel by clicking a day which has a holiday defined. - Clicking the 'Cancel' link should hide the panel. Signed-off-by: Frédéric Demians Everything works as previously. Signed-off-by: Jonathan Druart --- .../prog/en/modules/offline_circ/process_koc.tt | 19 ++++++++++++++++--- .../prog/en/modules/patron_lists/lists.tt | 11 ++++++++--- .../prog/en/modules/tools/batchMod-del.tt | 9 +++++++-- .../prog/en/modules/tools/batchMod-edit.tt | 8 +++++--- .../intranet-tmpl/prog/en/modules/tools/holidays.tt | 13 ++++++++++--- 5 files changed, 46 insertions(+), 14 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt index 6fdf5ce..a126288 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt @@ -10,6 +10,17 @@ var xhr; $(document).ready(function(){ $("#enqueuefile").hide(); $("#processfile").hide(); + $("#upload_file").on("click",function(){ + StartUpload(); + }); + $("#queueformsubmit").on("click",function(){ + var processfile = document.getElementById("processfile"); + return CheckForm( processfile ); + }); + $("#mainformsubmit").on("click",function(){ + var enqueuefile = document.getElementById("enqueuefile"); + return CheckForm( enqueuefile ); + }); }); function StartUpload() { @@ -89,11 +100,13 @@ function CheckForm(f) {

Upload offline circulation data

-
+
  1. -
-
+ + Required + +
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 8dd0b60..f8c0a03 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 @@ -20,6 +20,11 @@ var list = $(this).data("list-name"); return confirmDelete( _("Are you sure you want to delete the list %s?").format(list) ); }); + $(".print_cards").on("click",function(e){ + e.preventDefault(); + var patron_list_id = $(this).data("patron_list_id"); + GB_showCenter(_("Print patron cards from list"), "/cgi-bin/koha/patroncards/print.pl?patronlist_id=" + patron_list_id, 400, 800); + }); }); //]]> @@ -71,18 +76,18 @@
  • Delete list
  • [% IF ( l.patron_list_patrons_rs.count ) %]
  • -
  • Print patron cards
  • +
  • Print patron cards
  • [% IF CAN_user_tools_edit_patrons %]
  • - Batch edit patrons + Batch edit patrons
  • [% END %] [% IF CAN_user_tools_delete_anonymize_patrons %]
  • - Batch delete patrons + Batch delete patrons
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt index c813469..e339e3a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt @@ -15,6 +15,11 @@ var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% for( x=0; x