$self->mk_copy_query($rec_id, $org, $copy_depth, $copy_limit, $copy_offset, $pref_ou)
);
+ # find foreign copy data
+ my $peer_rec = $U->simplereq(
+ 'open-ils.search',
+ 'open-ils.search.peer_bibs', $rec_id );
+
+ $ctx->{foreign_copies} = $peer_rec;
+
my (undef, @rec_data) = $self->get_records_and_facets([$rec_id], undef, {
flesh => '{holdings_xml,bmp,mra,acp,acnp,acns}',
site => $org_name,
$ctx->{copies} = $copy_rec->gather(1);
- # Add public copy notes to each copy
+ # Add public copy notes to each copy - and while we're in there, grab peer bib records
foreach my $copy (@{$ctx->{copies}}) {
$copy->{notes} = $U->simplereq(
'open-ils.circ',
'open-ils.circ.copy_note.retrieve.all',
{itemid => $copy->{id}, pub => 1 }
);
+ $copy->{peer_bibs} = $U->simplereq(
+ 'open-ils.search',
+ 'open-ils.search.multi_home.bib_ids.by_barcode',
+ $copy->{barcode} );
+ my @peer_marc;
+ foreach my $bib (@{$copy->{peer_bibs}}) {
+ my (undef, @peer_data) = $self->get_records_and_facets(
+ [$bib], undef, {
+ flesh => '{holdings_xml,acp,acnp,acns,exclude_invisible_acn}',
+ site => $org_name,
+ depth => $depth,
+ pref_lib => $pref_ou
+ });
+ #$copy->{peer_bib_marc} = $peer_data[0]->{marc_xml};
+ push @peer_marc,$peer_data[0]->{marc_xml};
+ }
+ $copy->{peer_bib_marc} = \@peer_marc;
}
$self->timelog("past store copy retrieval call");
[% END %]
[% END %]
+[% FOREACH peer IN ctx.foreign_copies %]
+ [% FOREACH bib IN peer.foreign_copy_maps %]
+ <tr><td>
+ [% ctx.get_aou(bib.target_copy.circ_lib).name %]
+ </td><td>
+ <a href="[% mkurl(ctx.opac_root _ '/record/' _ bib.target_copy.call_number.record) %]">[% bib.target_copy.call_number.label %]</a>
+ </td><td>
+ [% bib.target_copy.barcode %]
+ </td><td>
+ [% copy_info.copy_location %]
+ </td><td>
+ [% copy_info.copy_status %]
+ </td><td>
+ [% copy_info.due_date %]
+ </td></tr>
+ [% END %]
+[% END %]
+<tr><td>
+[% FOREACH bib IN copy_info.peer_bib_marc;
+ attrs = {marc_xml => bib};
+ PROCESS get_marc_attrs args=attrs %]
+[% IF attrs.bibid != ctx.bre_id %]
+<a href="[% mkurl(ctx.opac_root _ '/record/' _ attrs.bibid) %]"> [% attrs.title %] / [% attrs.author %]</a><br/>
+[% END %]
+[% END %]
+</td></tr>
+
[%- END %]
<tr>
[%- IF ctx.copy_offset > 0 AND NOT serial_holdings;