From: erickson Date: Wed, 23 Sep 2009 14:09:31 +0000 (+0000) Subject: return any notes attached to the captured hold on checkin so the UI does not have... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e9ec84381ad46e0ec577ff2ed9d94c0cab80a711;p=evergreen%2Fmasslnc.git return any notes attached to the captured hold on checkin so the UI does not have to re-fetch them. some mild code cleanup/optimization git-svn-id: svn://svn.open-ils.org/ILS/trunk@14113 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index 7119135ddb..d998e97537 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -2458,21 +2458,24 @@ sub checkin_flesh_events { $self->events([grep { $_->{textcode} eq 'ITEM_NOT_CATALOGED' } @{$self->events}]); } + my $record = U->record_to_mvr($self->title) if($self->title and !$self->is_precat); + + my $hold; + if($self->hold and !$self->hold->cancel_time) { + $hold = $self->hold; + $hold->notes($self->editor->search_action_hold_request_note({hold => $hold->id})); + } for my $evt (@{$self->events}) { - my $payload = {}; - $payload->{copy} = $U->unflesh_copy($self->copy); - $payload->{record} = $U->record_to_mvr($self->title) if($self->title and !$self->is_precat); - $payload->{circ} = $self->circ; - $payload->{transit} = $self->transit; + my $payload = {}; + $payload->{copy} = $U->unflesh_copy($self->copy); + $payload->{record} = $record, + $payload->{circ} = $self->circ; + $payload->{transit} = $self->transit; $payload->{cancelled_hold_transit} = 1 if $self->cancelled_hold_transit; - - # $self->hold may or may not have been replaced with a - # valid hold after processing a cancelled hold - $payload->{hold} = $self->hold unless (not $self->hold or $self->hold->cancel_time); - - $evt->{payload} = $payload; + $payload->{hold} = $hold; + $evt->{payload} = $payload; } }