[open-ils-commits] r16990 - in trunk/Open-ILS: src/sql/Pg src/sql/Pg/upgrade web/js/ui/default/circ/selfcheck (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jul 20 17:16:05 EDT 2010
Author: erickson
Date: 2010-07-20 17:15:59 -0400 (Tue, 20 Jul 2010)
New Revision: 16990
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0344.data.sc_copy_status_block_setting.sql
Modified:
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
Log:
added support for selecting individual copy statuses that will prevent checkout at self-check even when the generic copy_not_available event has been overridden to allow for non-standard copy circs from selfcheck. TODO: ui for managing the list
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-07-20 19:58:48 UTC (rev 16989)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-07-20 21:15:59 UTC (rev 16990)
@@ -68,7 +68,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0343'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0344'); -- berick
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-07-20 19:58:48 UTC (rev 16989)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-07-20 21:15:59 UTC (rev 16990)
@@ -5928,3 +5928,21 @@
'string'
);
+INSERT INTO config.org_unit_setting_type (name, label, description, datatype)
+ VALUES (
+ 'circ.selfcheck.block_checkout_on_copy_status',
+ oils_i18n_gettext(
+ 'circ.selfcheck.block_checkout_on_copy_status',
+ 'Selfcheck: Block copy checkout status',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ 'circ.selfcheck.block_checkout_on_copy_status',
+ 'List of copy status IDs that will block checkout even if the generic COPY_NOT_AVAILABLE event is overridden',
+ 'coust',
+ 'description'
+ ),
+ 'array'
+ );
+
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0344.data.sc_copy_status_block_setting.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0344.data.sc_copy_status_block_setting.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0344.data.sc_copy_status_block_setting.sql 2010-07-20 21:15:59 UTC (rev 16990)
@@ -0,0 +1,23 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0344');
+
+INSERT INTO config.org_unit_setting_type (name, label, description, datatype)
+ VALUES (
+ 'circ.selfcheck.block_checkout_on_copy_status',
+ oils_i18n_gettext(
+ 'circ.selfcheck.block_checkout_on_copy_status',
+ 'Selfcheck: Block copy checkout status',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ 'circ.selfcheck.block_checkout_on_copy_status',
+ 'List of copy status IDs that will block checkout even if the generic COPY_NOT_AVAILABLE event is overridden',
+ 'coust',
+ 'description'
+ ),
+ 'array'
+ );
+
+COMMIT;
Modified: trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js 2010-07-20 19:58:48 UTC (rev 16989)
+++ trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js 2010-07-20 21:15:59 UTC (rev 16990)
@@ -22,6 +22,8 @@
const SET_ALERT_POPUP = 'circ.selfcheck.alert.popup';
const SET_ALERT_SOUND = 'circ.selfcheck.alert.sound';
const SET_CC_PAYMENT_ALLOWED = 'credit.payments.allow';
+// This setting only comes into play if COPY_NOT_AVAILABLE is in the SET_AUTO_OVERRIDE_EVENTS list
+const SET_BLOCK_CHECKOUT_ON_COPY_STATUS = 'circ.selfcheck.block_checkout_on_copy_status';
function SelfCheckManager() {
@@ -243,6 +245,7 @@
SET_ALERT_POPUP,
SET_ALERT_SOUND,
SET_AUTO_OVERRIDE_EVENTS,
+ SET_BLOCK_CHECKOUT_ON_COPY_STATUS,
SET_PATRON_PASSWORD_REQUIRED,
SET_AUTO_RENEW_INTERVAL,
SET_WORKSTATION_REQUIRED,
@@ -877,7 +880,7 @@
console.log("Checkout out item " + barcode + " with method " + method);
var result = fieldmapper.standardRequest(
- ['open-ils.circ', 'open-ils.circ.checkout.full'],
+ ['open-ils.circ', method],
{params: [
this.authtoken, {
patron_id : this.patron.id(),
@@ -917,6 +920,7 @@
var sound = ''; // sound file reference
var payload = result.payload || {};
var overrideEvents = this.orgSettings[SET_AUTO_OVERRIDE_EVENTS];
+ var blockStatuses = this.orgSettings[SET_BLOCK_CHECKOUT_ON_COPY_STATUS];
if(result.textcode == 'NO_SESSION') {
@@ -1006,13 +1010,27 @@
var override = true;
for(var i = 0; i < result.length; i++) {
- var match = overrideEvents.filter(
- function(e) { return (e == result[i].textcode); })[0];
+
+ var match = overrideEvents.filter(function(e) { return (e == result[i].textcode); })[0];
+
if(!match) {
override = false;
break;
}
+ if(result[i].textcode == 'COPY_NOT_AVAILABLE' && blockStatuses && blockStatuses.length) {
+
+ var stat = result[i].payload.status(); // copy status
+ if(typeof stat == 'object') stat = stat.id();
+
+ var match2 = blockStatuses.filter(function(e) { return (e == stat); })[0];
+
+ if(match2) { // copy is in a blocked status
+ override = false;
+ break;
+ }
+ }
+
if(result[i].textcode == 'COPY_IN_TRANSIT') {
// to override a transit, we have to abort the transit and check it in first
if(this.checkin(item, true)) {
@@ -1020,7 +1038,6 @@
} else {
override = false;
}
-
}
}
More information about the open-ils-commits
mailing list