if (req.cancelled) {
result = fake_ilsevent_for_network_errors;
} else {
- result = req.getResultObject();
+ result = req.getResultObject();
+ if(result && req._reported_events) {
+ if(typeof result.ilsevent != 'undefined') {
+ result._reported_events = req._reported_events;
+ } else {
+ result[0]._reported_events = req._reported_events;
+ }
+ }
}
} catch(E) {
try {
try {
if (!override_params.text) override_params.text = {};
if (!override_params.auto_override_these_events) override_params.auto_override_these_events = [];
+ if (!override_params.report_override_on_events) override_params.report_override_on_events = [];
function override(r) {
try {
// test to see if we can suppress this dialog and auto-override
);
if (fancy_prompt_data.fancy_status == 'complete') {
req = obj._request(app,name + '.override',params);
+ if (req && override_params.report_override_on_events.length > 0 && typeof result == 'object') {
+ var reported_events = [];
+ for (var i = 0; i < r.length; i++) {
+ if (typeof r[i].ilsevent != 'undefined') {
+ if (override_params.report_override_on_events.indexOf( r[i].ilsevent == null ? null : Number(r[i].ilsevent) ) != -1) {
+ reported_events.push(Number(r[i].ilsevent));
+ }
+ if (override_params.report_override_on_events.indexOf( r[i].textcode ) != -1) {
+ reported_events.push(r[i].textcode);
+ }
+ }
+ }
+ req._reported_events = reported_events;
+ }
}
return req;
} catch(E) {
obj.patron_id = params.patron_id;
+ obj.auto_override_events = [];
+
JSAN.use('circ.util');
var columns = circ.util.columns(
{
7016 /* ITEM_ON_HOLDS_SHELF */,
7013 /* PATRON_EXCEEDS_FINES */
],
+ 'report_override_on_events' : [ /* Allow auto-override of Patron overrides only */
+ 1212 /* PATRON_EXCEEDS_OVERDUE_COUNT */,
+ 1213 /* PATRON_BARRED */,
+ 7002 /* PATRON_EXCEEDS_CHECKOUT_COUNT */,
+ 7013 /* PATRON_EXCEEDS_FINES */
+ ],
+ 'auto_override_these_events' : obj.auto_override_events,
'text' : {
'1232' : function(r) {
return document.getElementById('circStrings').getString('staff.circ.checkout.override.item_deposit_required.warning');
/**********************************************************************************************************************/
/* Normal case, proceed with checkout */
if (permit.ilsevent === '0') {
-
+ if(permit._reported_events != 'undefined') {
+ obj.auto_override_events = obj.auto_override_events.concat(permit._reported_events);
+ }
JSAN.use('util.sound'); var sound = new util.sound(); sound.circ_good();
params.permit_key = permit.payload;
obj._checkout( params, permit );