From bea6f4b44984895fba5277c21e890d8d2af335ec Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Wed, 7 Jul 2010 16:41:50 +1200 Subject: [PATCH] bug 4929 - add validation to patron administration This validation requires an enrollment period or a date to be provided before the form will save, which will prevent invalid dates getting into the system. --- .../prog/en/modules/admin/categorie.tmpl | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 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 2c1f022..db66f34 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl @@ -60,16 +60,20 @@ _alertString += _("- upperagelimit is not a number") + "\n"; } + if(!(ff.enrolmentperioddate.value || ff.enrolmentperiod.value)) { + ok=1; + _alertString += _("- either Enrollment period or Until date must be provided") + "\n"; + } if(ff.enrolmentperioddate.value && ff.enrolmentperiod.value){ document.getElementById('enrolmentmessage').className = "error"; return false; } if (ok) { // if there is a problem - alert(_alertString); - return false; - } - // if all is good + alert(_alertString); + return false; + } + // if all is good ff.submit(); } //]]> -- 1.7.0.4