bug 4942 - add validation to patron administration
authorRobin Sheat <robin@catalyst.net.nz>
Fri, 31 Dec 2010 14:18:55 +0000 (09:18 -0500)
committerChris Cormack <chrisc@catalyst.net.nz>
Sat, 1 Jan 2011 20:26:24 +0000 (09:26 +1300)
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@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl

index cabfbeb..100719a 100644 (file)
                        _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();
        }
        //]]>