[open-ils-commits] r10606 - in trunk/Open-ILS/web/opac: common/js
extras/selfcheck
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Sep 16 17:18:39 EDT 2008
Author: erickson
Date: 2008-09-16 17:18:34 -0400 (Tue, 16 Sep 2008)
New Revision: 10606
Modified:
trunk/Open-ILS/web/opac/common/js/org_utils.js
trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.css
trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.js
trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml
Log:
added batch org unit settings fetcher. added org setting to turn on popup alerts for selfcheck non-success events. made the dfeault print settimeout longer to accomodate larger documents, but it now displays a screen to indicate it is printing
Modified: trunk/Open-ILS/web/opac/common/js/org_utils.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/org_utils.js 2008-09-16 21:08:50 UTC (rev 10605)
+++ trunk/Open-ILS/web/opac/common/js/org_utils.js 2008-09-16 21:18:34 UTC (rev 10606)
@@ -9,6 +9,17 @@
return (res) ? res.value : null;
}
+function fetchBatchOrgSetting(orgId, nameList, onload) {
+ var req = new Request(
+ 'open-ils.actor:open-ils.actor.ou_setting.ancestor_default.batch', orgId, nameList);
+ if(onload) {
+ req.callback(function(r) { onload(r.getResultObject()); });
+ req.send();
+ } else {
+ req.send(true);
+ return req.result();
+ }
+}
/* takes an org unit or id and return the numeric depth */
Modified: trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.css
===================================================================
--- trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.css 2008-09-16 21:08:50 UTC (rev 10605)
+++ trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.css 2008-09-16 21:18:34 UTC (rev 10606)
@@ -92,4 +92,11 @@
font-weight: bold;
}
-
+#selfck-print-queuing {
+ font-size: 110%;
+ border: 2px solid #808080;
+ width: 100%;
+ text-align: center;
+ padding: 10px;
+ margin: 5px;
+}
Modified: trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.js
===================================================================
--- trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.js 2008-09-16 21:08:50 UTC (rev 10605)
+++ trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.js 2008-09-16 21:18:34 UTC (rev 10606)
@@ -36,6 +36,10 @@
var orgUnit;
var orgUnitAddress;
var orgUnitHours;
+var alertOnCheckoutEvent = false;
+var SET_PATRON_TIMEOUT = 'circ.selfcheck.patron_login_timeout';
+var SET_BARCODE_REGEX = 'opac.barcode_regex';
+var SET_ALERT_ON_CHECKOUT_EVENT = 'circ.selfcheck.alert_on_checkout_event';
function selfckInit() {
@@ -47,12 +51,16 @@
orgUnit = findOrgUnitSN(cgi.param('l')) || globalOrgTree;
selfckFetchOrgDetails();
- var t = fetchOrgSettingDefault(orgUnit.id(), 'circ.selfcheck.patron_login_timeout');
- patronTimeout = (t) ? parseInt(t) * 1000 : patronTimeout;
+ // fetch the relevent org-unit setting
+ var settings = fetchBatchOrgSetting(orgUnit.id(),
+ [SET_PATRON_TIMEOUT, SET_BARCODE_REGEX, SET_ALERT_ON_CHECKOUT_EVENT]);
+ if(settings[SET_PATRON_TIMEOUT])
+ patronTimeout = parseInt(settings[SET_PATRON_TIMEOUT].value) * 1000;
+ if(settings[SET_BARCODE_REGEX])
+ patronBarcodeRegex = new RegExp(settings[SET_BARCODE_REGEX].value);
+ if(settings[SET_ALERT_ON_CHECKOUT_EVENT])
+ alertOnCheckoutEvent = (settings[SET_ALERT_ON_CHECKOUT_EVENT].value) ? true : false;
- var reg = fetchOrgSettingDefault(orgUnit.id(), 'opac.barcode_regex');
- if(reg) patronBarcodeRegex = new RegExp(reg);
-
if(!staff) {
// should not happen when behind the proxy
return alert('Staff must login');
@@ -167,11 +175,13 @@
function selfckLogoutPatron() {
$('selfck-item-barcode-input').value = ''; // prevent browser caching
$('selfck-patron-login-input').value = '';
+ hideMe($('selfck-patron-checkout-container'));
+ unHideMe($('selfck-print-queuing'));
if(patron) {
selfckPrint();
setTimeout(
function() { location.href = location.href; },
- 800
+ 3500 // give the browser time to send the page to the printer
);
}
}
@@ -316,6 +326,9 @@
appendClear($('selfck-event-time'), text(new Date().toLocaleString()));
appendClear($('selfck-event-span'), text($('selfck-event-' + code).innerHTML));
+
+ if(code != 'SUCCESS' && alertOnCheckoutEvent)
+ alert($('selfck-event-' + code).innerHTML);
}
/**
Modified: trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml
===================================================================
--- trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml 2008-09-16 21:08:50 UTC (rev 10605)
+++ trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml 2008-09-16 21:18:34 UTC (rev 10606)
@@ -58,6 +58,11 @@
<span id='selfck-patron-not-found' class='hide_me'>&selfck.event.patron_not_found;</span>
</div>
+ <div id='selfck-print-queuing' class='hide_me'>
+ <div><img src='../../../images/small_logo.jpg'/></div>
+ <div>Printing Receipt...</div>
+ </div>
+
<!--***********************************************************************
Checkout form
*********************************************************************** -->
More information about the open-ils-commits
mailing list