From: erickson Date: Tue, 14 Sep 2010 19:04:24 +0000 (+0000) Subject: additional issuance holds supporting code; in this case, hold_to_mvr func which is... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=248517ce152a6ecb6b163b7f15fb593219374b81;p=evergreen%2Fbjwebb.git additional issuance holds supporting code; in this case, hold_to_mvr func which is used by the uber hold details method; commit also includes a small speed tweak for fetching details for copy holds (1 less cstore call) git-svn-id: svn://svn.open-ils.org/ILS/trunk@17658 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index 34ec0f2d0..22b218860 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -2463,6 +2463,7 @@ sub find_hold_mvr { my $tid; my $copy; my $volume; + my $issuance; if( $hold->hold_type eq OILS_HOLD_TYPE_METARECORD ) { my $mr = $e->retrieve_metabib_metarecord($hold->target) @@ -2477,11 +2478,21 @@ sub find_hold_mvr { or return $e->event; $tid = $volume->record; + } elsif( $hold->hold_type eq OILS_HOLD_TYPE_ISSUANCE ) { + $issuance = $e->retrieve_serial_issuance([ + $hold->target, + {flesh => 1, flesh_fields => {siss => [ qw/subscription/ ]}} + ]) or return $e->event; + + $tid = $issuance->subscription->record_entry; + } elsif( $hold->hold_type eq OILS_HOLD_TYPE_COPY ) { - $copy = $e->retrieve_asset_copy($hold->target) - or return $e->event; - $volume = $e->retrieve_asset_call_number($copy->call_number) - or return $e->event; + $copy = $e->retrieve_asset_copy([ + $hold->target, + {flesh => 1, flesh_fields => {acp => ['call_number']}} + ]) or return $e->event; + + $volume = $copy->call_number; $tid = $volume->record; } @@ -2496,7 +2507,7 @@ sub find_hold_mvr { # TODO return metarcord mvr for M holds my $title = $e->retrieve_biblio_record_entry($tid); - return ( $U->record_to_mvr($title), $volume, $copy ); + return ( $U->record_to_mvr($title), $volume, $copy, $issuance ); }