From 98d0247bc844fb2239f89380ef6e69fd0c80d55a Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 11 Oct 2006 21:18:11 +0000 Subject: [PATCH] added a circ flesher call git-svn-id: svn://svn.open-ils.org/ILS/trunk@6444 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Circ.pm | 50 +++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm index 5c000f454e..240043cfad 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm @@ -932,6 +932,56 @@ sub magic_fetch { # ---------------------------------------------------------------------- +__PACKAGE__->register_method( + method => "fleshed_circ_retrieve", + api_name => "open-ils.circ.fleshed.retrieve",); + +sub fleshed_circ_retrieve { + my( $self, $client, $id ) = @_; + my $e = new_editor(); + my $circ = $e->retrieve_action_circulation( + [ + $id, + { + flesh => 4, + flesh_fields => { + circ => [ qw/ target_copy / ], + acp => [ qw/ location status stat_cat_entry_copy_maps notes age_protect call_number / ], + ascecm => [ qw/ stat_cat stat_cat_entry / ], + acn => [ qw/ record / ], + } + } + ] + ) or return $e->event; + + my $copy = $circ->target_copy; + my $vol = $copy->call_number; + my $rec = $circ->target_copy->call_number->record; + + $vol->record($rec->id); + $copy->call_number($vol->id); + $circ->target_copy($copy->id); + + my $mvr; + + if( $rec->id == OILS_PRECAT_RECORD ) { + $rec = undef; + $vol = undef; + } else { + $mvr = $U->record_to_mvr($rec); + # trim the buly marc data + $rec->marc(''); + } + + + return { + circ => $circ, + copy => $copy, + volume => $vol, + record => $rec, + mvr => $mvr, + }; +} -- 2.11.0