don't allow inactive cards with web-selfcheck
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 20 Oct 2010 20:15:01 +0000 (20:15 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 20 Oct 2010 20:15:01 +0000 (20:15 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18423 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/extras/selfcheck/selfcheck.js

index d8ab3de..9b48c63 100644 (file)
@@ -224,6 +224,15 @@ function selfckPatronLogin(barcode) {
             $('selfck-patron-login-input').select();
             return;
         }
+        for (var i =0; i < patron.cards().length; i++) {
+            if (patron.cards()[i].barcode() == barcode) {
+                if (!isTrue(patron.cards()[i].active())) {
+                    unHideMe($('selfck-patron-not-found'));
+                    $('selfck-patron-login-input').select();
+                    return;
+                }
+            }
+        }
 
         $('selfck-patron-login-input').value = ''; // reset the input
         hideMe($('selfck-patron-login-container'));