From: Robin Sheat Date: Fri, 31 Dec 2010 14:18:55 +0000 (-0500) Subject: bug 4942 - add validation to patron administration X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=7d0212cf38b802d510aa03a705b19fb11060a537;p=koha.git 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 --- 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 cabfbebd28..100719a25a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl @@ -68,16 +68,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(); } //]]>