var currentItemsOut = [];
var readyHolds = false;
+// Rest on the Thank You page this many ms.
+var thankYouPageTimeout = 5000;
+
+// Ignore duplicate barcode scans that happen within this many ms.
+// Dupe scans that happen farther apart result in a patron warning.
+var dblScanWarnTimeout = 5000;
+
const SET_BARCODE_REGEX = 'opac.barcode_regex';
const SET_PATRON_TIMEOUT = 'circ.selfcheck.patron_login_timeout';
const SET_AUTO_OVERRIDE_EVENTS = 'circ.selfcheck.auto_override_checkout_events';
barcodesSeen[scannedBarcode] = barcode;
var selfckScanbox = document.getElementById('selfckScanBox');
if(barcodesSeen[scannedBarcode - 1] == barcode ){
- if(new Date().getTime() - timeScanned < 5000){
+ if(new Date().getTime() - timeScanned < dblScanWarnTimeout){
console.log("Date: " + new Date().getTime());
console.log("Time scanned: " + timeScanned);
console.log(new Date().getTime() - timeScanned);
/**
* Logout the patron and return to the login page
*/
-SelfCheckManager.prototype.logoutPatronWithEmail = function(email) {
- var return_url = this.cgi.param('return-to') || location.href;
- if(email && this.checkouts.length) {
- this.emailSessionReceipt(
- function() {
- location.href = return_url;
- }
- );
- } else {
- location.href = return_url;
- }
-}
-
-/**
- * Logout the patron and return to the login page
- */
SelfCheckManager.prototype.logoutPatron = function(print, email) {
-
var scannedBarcode = 0;
if(print && this.checkouts.length) {
progressDialog.show(true); // prevent patron from clicking logout link twice
- this.printSessionReceipt(
- function() {
- openils.Util.show('step4');
- switchTo('step4');
- this.processLogout();
- //location.href = return_url;
- }
- );
+ this.printSessionReceipt(selfCheckManager.processLogout);
+
} else if(email && this.checkouts.length) {
- this.emailSessionReceipt(
- function() {
- openils.Util.show('step4');
- switchTo('step4');
- this.processLogout();
- //location.href = return_url;
- }
- );
+ this.emailSessionReceipt(selfCheckManager.processLogout);
+
} else {
- openils.Util.show('step4');
- switchTo('step4');
- this.processLogout();
- //location.href = return_url;
+ selfCheckManager.processLogout();
}
}
SelfCheckManager.prototype.processLogout = function() {
var return_url = this.cgi.param('return-to') || location.href;
+ // Display the Thank-You page
+ openils.Util.show('step4');
+ switchTo('step4');
+
+ // NOTE: The variable resets below are likely not necessary, since
+ // the page reloads after a few seconds. Leaving for now in case
+ // there's something I'm missing.
+
this.timer = null;
this.cgi = new openils.CGI();
this.staff = null;
// dict of org unit settings for "here"
this.orgSettings = {};
- setTimeout(function() {location.href = return_url;}, 5000);
+ setTimeout(function() {location.href = return_url;}, thankYouPageTimeout);
}
//TODO: Remove
} else {
currentStyle.setAttribute('href', sheet2);
}
-}
\ No newline at end of file
+}
+
+