From 46e05cb3ba617f7829338bf6a40788890d357841 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 19 Dec 2013 12:00:04 +0100 Subject: [PATCH] [SIGNED-OFF] Bug 11386 - Mandatory fields in subscription add form should use standard formatting Content-Type: text/plain; charset="utf-8" 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 --- .../prog/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 f206802..1402135 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
-- 1.7.9.5