[Koha-patches] [PATCH] [SIGNED-OFF] bug 4929 - add validation to patron administration

Owen Leonard oleonard at myacpl.org
Fri Dec 31 15:18:55 CET 2010


From: Robin Sheat <robin at catalyst.net.nz>

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 <oleonard at myacpl.org>
---
 .../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 cabfbeb..100719a 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();
 	}
 	//]]>
-- 
1.7.3



More information about the Koha-patches mailing list