$ctx->{copies} = $copy_rec->gather(1);
# Add public copy notes to each copy - and while we're in there, grab peer bib records
+ my %cached_bibs = ();
foreach my $copy (@{$ctx->{copies}}) {
$copy->{notes} = $U->simplereq(
'open-ils.circ',
$self->timelog("past peer bib id retrieval");
my @peer_marc;
foreach my $bib (@{$copy->{peer_bibs}}) {
+ next if $bib eq $ctx->{bre_id};
+ next if $cached_bibs{$bib};
my (undef, @peer_data) = $self->get_records_and_facets(
[$bib], undef, {
- flesh => '{holdings_xml,acp,acnp,acns,exclude_invisible_acn}',
+ flesh => '{}',
site => $org_name,
depth => $depth,
pref_lib => $pref_ou
});
+ $cached_bibs{$bib} = 1;
#$copy->{peer_bib_marc} = $peer_data[0]->{marc_xml};
push @peer_marc, $peer_data[0]->{marc_xml};
+ $self->timelog("fetched peer bib record $bib");
}
$copy->{peer_bib_marc} = \@peer_marc;
- $self->timelog("past peer bib record retrieval");
}
$self->timelog("past store copy retrieval call");
</tr>
</thead>
<tbody class="copy_details_table">
+[%- FOREACH peer IN ctx.foreign_copies;
+ FOREACH bib IN peer.foreign_copy_maps; %]
+ <tr><td>
+ [%- bib_lib_name = ctx.get_aou(bib.target_copy.circ_lib).name | html;
+ l("[_1] (foreign item)", bib_lib_name); -%]
+ <ul><li>
+ <span class="bib_peer_type">[% bib.peer_type.name | html %]</span>:
+ <a href="[% mkurl(ctx.opac_root _ '/record/' _ bib.target_copy.call_number.record) %]">
+ <span class="bib_peer_title">[% peer.title | html %]</span> /
+ <span class="bib_peer_author">[% peer.author | html %]</span>
+ </a>
+ </li></ul>
+ </td>
+ <td>[% bib.target_copy.call_number.label | html %]</td>
+ <td>[% bib.target_copy.barcode | html %]</td>
+ <td>[% copy_info.copy_location | html %]</td>
+ <td>[% copy_info.copy_status | html %]</td>
+ <td>[% copy_info.due_date | html %]</td>
+</tr>
+ [%- END; # FOREACH peer
+END; # FOREACH bib
+-%]
[%- last_cn = 0;
FOR copy_info IN copies;
callnum = copy_info.call_number_label;
[% 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; # FOREACH peer
-[%- END; # FOREACH bib
<tr><td>
[%- IF copy_info.peer_bib_marc.size > 1;
'<ul>';
attrs = {marc_xml => bib};
PROCESS get_marc_attrs args=attrs %]
[%- IF attrs.bibid != ctx.bre_id; %]
- <li><a href="[% mkurl(ctx.opac_root _ '/record/' _ attrs.bibid) %]"> [% attrs.title %] / [% attrs.author %]</a></li>
-[%- END; # IF attrs.bibid
+ <li><a href="[% mkurl(ctx.opac_root _ '/record/' _ attrs.bibid) %]">[% attrs.title | html %] / [% attrs.author | html %]</a></li>
+[%- END; # IF attrs.bibid %]
[%- END; # FOREACH bib in copy_info.peer_bib_marc
'</ul>';
END # IF copy_info.peer_bib_marc.size
%]
</td></tr>
- [%- END %]
+[%- END; # FOR copy_info
+%]
<tr>
[%- IF ctx.copy_offset > 0 AND NOT serial_holdings;
new_offset = ctx.copy_offset - ctx.copy_limit;