From: Jason Etheridge Date: Tue, 19 Feb 2013 23:30:58 +0000 (-0500) Subject: squash X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fe9849da7cf616642255628717819888b4bd397f;p=working%2FEvergreen.git squash Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index ad222e5a93..382cd9cddf 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -23,6 +23,7 @@ use OpenILS::WWW::EGCatLoader::Search; use OpenILS::WWW::EGCatLoader::Record; use OpenILS::WWW::EGCatLoader::Container; use OpenILS::WWW::EGCatLoader::SMS; +use OpenILS::WWW::EGCatLoader::PatronSummary; my $U = 'OpenILS::Application::AppUtils'; @@ -193,6 +194,8 @@ sub load { return $self->load_myopac_prefs_settings if $path =~ m|opac/myopac/prefs_settings|; return $self->load_myopac_prefs if $path =~ m|opac/myopac/prefs|; return $self->load_sms_cn if $path =~ m|opac/sms_cn|; + return $self->load_patron_summary if $path =~ m|opac/PatronSummary|; + return $self->load_patron_summary if $path =~ m|opac/PatronSearchSummary|; return Apache2::Const::OK; } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/PatronSummary.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/PatronSummary.pm new file mode 100644 index 0000000000..a751333193 --- /dev/null +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/PatronSummary.pm @@ -0,0 +1,186 @@ +package OpenILS::WWW::EGCatLoader; +use strict; use warnings; +use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_INTERNAL_SERVER_ERROR REDIRECT HTTP_BAD_REQUEST); +use OpenSRF::Utils::Logger qw/$logger/; +use OpenILS::Utils::CStoreEditor qw/:funcs/; +use OpenILS::Utils::Fieldmapper; +use OpenILS::Application::AppUtils; +use OpenILS::Event; +use OpenSRF::Utils::JSON; +use Data::Dumper; +$Data::Dumper::Indent = 0; +use DateTime; +my $U = 'OpenILS::Application::AppUtils'; + +sub isTrue { + my $v = shift; + return 1 if ($v eq 't'); + return 0; +} + +sub load_patron_summary { + my $self = shift; + my $ctx = $self->ctx; + #my $gos = $ctx->{get_org_setting}; + my $e = $self->editor; + my $cgi = $self->cgi; + + $self->_load_user_with_prefs() if($e->checkauth); + + $ctx->{page} = 'patron_summary'; + $ctx->{au_id} = $cgi->param('au_id'); + my @classnames = (); + + # open-ils.actor.user.fleshed.retrieve.authoritative + my $au_resp = $U->simplereq( + 'open-ils.actor', + 'open-ils.actor.user.fleshed.retrieve.authoritative', + $e->authtoken, + $ctx->{au_id}, + [ + 'card', + 'profile', + 'mailing_address', + 'billing_address', + 'open_billable_transactions_summary', + 'standing_penalties', + 'notes', + 'usr_activity', + 'home_ou', + 'ident_type', + 'ident_type2' + ] + ); + + if (ref $au_resp eq 'HASH' && defined $au_resp->{textcode}) { + $ctx->{error} = $au_resp; + return Apache2::Const::OK; + } + + $au_resp->standing_penalties( + grep { + isTrue($_->isdeleted) || $_->stop_date + } @{ $au_resp->standing_penalties } + ); + $ctx->{user} = $au_resp; + + $ctx->{addr} = $au_resp->mailing_address && $au_resp->mailing_address->valid + ? $au_resp->mailing_address + : $au_resp->billing_address && $au_resp->billing_address->valid + ? $au_resp->billing_address + : undef; + + my $classhash = {}; + my $block_list; + foreach my $p ( @{ $au_resp->standing_penalties } ) { + $classhash->{ $p->standing_penalty->name } = 1; + if ($p->standing_penalty->id >= 100) { + $classhash->{'PATRON_HAS_CUSTOM_PENALTY'} = 1; + } + if (isTrue($p->standing_penalty->staff_alert)) { + $classhash->{'PATRON_HAS_STAFF_ALERT'} = 1; + } + $block_list = $p->standing_penalty->block_list; + if ($block_list) { + $classhash->{'PATRON_HAS_BLOCK'} = 1; + if ($block_list =~ 'CIRC') { + $classhash->{'PATRON_HAS_CIRC_BLOCK'} = 1; + } + if ($block_list =~ 'RENEW') { + $classhash->{'PATRON_HAS_RENEW_BLOCK'} = 1; + } + if ($block_list =~ 'HOLD') { + $classhash->{'PATRON_HAS_HOLD_BLOCK'} = 1; + } + if ($block_list =~ 'CAPTURE') { + $classhash->{'PATRON_HAS_CAPTURE_BLOCK'} = 1; + } + if ($block_list =~ 'FULFILL') { + $classhash->{'PATRON_HAS_FULFILL_BLOCK'} = 1; + } + } + } + foreach my $c ( keys %{ $classhash } ) { + push @classnames, $c; + } + if (scalar @{ $au_resp->standing_penalties } == 0) { + push @classnames, 'NO_PENALTIES'; + } + if (scalar @{ $au_resp->standing_penalties } == 1) { + push @classnames, 'ONE_PENALTY'; + } + if (scalar @{ $au_resp->standing_penalties } > 1) { + push @classnames, 'MULTIPLE_PENALTIES'; + } + if ($au_resp->alert_message) { + push @classnames, 'PATRON_HAS_ALERT'; + } + if (isTrue($au_resp->barred)) { + $ctx->{barred} = 1; + push @classnames, 'PATRON_BARRED'; + } + if (isTrue($au_resp->juvenile)) { + push @classnames, 'PATRON_JUVENILE'; + } + if (!isTrue($au_resp->active)) { + push @classnames, 'PATRON_INACTIVE'; + } + if (scalar( @{ $au_resp->notes }) > 0) { + push @classnames, 'PATRON_HAS_NOTES'; + } + push @classnames, 'PATRON_NET_ACCESS_' . $au_resp->net_access_level; + if ( + ($au_resp->mailing_address + && !isTrue($au_resp->mailing_address->valid)) + || ($au_resp->billing_address + && !isTrue($au_resp->billing_address->valid)) + ) { + push @classnames, 'PATRON_HAS_INVALID_ADDRESS'; + } + + # TODO: PATRON_EXPIRED + # TODO: PATRON_AGE_IS_ + # TODO: PATRON_AGE_LT_ + # TODO: PATRON_AGE_GE_ + + my $mous_resp = $U->simplereq( + 'open-ils.actor', + 'open-ils.actor.user.fines.summary.authoritative', + $e->authtoken, + $ctx->{au_id} + ); + $ctx->{money_open_user_summary} = $mous_resp; + + if ($mous_resp && $mous_resp->balance_owed > 0) { + push @classnames, 'PATRON_HAS_BILLS'; + } + + my $checked_out_count_resp = $U->simplereq( + 'open-ils.actor', + 'open-ils.actor.user.checked_out.count.authoritative', + $e->authtoken, + $ctx->{au_id} + ); + $ctx->{checked_out_count} = $checked_out_count_resp; + if ($checked_out_count_resp + && ($checked_out_count_resp->{overdue} + + $checked_out_count_resp->{long_overdue} + > 0)) { + push @classnames, 'PATRON_HAS_OVERDUES'; + } + + my $holds_count_resp = $U->simplereq( + 'open-ils.actor', + 'open-ils.actor.user.hold_requests.count.authoritative', + $e->authtoken, + $ctx->{au_id} + ); + $ctx->{holds_count} = $holds_count_resp; + + $ctx->{css_classnames} = join ' ', @classnames; + $ctx->{orig_params} = $cgi->Vars; + + return Apache2::Const::OK; +} + + diff --git a/Open-ILS/src/templates/base_nodojo.tt2 b/Open-ILS/src/templates/base_nodojo.tt2 new file mode 100644 index 0000000000..dc2197d378 --- /dev/null +++ b/Open-ILS/src/templates/base_nodojo.tt2 @@ -0,0 +1,13 @@ + + + + [% ctx.page_title %] + + + + + [% content %] + + diff --git a/Open-ILS/src/templates/opac/PatronSearchSummary.tt2 b/Open-ILS/src/templates/opac/PatronSearchSummary.tt2 new file mode 100644 index 0000000000..0ca1d64d42 --- /dev/null +++ b/Open-ILS/src/templates/opac/PatronSearchSummary.tt2 @@ -0,0 +1,123 @@ +[% PROCESS "opac/parts/header.tt2"; + WRAPPER "base_nodojo.tt2" + extracss="/eg/opac/css/PatronSummary.css"; + ctx.page_title = l("Patron Summary") %] +
+
+
+ [% IF NOT ctx.error %] +
+
+
+ + [% l( + HUMAN_NAME_FORMAT, + ctx.user.prefix, ctx.user.first_given_name, + ctx.user.second_given_name, ctx.user.family_name, + ctx.user.suffix + ) | html %] +
+ [% IF ctx.user.mailing_address %] + + [% ctx.user.mailing_address.street1 | html %]
+ [% ctx.user.mailing_address.street2 | html %]
+ [% ctx.user.mailing_address.city | html %], + [% ctx.user.mailing_address.state | html %] + [% ctx.user.mailing_address.post_code | html %] +

+ [% END %] +
+
+
+ + [% ctx.user.email OR ' ' | html %] +
+ [% IF ctx.user.billing_address %] + + [% ctx.user.billing_address.street1 | html %]
+ [% ctx.user.billing_address.street2 | html %]
+ [% ctx.user.billing_address.city | html %], + [% ctx.user.billing_address.state | html %] + [% ctx.user.billing_address.post_code | html %] +

+ [% END %] +
+
+
+ + [% l('D: [_1] ', ctx.user.day_phone) | html %]
+ [% l('E: [_1] ', ctx.user.evening_phone) | html %]
+ [% l('O: [_1] ', ctx.user.other_phone) | html %]
+
+ [% IF ctx.user.ident_value %] + + [% l( + '[_1]: [_2]', + ctx.user.ident_type.name, + ctx.user.ident_value + ) | html %] +
+ [% END %] + [% IF ctx.user.ident_value2 %] + + [% l( + '[_1]: [_2]', + ctx.user.ident_type2.name, + ctx.user.ident_value2 + ) | html %] +
+ [% END %] +
+
+
+ [% ctx.user.profile.name | html %]
+ [% ctx.user.home_ou.shortname | html %]
+ + [% l( + 'Items Overdue: [_1] Total: [_2]', + ctx.checked_out_count.overdue + ctx.checked_out_count.long_overdue, + ctx.checked_out_count.out + ) | html %] +
+ + [% l( + 'Holds Ready: [_1] Total: [_2]', + ctx.holds_count.ready, + ctx.holds_count.total + ) | html %] +
+ + [% IF ctx.money_open_user_summary %] + [% l( + 'Bills: [_1]', + ctx.money_open_user_summary.balance_owed + ) | html %] + [% ELSE %] + [% l( + 'Bills: [_1]', + '0.00' + ) | html %] + [% END %] +
+
+
+
+ [% ELSE %] +
+ + Error loading user with database id = [% ctx.au_id | html %] +
+ + Description: [% ctx.error.desc | html %] +
+ Server Time: [% ctx.error.servertime | html %]
+ Text Code: [% ctx.error.textcode | html %]
+ ILS Event: [% ctx.error.ilsevent | html %]
+ PID: [% ctx.error.pid | html %]
+ Stack Trace: [% ctx.error.stacktrace | html %]
+
+ [% END %] +
+
+
+[% END %] diff --git a/Open-ILS/src/templates/opac/PatronSummary.tt2 b/Open-ILS/src/templates/opac/PatronSummary.tt2 new file mode 100644 index 0000000000..ccae83fc56 --- /dev/null +++ b/Open-ILS/src/templates/opac/PatronSummary.tt2 @@ -0,0 +1,147 @@ +[% PROCESS "opac/parts/header.tt2"; + WRAPPER "base_nodojo.tt2" + extracss="/eg/opac/css/PatronSummary.css"; + ctx.page_title = l("Patron Summary") %] +
+
+
+ [% IF NOT ctx.error %] +
+
+
+ + [% l( + HUMAN_NAME_FORMAT, + ctx.user.prefix, ctx.user.first_given_name, + ctx.user.second_given_name, ctx.user.family_name, + ctx.user.suffix + ) | html %] +
+ [% IF ctx.addr %] + + [% ctx.addr.street1 | html %]
+ [% ctx.addr.street2 | html %]
+ [% ctx.addr.city | html %], + [% ctx.addr.state | html %] + [% ctx.addr.post_code | html %] +

+ [% END %] +
+
+
+ [% IF ctx.barred %] + + [% l('Patron is BARRED') | html %] +
+ [% END %] + [% expire_date = ctx.parse_datetime(ctx.user.expire_date); %] + [% IF (date.format(expire_date, '%s') < date.now) %] + + [% l('Account has EXPIRED') | html %] +
+ [% END %] + [% IF ctx.holds_count.ready > 0 %] + + [% IF ctx.holds_count.ready == 1 %] + [% l('1 hold Ready for Pickup') | html %] + [% ELSE %] + [% l('[_1] holds Ready for Pickup', ctx.holds_count.ready) | html %] + [% END %] +
+ [% END %] + [% IF ctx.user.alert_message %] + + [% ctx.user.alert_message | html %] +
+ [% END %] + [% IF ctx.user.notes.size > 0 %] + + [% IF ctx.user.notes.size == 1 %] + [% l('1 note') | html %] + [% ELSIF ctx.user.notes.size > 1 %] + [% l('[_1] notes', ctx.user.notes.size) | html %] + [% END %] +
+ [% END %] + [% FOREACH p IN ctx.user.standing_penalties %] + + [% p.standing_penalty.label | html %] + [% IF p.note %] + : [% p.note | html %] + [% END %] +
+ [% END %] +
+
+
+ + [% l('D: [_1] ', ctx.user.day_phone) | html %]
+ [% l('E: [_1] ', ctx.user.evening_phone) | html %]
+ [% l('O: [_1] ', ctx.user.other_phone) | html %]
+
+ + [% l( + 'Card: [_1]', + ctx.user.card.barcode + ) | html %] +
+ + [% l( + 'OPAC: [_1]', + ctx.user.usrname + ) | html %] +
+
+
+
+ [% ctx.user.profile.name | html %]
+ [% ctx.user.home_ou.shortname | html %]
+ + [% l( + 'Items Overdue: [_1] Total: [_2]', + ctx.checked_out_count.overdue + ctx.checked_out_count.long_overdue, + ctx.checked_out_count.out + ) | html %] +
+ + [% l( + 'Holds Ready: [_1] Total: [_2]', + ctx.holds_count.ready, + ctx.holds_count.total + ) | html %] +
+ + [% IF ctx.money_open_user_summary %] + [% l( + 'Bills: [_1]', + ctx.money_open_user_summary.balance_owed + ) | html %] + [% ELSE %] + [% l( + 'Bills: [_1]', + '0.00' + ) | html %] + [% END %] +
+
+
+
+ [% ELSE %] +
+ + Error loading user with database id = [% ctx.au_id | html %] +
+ + Description: [% ctx.error.desc | html %] +
+ Server Time: [% ctx.error.servertime | html %]
+ Text Code: [% ctx.error.textcode | html %]
+ ILS Event: [% ctx.error.ilsevent | html %]
+ PID: [% ctx.error.pid | html %]
+ Stack Trace: [% ctx.error.stacktrace | html %]
+
+ [% END %] +
+
+
+[% END %] diff --git a/Open-ILS/src/templates/opac/css/PatronSummary.css.tt2 b/Open-ILS/src/templates/opac/css/PatronSummary.css.tt2 new file mode 100644 index 0000000000..0ccccdd9d2 --- /dev/null +++ b/Open-ILS/src/templates/opac/css/PatronSummary.css.tt2 @@ -0,0 +1,50 @@ +body { + font-family: Arial, Helvetica, sans-serif; +} +.textBackground { +} +.table { + display: table; + width: 90%; +} +.row { display: table-row; } +.cell { + display: table-cell; + padding-left: 10px; + padding-right: 10px; + width: 25%; +} +.fLeft { + float: left; + padding-left: 10px; + padding-right: 10px; +} +.fRight { + float: right; + padding-left: 10px; + padding-right: 10px; +} +.fNone { + float: none; + padding-left: 10px; + padding-right: 10px; +} +.alerts { + font-weight: bold; + overflow: auto; +} +.patronNameLarge { font-weight: bold; } +.patronSummaryDiv { border: solid thick transparent; padding: 10px; } +.NO_PENALTIES .patronSummaryDiv { border-color: lime; } +.ONE_PENALTY .patronSummaryDiv { border-color: #66FFFF; } +.MULTIPLE_PENALTIES .patronSummaryDiv { border-color: #FF6633; } +.PATRON_HAS_STAFF_ALERT .patronSummaryDiv { border-color: blue; } +.PATRON_HAS_BILLS .patronSummaryDiv { border-color: #FFC266; } +.PATRON_HAS_OVERDUES .patronSummaryDiv { border-color: #FFC266; } +.PATRON_EXCEEDS_CHECKOUT_COUNT .patronSummaryDiv { border-color: #C99DFF; } +.PATRON_EXCEEDS_OVERDUE_COUNT .patronSummaryDiv { border-color: #C99DFF; } +.PATRON_EXCEEDS_FINES .patronSummaryDiv { border-color: #C99DFF; } +.PATRON_HAS_ALERT .patronSummaryDiv { border-color: yellow; } +.PATRON_INACTIVE .patronSummaryDiv { border-color: #333333; } +.PATRON_EXPIRED .patronSummaryDiv { border-color: #666666; } +.PATRON_BARRED .patronSummaryDiv { border-color: #CC3300; } diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js index fc17229959..74c8793448 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js @@ -646,6 +646,27 @@ OpenILS.data.prototype = { 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, diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index d3eb6e2534..1ff9b252d3 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -230,6 +230,7 @@ var api = { '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 }, @@ -522,7 +523,10 @@ var urls = { 'ALT_HOLDS_PRINT' : 'oils://remote/opac/extras/circ/alt_holds_print.html', 'SERIAL_PRINT_ROUTING_LIST_USERS' : 'oils://remote/eg/serial/print_routing_list_users', 'XUL_SERIAL_BATCH_RECEIVE': 'oils://remote/xul/server/serial/batch_receive.xul', - 'EG_TRIGGER_EVENTS' : 'oils://remote/eg/actor/user/event_log' + 'EG_TRIGGER_EVENTS' : 'oils://remote/eg/actor/user/event_log', + 'EG_PATRON_SUMMARY' : 'oils://remote/eg/opac/PatronSummary', + 'EG_PATRON_SEARCH_SUMMARY' : 'oils://remote/eg/opac/PatronSearchSummary', + 'XUL_SEARCH_PREFS' : 'chrome://open_ils_staff_client/content/main/search_prefs.xul' } if(use_tpac) { diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index 55a36826ce..055eaf55b6 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -2316,6 +2316,10 @@ commands: var id = tab.getAttribute('id'); return 'id = ' + id + ' semaphore = ' + obj.tab_semaphores[id]; } + content_params.get_idx = function() { + var idx = obj.controller.view.tabs.selectedIndex; + return idx; + } content_params.new_tab = function(a,b,c) { return obj.new_tab(a,b,c); }; content_params.set_tab = function(a,b,c) { return obj.set_tab(a,b,c); }; content_params.open_external = function(a) { return obj.open_external(a); }; diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js index 9b37385d6c..ce05dddb00 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -1308,6 +1308,16 @@ util.list.prototype = { this.node.view.selection.selectAll(); }, + 'retrieve_selection_retrieval_data' : function(params) { + var obj = this; + return util.functional.map_list( + obj.retrieve_selection(params), + function(el,idx) { + return JSON2js( el.getAttribute('retrieve_id') ); + } + ); + }, + 'retrieve_selection' : function(params) { var obj = this; switch(this.node.nodeName) { diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index d628861ea3..c5cf940cf1 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -562,16 +562,18 @@ circ.checkin.prototype = { 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 ); diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js index 08455c3ac4..c68e434257 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkout.js +++ b/Open-ILS/xul/staff_client/server/circ/checkout.js @@ -602,26 +602,32 @@ circ.checkout.prototype = { 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; } diff --git a/Open-ILS/xul/staff_client/server/main/data.xul b/Open-ILS/xul/staff_client/server/main/data.xul index f18146b49e..7f86c14abd 100644 --- a/Open-ILS/xul/staff_client/server/main/data.xul +++ b/Open-ILS/xul/staff_client/server/main/data.xul @@ -95,6 +95,8 @@ //cache_me('/xul/server/util/browser.xul','http'); //cache_me('/xul/server/util/rbrowser.xul','http'); + cache_me('/xul/server//patron/search.js','http'); + cache_me('/xul/server//patron/patron.js','http'); //cache_me('/xul/server//patron/display.js','http'); //cache_me('/xul/server//patron/holds.js','http'); //cache_me('/xul/server//patron/items.js','http'); @@ -103,7 +105,8 @@ //cache_me('/xul/server//patron/summary.js','http'); //cache_me('/xul/server//patron/util.js','http'); - //cache_me('/xul/server/patron/display.xul','http'); + cache_me('/xul/server/patron/display.xul','http'); + cache_me('/xul/server/patron/display_horiz.xul','http'); //cache_me('/xul/server/patron/display_overlay.xul','http'); //cache_me('/xul/server/patron/holds.xul','http'); //cache_me('/xul/server/patron/holds_overlay.xul','http'); @@ -115,7 +118,7 @@ //cache_me('/xul/server/patron/search_result_overlay.xul','http'); //cache_me('/xul/server/patron/summary.xul','http'); //cache_me('/xul/server/patron/summary_overlay.xul','http'); - //cache_me('/xul/server/patron/barcode_entry.xul','http'); + cache_me('/xul/server/patron/barcode_entry.xul','http'); //cache_me('/xul/server/admin/adminlib.js','http'); //cache_me('/xul/server/admin/admin.css','http'); diff --git a/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul b/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul deleted file mode 100644 index bd8f0776c4..0000000000 --- a/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - -