From 9707a439cbf152752f9f39ebee17c6976f6f7dc6 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
Signed-off-by: Kyle M Hall
---
.../modules/serials/subscription-frequencies.tt | 15 +++++++++------
.../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 93631d2600..4fc936bc2f 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 %]
-
- Show subscriptions
+ Show subscriptions