From a9bca0c4f8e6c133b086a720ac6a551823a1ba32 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 22 Jul 2016 14:48:36 -0400 Subject: [PATCH] Bug 16967: Remove the use of "onclick" from serial frequency and numbering management This patch removes instance of "onclick" from the templates for serial frequency and numbering management. Events are now defined in the JavaScript. To test, apply the patch and go to Serials -> Manage frequencies. - In the list of frequencies, click the "Delete" button for a frequency which is in use by at least one subscription. In the confirmation dialog, clicking the "Show subscriptions" link should display a list of titles. - Edit or create a frequency. - To test that the form submission validation is still working correctly, enter non-numeric data in the "issues per unit" field and submit the form. This should trigger an error. In Serials -> Manage numbering patterns: - In the list of numbering patterns, click the "Delete" button for a pattern which is in use by at least one subscription. In the confirmation dialog, clicking the "Show subscriptions" link should display a list of titles. - Edit or create a numbering pattern. - Confirm that the "Test pattern" button works correctly. Signed-off-by: Hector Castro Works as advertised Signed-off-by: Jonathan Druart --- .../prog/en/modules/serials/subscription-frequencies.tt | 15 +++++++++------ .../en/modules/serials/subscription-numberpatterns.tt | 11 +++++++++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-frequencies.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-frequencies.tt index 93631d2..4fc936b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-frequencies.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-frequencies.tt @@ -44,10 +44,6 @@ function check_form() { return false; } -function show_blocking_subs() { - $("#blocking_subs").show(); -} - $(document).ready(function() { $("#issuesperunit").change(function() { var value = $(this).val(); @@ -64,6 +60,13 @@ $(document).ready(function() { $(".delete_frequency").on("click",function(){ return confirmDelete(); }); + $("#add_frequency_form").on("submit",function(){ + return check_form(); + }); + $("#show_blocking_subs").on("click",function(e){ + e.preventDefault(); + $("#blocking_subs").show(); + }); }); //]]> @@ -99,7 +102,7 @@ $(document).ready(function() { [% ELSE %]

Edit frequency: [% description %]

[% END %] -
+ [% IF (modify) %] @@ -168,7 +171,7 @@ $(document).ready(function() { This frequency is still used by [% subscriptions.size %] subscription(s). Do you still want to delete it?

-

Show subscriptions

+

Show subscriptions