[open-ils-commits] r15018 - in trunk/Open-ILS/web/js: dojo/openils/circ/nls ui/default/circ/selfcheck (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Nov 23 17:39:13 EST 2009
Author: erickson
Date: 2009-11-23 17:39:07 -0500 (Mon, 23 Nov 2009)
New Revision: 15018
Modified:
trunk/Open-ILS/web/js/dojo/openils/circ/nls/selfcheck.js
trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
Log:
added support for requiring workstation and patron password via org unit setting
Modified: trunk/Open-ILS/web/js/dojo/openils/circ/nls/selfcheck.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/circ/nls/selfcheck.js 2009-11-23 22:10:47 UTC (rev 15017)
+++ trunk/Open-ILS/web/js/dojo/openils/circ/nls/selfcheck.js 2009-11-23 22:39:07 UTC (rev 15018)
@@ -14,6 +14,7 @@
'LOGIN_FAILED' : 'Login for ${0} failed',
'UNKNOWN_ERROR' : 'An unhandled exception occurred with error code ${0}',
'MAX_RENEWALS' : 'No more renewals allowed for item ${0}',
- 'ITEM_NOT_CATALOGED' : 'Item ${0} was not found in the system. Try re-scanning the item.'
+ 'ITEM_NOT_CATALOGED' : 'Item ${0} was not found in the system. Try re-scanning the item.',
+ 'WORKSTATION_REQUIRED' : 'Workstation is required. Set the workstation name with URL param "ws"'
}
Modified: trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js 2009-11-23 22:10:47 UTC (rev 15017)
+++ trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js 2009-11-23 22:39:07 UTC (rev 15018)
@@ -16,6 +16,7 @@
const SET_AUTO_OVERRIDE_EVENTS = 'circ.selfcheck.auto_override_checkout_events';
const SET_PATRON_PASSWORD_REQUIRED = 'circ.selfcheck.patron_password_required';
const SET_AUTO_RENEW_INTERVAL = 'circ.checkout_auto_renew_age';
+const SET_WORKSTATION_REQUIRED = 'circ.selfcheck.workstation_required';
//openils.Util.playAudioUrl('/xul/server/skin/media/audio/bonus.wav');
@@ -71,6 +72,11 @@
this.authtoken = openils.User.authtoken;
this.loadOrgSettings();
+ // workstation is required but none provided
+ if(this.orgSettings[SET_WORKSTATION_REQUIRED] && !this.workstation) {
+ alert(dojo.string.substitute(localeStrings.WORKSTATION_REQUIRED));
+ return;
+ }
var self = this;
// connect onclick handlers to the various navigation links
@@ -111,6 +117,7 @@
SET_AUTO_OVERRIDE_EVENTS,
SET_PATRON_PASSWORD_REQUIRED,
SET_AUTO_RENEW_INTERVAL,
+ SET_WORKSTATION_REQUIRED
]
);
@@ -134,7 +141,8 @@
// password is required. wire up the scan box to read it
self.updateScanBox({
msg : 'Please enter your password', // TODO i18n
- handler : function(pw) { self.loginPatron(barcode, pw); }
+ handler : function(pw) { self.loginPatron(barcode, pw); },
+ password : true
});
} else {
@@ -155,6 +163,12 @@
SelfCheckManager.prototype.loginPatron = function(barcode, passwd) {
if(this.orgSettings[SET_PATRON_PASSWORD_REQUIRED]) {
+
+ if(!passwd) {
+ // would only happen in dev/debug mode when using the patron= param
+ alert('password required by org setting. remove patron= from URL');
+ return;
+ }
// patron password is required. Verify it.
@@ -165,7 +179,10 @@
if(res == 0) {
// user-not-found results in login failure
- this.handleXactResult('login', barcode, {textcode : 'ACTOR_USER_NOT_FOUND'});
+ dojo.byId('oils-selfck-status-div').innerHTML =
+ dojo.string.substitute(localeStrings.LOGIN_FAILED, [barcode]);
+ this.drawLoginPage();
+ return;
}
}
@@ -177,8 +194,11 @@
var evt = openils.Event.parse(this.patron);
if(evt) {
- this.handleXactResult('login', barcode, evt);
+ dojo.byId('oils-selfck-status-div').innerHTML =
+ dojo.string.substitute(localeStrings.LOGIN_FAILED, [barcode]);
+ this.drawLoginPage();
+
} else {
dojo.byId('oils-selfck-status-div').innerHTML = '';
@@ -203,6 +223,12 @@
selfckScanBox.attr('value', '');
}
+ if(args.password) {
+ selfckScanBox.domNode.setAttribute('type', 'password');
+ } else {
+ selfckScanBox.domNode.setAttribute('type', '');
+ }
+
if(args.value)
selfckScanBox.attr('value', args.value);
@@ -592,11 +618,6 @@
switch(result.textcode) {
- case 'ACTOR_USER_NOT_FOUND' :
- displayText = dojo.string.substitute(
- localeStrings.LOGIN_FAILED, [item]);
- break;
-
case 'MAX_RENEWALS_REACHED' :
displayText = dojo.string.substitute(
localeStrings.MAX_RENEWALS, [item]);
More information about the open-ils-commits
mailing list