var sel = obj.list.retrieve_selection();
obj.selection_list = util.functional.map_list(
sel,
- function(o) { var p = JSON2js(o.getAttribute('retrieve_id')); p.unique_row_counter = o.getAttribute('unique_row_counter'); return p; }
+ function(o) {
+ if (o.getAttribute('retrieve_id')) {
+ try {
+ var p = JSON2js(o.getAttribute('retrieve_id'));
+ p.unique_row_counter = o.getAttribute('unique_row_counter');
+ return p;
+ } catch(E) {
+ return -1;
+ }
+ } else {
+ return -1;
+ }
+ }
+ );
+ obj.selection_list = util.functional.filter_list(
+ obj.selection_list,
+ function(o) {
+ return o != -1;
+ }
);
obj.error.sdump('D_TRACE', 'circ/copy_status: selection list = ' + js2JSON(obj.selection_list) );
if (obj.selection_list.length == 0) {
if (barcode) {
if ( obj.test_barcode(barcode) ) { /* good */ } else { /* bad */ return; }
}
+ var placeholder_item = new acp();
+ placeholder_item.barcode( barcode );
+ var row_params = obj.list.append( {
+ 'row' : {
+ 'my' : {
+ 'acp' : placeholder_item
+ }
+ },
+ 'to_top' : true,
+ 'on_append' : function(rparams) { obj.row_map[ rparams.unique_row_counter ] = rparams; },
+ 'on_remove' : function(unique_row_counter) { delete obj.row_map[ unique_row_counter ]; }
+ } );
+
var backdate = obj.controller.view.checkin_effective_datepicker.value;
var auto_print = document.getElementById('checkin_auto_print_slips');
if (auto_print) auto_print = auto_print.getAttribute('checked') == 'true';
'checkin_result' : function(checkin) {
textbox.disabled = false;
//obj.controller.view.cmd_checkin_submit_barcode.setAttribute('disabled', 'false');
- obj.checkin2(checkin,backdate);
+ obj.checkin2(checkin,backdate,row_params);
+ },
+ 'info_blurb' : function(text) {
+ try { row_params.row.my.acp.alert_message( text ); } catch(E) {dump('error: ' + E + '\n');}
}
};
var suppress_holds_and_transits = document.getElementById('suppress_holds_and_transits');
},
- 'checkin2' : function(checkin,backdate) {
+ 'checkin2' : function(checkin,backdate,row_params) {
var obj = this;
try {
- if (!checkin) return obj.on_failure(); /* circ.util.checkin handles errors and returns null currently */
+ if (!checkin) {/* circ.util.checkin used to be sole handler of errors and returns null currently */
+ obj.list.refresh_row( row_params ); /* however, let's refresh the row because we're shoving error text into the dummy placeholder item's alert_message field */
+ return obj.on_failure();
+ }
if (checkin.ilsevent == 7010 /* COPY_ALERT_MESSAGE */
|| checkin.ilsevent == 1203 /* COPY_BAD_STATUS */
|| checkin.ilsevent == -1 /* offline */
|| checkin.ilsevent == 1203 /* COPY_BAD_STATUS */
|| checkin.ilsevent == 7009 /* CIRC_CLAIMS_RETURNED */
|| checkin.ilsevent == 7011 /* COPY_STATUS_LOST */
- || checkin.ilsevent == 7012 /* COPY_STATUS_MISSING */) return obj.on_failure();
+ || checkin.ilsevent == 7012 /* COPY_STATUS_MISSING */) {
+ obj.list.refresh_row( row_params );
+ return obj.on_failure();
+ }
var retrieve_id = js2JSON( { 'circ_id' : checkin.circ ? checkin.circ.id() : null , 'copy_id' : checkin.copy.id(), 'barcode' : checkin.copy.barcode(), 'doc_id' : (typeof checkin.record != 'undefined' ? ( typeof checkin.record.ilsevent == 'undefined' ? checkin.record.doc_id() : null ) : null ) } );
if (checkin.circ && checkin.circ.checkin_time() == 'now') checkin.circ.checkin_time(backdate);
if (document.getElementById('trim_list')) {
var x = document.getElementById('trim_list');
if (x.checked) { obj.list.trim_list = 20; } else { obj.list.trim_list = null; }
}
- obj.list.append(
- {
- 'retrieve_id' : retrieve_id,
- 'row' : {
- 'my' : {
- 'circ' : checkin.circ,
- 'mbts' : checkin.circ ? checkin.circ.billable_transaction().summary() : null,
- 'mvr' : checkin.record,
- 'acp' : checkin.copy,
- 'au' : checkin.patron,
- 'status' : checkin.status,
- 'route_to' : checkin.route_to,
- 'message' : checkin.message
- }
- },
- 'to_top' : true,
- 'on_append' : function(rparams) { obj.row_map[ rparams.unique_row_counter ] = rparams; },
- 'on_remove' : function(unique_row_counter) { delete obj.row_map[ unique_row_counter ]; }
+ row_params['retrieve_id'] = retrieve_id;
+ row_params['row'] = {
+ 'my' : {
+ 'circ' : checkin.circ,
+ 'mbts' : checkin.circ ? checkin.circ.billable_transaction().summary() : null,
+ 'mvr' : checkin.record,
+ 'acp' : checkin.copy,
+ 'au' : checkin.patron,
+ 'status' : checkin.status,
+ 'route_to' : checkin.route_to,
+ 'message' : checkin.message
}
- );
+ };
+ obj.list.refresh_row( row_params );
obj.list.node.view.selection.select(0);
JSAN.use('util.sound'); var sound = new util.sound(); sound.circ_good();
check.what_happened = 'no_change';
if (document.getElementById('no_change_label')) {
var m = document.getElementById('no_change_label').getAttribute('value');
- document.getElementById('no_change_label').setAttribute('value', m + document.getElementById('circStrings').getFormattedString('staff.circ.utils.item_checked_in', [params.barcode]) + ' ');
+ var text = document.getElementById('circStrings').getFormattedString('staff.circ.utils.item_checked_in', [params.barcode]);
+ document.getElementById('no_change_label').setAttribute('value', m + text + ' ');
document.getElementById('no_change_label').setAttribute('hidden','false');
+ if (typeof params.info_blurb == 'function') {
+ params.info_blurb( text );
+ }
}
}
if (check.ilsevent == 1202 /* ITEM_NOT_CATALOGED */ && check.copy.status() != 11) {
msg = '';
if (document.getElementById('no_change_label')) {
var m = document.getElementById('no_change_label').getAttribute('value');
- m += document.getElementById('circStrings').getFormattedString('staff.circ.utils.capture', [params.barcode]);
+ var text = document.getElementById('circStrings').getFormattedString('staff.circ.utils.capture', [params.barcode]);
+ m += text + ' ';
document.getElementById('no_change_label').setAttribute('value', m);
document.getElementById('no_change_label').setAttribute('hidden','false');
+ if (typeof params.info_blurb == 'function') {
+ params.info_blurb( text );
+ }
}
break;
case 6: /* IN TRANSIT */
var needs_cat = document.getElementById('circStrings').getFormattedString('staff.circ.utils.needs_cataloging', [params.barcode]);
document.getElementById('no_change_label').setAttribute('value', m + needs_cat + ' ');
document.getElementById('no_change_label').setAttribute('hidden','false');
+ if (typeof params.info_blurb == 'function') {
+ params.info_blurb( needs_cat );
+ }
}
break;
case 15: // ON_RESERVATION_SHELF
msg = '';
if (document.getElementById('no_change_label')) {
var m = document.getElementById('no_change_label').getAttribute('value');
- m += document.getElementById('circStrings').getFormattedString('staff.circ.utils.reservation_capture', [params.barcode]);
+ var text = document.getElementById('circStrings').getFormattedString('staff.circ.utils.reservation_capture', [params.barcode]);
+ m += text + ' ';
document.getElementById('no_change_label').setAttribute('value', m);
document.getElementById('no_change_label').setAttribute('hidden','false');
+ if (typeof params.info_blurb == 'function') {
+ params.info_blurb( text );
+ }
}
break;
default:
var trans_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.in_transit', [params.barcode]);
document.getElementById('no_change_label').setAttribute('value', m + trans_msg + ' ');
document.getElementById('no_change_label').setAttribute('hidden','false');
+ if (typeof params.info_blurb == 'function') {
+ params.info_blurb( trans_msg );
+ }
}
} else /* ASSET_COPY_NOT_FOUND */ if (check.ilsevent == 1502) {
var m = document.getElementById('no_change_label').getAttribute('value');
document.getElementById('no_change_label').setAttribute('value',m + mis_scan_msg + ' ');
document.getElementById('no_change_label').setAttribute('hidden','false');
+ if (typeof params.info_blurb == 'function') {
+ params.info_blurb( mis_scan_msg );
+ }
}
} else /* HOLD_CAPTURE_DELAYED */ if (check.ilsevent == 7019) {
var m = document.getElementById('no_change_label').getAttribute('value');
document.getElementById('no_change_label').setAttribute('value',m + mis_scan_msg + ' ');
document.getElementById('no_change_label').setAttribute('hidden','false');
+ if (typeof params.info_blurb == 'function') {
+ params.info_blurb( mis_scan_msg );
+ }
}
break;
case 7002 /* PATRON_EXCEEDS_CHECKOUT_COUNT */ : break;