From facbe5155f06408f8978d056fae25b255c647b14 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 19 Dec 2013 12:00:04 +0100 Subject: [PATCH] Bug 11386: standardize validation of the subscription add/edit form Use jQuery.validate plugin for subscription add/edit form and remove readonly attribute on date fields, as datepicker is not available for everyone. Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Works as described, passes tests, and QA script. Signed-off-by: Galen Charlton --- .../en/modules/serials/subscription-add.tt | 42 +++++++------------ 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt index f206802a1d..1402135e08 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt @@ -77,22 +77,10 @@ function Check_page2(){ return false; } [% END %] - if($("#frequency").val().length == 0){ - alert(_("You must choose a frequency")); - return false; - } - if($("input[name='startdate']").val().length == 0){ - alert(_("You must choose a start date")); - return false; - } if($("#sublength").val().length == 0 && $("input[name='enddate']").val().length == 0){ alert(_("You must choose a subscription length or an end date.")); return false; } - if($("#numberpattern").val().length == 0){ - alert(_("You must choose a numbering pattern")); - return false; - } if(advancedpatternlocked == 0){ alert(_("You have modified the advanced prediction pattern. Please save your work or cancel modifications.")); return false; @@ -109,7 +97,7 @@ function frequencyload(){ $.getJSON("subscription-frequency.pl",{"frequency_id":document.f.frequency.value,ajax:'true'}, function(freqdata){ globalfreqdata=freqdata; - if ( globalfreqdata.unit.length == 0 ) { + if ( globalfreqdata.unit && globalfreqdata.unit.length == 0 ) { var option = $("#subtype option[value='issues']"); $(option).attr('selected', 'selected'); $("#subtype option[value!='issues']").attr('disabled', 'disabled') @@ -473,7 +461,7 @@ $(document).ready(function() {

[% IF ( modify ) %] Modify subscription for [% bibliotitle |html %][% ELSE %]Add a new subscription[% END %] (1/2)

-
+ [% IF ( modify ) %] @@ -634,9 +622,9 @@ $(document).ready(function() { Serials planning
  1. - + [% UNLESS (more_than_one_serial) %] - + [% ELSE %] [% firstacquidate | $KohaDates %] @@ -645,12 +633,12 @@ $(document).ready(function() { [% IF (more_than_one_serial) %]
  2. - +
  3. [% END %]
  4. - - [% FOREACH frequency IN frequencies %] [% IF (frequency.selected) %] @@ -680,16 +668,16 @@ $(document).ready(function() {
  5. - - + +
  6. - +
  7. - - [% FOREACH numberpattern IN numberpatterns %] [% IF (numberpattern.selected) %] @@ -751,8 +739,8 @@ $(document).ready(function() {
  8. Show/Hide advanced pattern
-- 2.39.5