From be39ff071609b8061c5f7b0959285de34a6c6dd4 Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 20 Apr 2011 19:05:05 +0000 Subject: [PATCH] send the volume along in the payload for circ functions. Render CN prefixes/suffixes correctly in xul lists if they're not fleshed git-svn-id: svn://svn.open-ils.org/ILS/trunk@20258 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm | 3 +++ Open-ILS/xul/staff_client/server/circ/checkin.js | 1 + Open-ILS/xul/staff_client/server/circ/checkout.js | 3 ++- Open-ILS/xul/staff_client/server/circ/renew.js | 1 + Open-ILS/xul/staff_client/server/circ/util.js | 11 ++++++++--- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index 20139f83a8..e4bb90f6a2 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -236,6 +236,7 @@ sub run_method { $circulator->editor->update_asset_copy($copy); $success_event->{"payload"}->{"record"} = $U->record_to_mvr($copy->call_number->record); + $success_event->{"payload"}->{"volume"} = $copy->call_number; $copy->call_number($copy->call_number->id); $success_event->{"payload"}->{"copy"} = $copy; } @@ -1497,6 +1498,7 @@ sub do_checkout { OpenILS::Event->new('SUCCESS', payload => { copy => $U->unflesh_copy($self->copy), + volume => $self->volume, circ => $self->circ, record => $record, holds_fulfilled => $self->fulfilled_holds, @@ -3189,6 +3191,7 @@ sub checkin_flesh_events { my $payload = {}; $payload->{copy} = $U->unflesh_copy($self->copy); + $payload->{volume} = $self->volume; $payload->{record} = $record, $payload->{circ} = $self->circ; $payload->{transit} = $self->transit; diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index bc8ad97a02..7997ab52a1 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -613,6 +613,7 @@ circ.checkin.prototype = { 'mbts' : checkin.circ ? checkin.circ.billable_transaction().summary() : null, 'mvr' : checkin.record, 'acp' : checkin.copy, + 'acn' : checkin.volume, 'au' : checkin.patron, 'status' : checkin.status, 'route_to' : checkin.route_to, diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js index a9319f0293..9849b40b4e 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkout.js +++ b/Open-ILS/xul/staff_client/server/circ/checkout.js @@ -426,7 +426,8 @@ circ.checkout.prototype = { 'my' : { 'circ' : checkout.payload.circ, 'mvr' : checkout.payload.record, - 'acp' : checkout.payload.copy + 'acp' : checkout.payload.copy, + 'acn' : checkout.payload.volume } }, 'to_top' : true diff --git a/Open-ILS/xul/staff_client/server/circ/renew.js b/Open-ILS/xul/staff_client/server/circ/renew.js index b0ff2dabb4..8dbe7c27a5 100644 --- a/Open-ILS/xul/staff_client/server/circ/renew.js +++ b/Open-ILS/xul/staff_client/server/circ/renew.js @@ -354,6 +354,7 @@ circ.renew.prototype = { 'mbts' : renew.parent_circ ? renew.parent_circ.billable_transaction().summary() : null, 'mvr' : renew.record, 'acp' : renew.copy, + 'acn' : renew.volume, 'au' : renew.patron, 'status' : renew.status, 'route_to' : renew.route_to, diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index a2a57893d8..3e13c55600 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -639,7 +639,9 @@ circ.util.columns = function(modify,params) { 'hidden' : true, 'editable' : false, 'render' : function(my) { if (typeof my.acn == 'undefined') return ''; - return (typeof my.acn.prefix() == 'object') ? my.acn.prefix().label() : my.acn.prefix(); + return (typeof my.acn.prefix() == 'object') + ? my.acn.prefix().label() + : data.hash.acnp[ my.acn.prefix() ].label(); }, 'persist' : 'hidden width ordinal' }, @@ -652,7 +654,9 @@ circ.util.columns = function(modify,params) { 'hidden' : true, 'editable' : false, 'render' : function(my) { if (typeof my.acn == 'undefined') return ''; - return (typeof my.acn.suffix() == 'object') ? my.acn.suffix().label() : my.acn.suffix(); + return (typeof my.acn.suffix() == 'object') + ? my.acn.suffix().label() + : data.hash.acns[ my.acn.suffix() ].label(); }, 'persist' : 'hidden width ordinal' }, @@ -2501,11 +2505,12 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che JSAN.use('util.date'); JSAN.use('util.sound'); var sound = new util.sound(); - error.sdump('D_DEBUG','check = ' + error.pretty_print( js2JSON( check ) ) ); + dump('check = ' + error.pretty_print( js2JSON( check ) ) + '\n' ); check.message = check.textcode; if (check.payload && check.payload.copy) { check.copy = check.payload.copy; } + if (check.payload && check.payload.volume) { check.volume = check.payload.volume; } if (check.payload && check.payload.record) { check.record = check.payload.record; } if (check.payload && check.payload.circ) { check.circ = check.payload.circ; } if (check.payload && check.payload.patron) { check.patron = check.payload.patron; } -- 2.11.0