[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch master updated. f7edee62ba832ffd5cd3a8c1946dd6a10bf33d1c
Evergreen Git
git at git.evergreen-ils.org
Fri Oct 10 11:15:04 EDT 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via f7edee62ba832ffd5cd3a8c1946dd6a10bf33d1c (commit)
from 8f8e7895b4ffc8fc532a9024aa49944aa305c66a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f7edee62ba832ffd5cd3a8c1946dd6a10bf33d1c
Author: Ben Shum <bshum at biblio.org>
Date: Fri Sep 26 17:05:39 2014 -0400
LP#1306814: Make use of patron timeout setting for selfcheck
As described in the bug, the library setting "Self Check: Patron Login Timeout
(in seconds)" does not appear to work with the newer selfcheck interface.
It looks like some of it was already being pulled in, like the variable, but
the interface was not utilizing it.
This commit borrows from the old JS selfcheck and implements a default of
three minutes for selfcheck timeout otherwise handled by the library setting.
Signed-off-by: Ben Shum <bshum at biblio.org>
Signed-off-by: Michele Morgan <mmorgan at noblenet.org>
diff --git a/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js b/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
index f3950cf..303cbb9 100644
--- a/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
+++ b/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
@@ -14,6 +14,9 @@ dojo.require('openils.widget.OrgUnitFilteringSelect');
dojo.requireLocalization('openils.circ', 'selfcheck');
var localeStrings = dojo.i18n.getLocalization('openils.circ', 'selfcheck');
+// set patron timeout default
+var patronTimeout = 180000; /* 3 minutes */
+var timerId = null;
const SET_BARCODE_REGEX = 'opac.barcode_regex';
const SET_PATRON_TIMEOUT = 'circ.selfcheck.patron_login_timeout';
@@ -30,6 +33,22 @@ const SET_BLOCK_CHECKOUT_ON_COPY_STATUS = 'circ.selfcheck.block_checkout_on_copy
// set before the login dialog is rendered
openils.User.default_login_agent = 'selfcheck';
+// start the logout timer
+function selfckStartTimer() {
+ timerId = setTimeout(
+ function() {
+ SelfCheckManager.prototype.logoutPatron();
+ },
+ patronTimeout
+ );
+}
+
+// reset the logout timer
+function selfckResetTimer() {
+ clearTimeout(timerId);
+ selfckStartTimer();
+}
+
function SelfCheckManager() {
this.cgi = new openils.CGI();
@@ -275,6 +294,9 @@ SelfCheckManager.prototype.loadOrgSettings = function() {
if(settings[SET_BARCODE_REGEX])
this.patronBarcodeRegex = new RegExp(settings[SET_BARCODE_REGEX].value);
+
+ if(settings[SET_PATRON_TIMEOUT])
+ patronTimeout = parseInt(settings[SET_PATRON_TIMEOUT].value) * 1000;
}
SelfCheckManager.prototype.drawLoginPage = function() {
@@ -309,6 +331,9 @@ SelfCheckManager.prototype.drawLoginPage = function() {
*/
SelfCheckManager.prototype.loginPatron = function(barcode_or_usrname, passwd) {
+ // reset timeout
+ selfckResetTimer();
+
this.setupStaffLogin(true); // verify still valid
var barcode = null;
@@ -583,6 +608,9 @@ SelfCheckManager.prototype.goToTab = function(name) {
openils.Util.hide('oils-selfck-holds-page');
openils.Util.hide('oils-selfck-circ-page');
openils.Util.hide('oils-selfck-pay-fines-link');
+
+ // reset timeout
+ selfckResetTimer()
switch(name) {
case 'checkout':
@@ -605,6 +633,9 @@ SelfCheckManager.prototype.goToTab = function(name) {
SelfCheckManager.prototype.printList = function() {
+ // reset timeout
+ selfckResetTimer()
+
switch(this.tabName) {
case 'checkout':
this.printSessionReceipt();
-----------------------------------------------------------------------
Summary of changes:
.../web/js/ui/default/circ/selfcheck/selfcheck.js | 31 ++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list