this.chain.push(
function() {
var f = gen_fm_retrieval_func(
+ 'cbc',
+ [
+ api.FM_CBC_PCRUD_SEARCH.app,
+ api.FM_CBC_PCRUD_SEARCH.method,
+ [ obj.session.key, {"active":"t"}, {"order_by":{"cbc":"id"}} ],
+ false
+ ]
+ );
+ try {
+ f();
+ } catch(E) {
+ var error = 'Error: ' + js2JSON(E);
+ obj.error.sdump('D_ERROR',error);
+ throw(E);
+ }
+ }
+ );
+
+ this.chain.push(
+ function() {
+ var f = gen_fm_retrieval_func(
'csp',
[
api.FM_CSP_PCRUD_SEARCH.app,
'FM_BRE_DELETE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record_entry.delete', 'secure' : false },
'FM_BRE_UNDELETE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record_entry.undelete', 'secure' : false },
'FM_BRN_FROM_MARCXML' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.marcxml_to_brn', 'secure' : false },
+ 'FM_CBC_PCRUD_SEARCH' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.cbc.atomic', 'secure' : false },
'FM_CBS_RETRIEVE_VIA_PCRUD' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.retrieve.cbs' },
'FM_CBT_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.billing_type.ranged.retrieve.all', 'secure' : false },
'FM_CCS_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.config.copy_status.retrieve.all', 'secure' : false },
var async_checkbox = document.getElementById('async_checkin');
if (async_checkbox) { async = async_checkbox.getAttribute('checked') == 'true'; }
var barcode = textbox.value;
- // Auto-complete the barcode, items only
- var barcode_object = xulG.get_barcode(window, 'asset', barcode);
if (async) {
textbox.value = ''; textbox.focus();
}
- // user_false means the user selected "None of the above", abort before other prompts/errors
- if(barcode_object == "user_false") return;
- // Got a barcode without an error? Use it. Otherwise fall through.
- if(barcode_object && typeof barcode_object.ilsevent == 'undefined')
- barcode = barcode_object.barcode;
+ if (obj.data.list.cbc.length > 0) { // skip barcode completion lookups if none configured
+ // Auto-complete the barcode, items only
+ var barcode_object = xulG.get_barcode(window, 'asset', barcode);
+ // user_false means the user selected "None of the above", abort before other prompts/errors
+ if(barcode_object == "user_false") return;
+ // Got a barcode without an error? Use it. Otherwise fall through.
+ if(barcode_object && typeof barcode_object.ilsevent == 'undefined')
+ barcode = barcode_object.barcode;
+ }
if ( obj.test_barcode(barcode) ) { /* good */ } else { /* bad */ return; }
var placeholder_item = new acp();
placeholder_item.barcode( barcode );
if (! (params.barcode||params.noncat)) { return; }
if (params.barcode) {
- // Default is "just items"
- var barcode_context = 'asset';
- // Add actor (can be any string that includes 'actor') if looking up patrons at checkout
- if(String( obj.data.hash.aous['circ.staff_client.actor_on_checkout'] ) == 'true')
- barcode_context += '-actor';
- // Auto-complete the barcode
- var in_barcode = xulG.get_barcode(window, barcode_context, params.barcode);
- // user_false is "None of the above selected", don't error out/fall through as they already said no
- if(in_barcode == "user_false") return;
- // We have a barcode and there was no error?
- if(in_barcode && typeof in_barcode.ilsevent == 'undefined') {
- // Check if it was an actor barcode (will never happen unless actor was added above)
- if(in_barcode.type == 'actor') {
- // Go to new patron (do not pass go, do not collect $200, do not prompt user)
- var horizontal_interface = String( obj.data.hash.aous['ui.circ.patron_summary.horizontal'] ) == 'true';
- var loc = xulG.url_prefix( horizontal_interface ? 'XUL_PATRON_HORIZ_DISPLAY' : 'XUL_PATRON_DISPLAY' );
- xulG.set_tab( loc, {}, { 'barcode' : in_barcode.barcode } );
- return;
+ var actor_on_checkout = String(
+ obj.data.hash.aous['circ.staff_client.actor_on_checkout']
+ ) == 'true';
+ // skip barcode completion lookups if we can
+ if (actor_on_checkout || obj.data.list.cbc.length > 0) {
+ // Default is "just items"
+ var barcode_context = 'asset';
+ // Add actor (can be any string that includes 'actor') if looking up patrons at checkout
+ if(actor_on_checkout)
+ barcode_context += '-actor';
+ // Auto-complete the barcode
+ var in_barcode = xulG.get_barcode(window, barcode_context, params.barcode);
+ // user_false is "None of the above selected", don't error out/fall through as they already said no
+ if(in_barcode == "user_false") return;
+ // We have a barcode and there was no error?
+ if(in_barcode && typeof in_barcode.ilsevent == 'undefined') {
+ // Check if it was an actor barcode (will never happen unless actor was added above)
+ if(in_barcode.type == 'actor') {
+ // Go to new patron (do not pass go, do not collect $200, do not prompt user)
+ var horizontal_interface = String( obj.data.hash.aous['ui.circ.patron_summary.horizontal'] ) == 'true';
+ var loc = xulG.url_prefix( horizontal_interface ? 'XUL_PATRON_HORIZ_DISPLAY' : 'XUL_PATRON_DISPLAY' );
+ xulG.set_tab( loc, {}, { 'barcode' : in_barcode.barcode } );
+ return;
+ }
+ params.barcode = in_barcode.barcode;
}
- params.barcode = in_barcode.barcode;
}
if ( obj.test_barcode(params.barcode) ) { /* good */ } else { /* bad */ return; }