[open-ils-commits] r13819 - branches/rel_1_4/Open-ILS/web/opac/extras/selfcheck (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Aug 12 13:20:08 EDT 2009
Author: erickson
Date: 2009-08-12 13:20:04 -0400 (Wed, 12 Aug 2009)
New Revision: 13819
Modified:
branches/rel_1_4/Open-ILS/web/opac/extras/selfcheck/selfcheck.js
branches/rel_1_4/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml
Log:
added ability to auto-override configured checkout/renewal events at selfcheck. also, pull in JS files directly so we're not unnecessarily running opac-only code
Modified: branches/rel_1_4/Open-ILS/web/opac/extras/selfcheck/selfcheck.js
===================================================================
--- branches/rel_1_4/Open-ILS/web/opac/extras/selfcheck/selfcheck.js 2009-08-12 17:19:29 UTC (rev 13818)
+++ branches/rel_1_4/Open-ILS/web/opac/extras/selfcheck/selfcheck.js 2009-08-12 17:20:04 UTC (rev 13819)
@@ -37,9 +37,11 @@
var orgUnitAddress;
var orgUnitHours;
var alertOnCheckoutEvent = false;
+var overrideCircEvents = [];
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';
+var SET_AUTO_OVERRIDE_EVENTS = 'circ.selfcheck.auto_override_checkout_events';
function selfckInit() {
@@ -53,13 +55,15 @@
// fetch the relevent org-unit setting
var settings = fetchBatchOrgSetting(orgUnit.id(),
- [SET_PATRON_TIMEOUT, SET_BARCODE_REGEX, SET_ALERT_ON_CHECKOUT_EVENT]);
+ [SET_PATRON_TIMEOUT, SET_BARCODE_REGEX, SET_ALERT_ON_CHECKOUT_EVENT, SET_AUTO_OVERRIDE_EVENTS]);
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;
+ if(settings[SET_AUTO_OVERRIDE_EVENTS])
+ overrideCircEvents = settings[SET_AUTO_OVERRIDE_EVENTS].value;
if(!staff) {
// should not happen when behind the proxy
@@ -247,7 +251,7 @@
/**
* Sends the checkout request
*/
-function selfckCheckout() {
+function selfckCheckout(override) {
if(pendingXact) return;
selfckResetTimer();
pendingXact = true;
@@ -270,7 +274,7 @@
}
var coReq = new Request(
- 'open-ils.circ:open-ils.circ.checkout.full',
+ 'open-ils.circ:open-ils.circ.checkout.full' + ((override) ? '.override' : ''),
G.user.session, {patron_id:patron.id(), copy_barcode:itemBarcode});
coReq.request.alertEvent = false;
@@ -308,6 +312,26 @@
} else {
pendingXact = false;
+
+ if(!evt.length) evt = [evt];
+ if(overrideCircEvents.length) {
+
+ // see if the events we received are all in the list of
+ // events to override
+ var override = true;
+ for(var i = 0; i < evt.length; i++) {
+ var match = overrideCircEvents.filter(
+ function(e) { return (e == evt[i].textcode); })[0];
+ if(!match) {
+ override = false;
+ break;
+ }
+ }
+
+ if(override)
+ return selfckCheckout(true);
+ }
+
selfckShowMsgNode(evt);
$('selfck-item-barcode-input').select();
}
Modified: branches/rel_1_4/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml
===================================================================
--- branches/rel_1_4/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml 2009-08-12 17:19:29 UTC (rev 13818)
+++ branches/rel_1_4/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml 2009-08-12 17:20:04 UTC (rev 13819)
@@ -30,9 +30,33 @@
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
- <script>var config = {css:{}}</script>
- <!--#include virtual="../../skin/default/xml/common/js_common.xml"-->
<script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/utils.js'></script>
+ <script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/config.js'></script>
+ <script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/CGI.js'></script>
+ <script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/Cookies.js'></script>
+ <script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/md5.js'></script>
+ <script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/JSON_v1.js'></script>
+ <script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/fmcore.js'></script>
+ <script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/fmgen.js'></script>
+ <script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/opac_utils.js'></script>
+ <script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/<!--#echo var="locale"-->/OrgTree.js'></script>
+ <script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/OrgLasso.js'></script>
+ <script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/org_utils.js'></script>
+ <script language='javascript' type='text/javascript'
+ src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/RemoteRequest.js'></script>
+ <script language='javascript' type='text/javascript'
src='<!--#echo var="OILS_OPAC_JS_HOST"-->/common/js/DP_DateExtensions.js'></script>
<script language='javascript' type='text/javascript'
src='<!--#echo var="OILS_OPAC_JS_HOST"-->/extras/selfcheck/selfcheck.js'></script>
More information about the open-ils-commits
mailing list