From 358e6cd545ac3705d03cdeb1aacd0e534a7c3481 Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Fri, 31 Dec 2010 09:18:55 -0500 Subject: [PATCH] bug 4942 - 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. Signed-off-by: Owen Leonard Signed-off-by: Chris Cormack (cherry picked from commit 7d0212cf38b802d510aa03a705b19fb11060a537) Signed-off-by: Chris Nighswonger --- .../prog/en/modules/admin/categorie.tmpl | 12 ++++++++---- 1 file 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 1b108a71e1..575802e403 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(); } //]]> -- 2.39.5