From d40c752671114b79d0e60fed8f2a8643c3b196b3 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Fri, 11 Jan 2008 01:32:09 -0600 Subject: [PATCH] category entry javascript fix Signed-off-by: Joshua Ferraro --- .../intranet-tmpl/prog/en/modules/admin/categorie.tmpl | 9 +++++---- members/memberentry.pl | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl index a62d1498d7..3bad64fa68 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl @@ -54,14 +54,15 @@ ok=1; _alertString += "- description missing\n"; } - if (!isNum(ff.upperagelimit,0)) { + if (!isNum(ff.upperagelimit,0) && ff.category_type.value=='C') { ok=1; - _alertString += "- upperagelimit is not a number\n"; + _alertString += "- upperagelimit is not a number\n"; + } if (ok) { // if there is a problem alert(_alertString); - return; + return false; } // if all is good ff.submit(); @@ -131,7 +132,7 @@ -
+
diff --git a/members/memberentry.pl b/members/memberentry.pl index 67a9ccf11f..f28583e94b 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -187,7 +187,7 @@ if ($op eq 'save' || $op eq 'insert'){ my $age = GetAge($newdata{dateofbirth}); my $borrowercategory=GetBorrowercategory($newdata{'categorycode'}); my ($low,$high) = ($borrowercategory->{'dateofbirthrequired'}, $borrowercategory->{'upperagelimit'}); - if (($age > $high) or ($age < $low)) { + if (($high && ($age > $high)) or ($age < $low)) { push @errors, 'ERROR_age_limitations'; $template->param('ERROR_age_limitations' => "$low to $high"); } -- 2.39.5