LP#1528647 Self-check only accepts user name value if regex
authorBob Wicksall <bwicksall@pls-net.org>
Mon, 6 Jun 2016 17:35:28 +0000 (13:35 -0400)
committerKathy Lussier <klussier@masslnc.org>
Sat, 4 Mar 2017 12:14:28 +0000 (07:14 -0500)
for barcode not set up

This fix allows a patron to log into the self-check interface with either
a barcode or a user name.

Written by: Bob Wicksall <bwicksall@pls-net.org>

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js

index 3959fbc..9182e44 100644 (file)
@@ -331,8 +331,12 @@ SelfCheckManager.prototype.loadOrgSettings = function() {
             this.orgSettings[k] = settings[k].value;
     }
 
-    if(settings[SET_BARCODE_REGEX]) 
+    if(settings[SET_BARCODE_REGEX]) {
         this.patronBarcodeRegex = new RegExp(settings[SET_BARCODE_REGEX].value);
+    } else {
+        this.patronBarcodeRegex = new RegExp(/^\d/); 
+        // this assumes barcodes start with digits
+    }
 
     // Subtract the timeout warning interval from the configured timeout 
     // so that when taken together they add up to the configured amount.