# record : bre object
sub load_record {
my $self = shift;
- $self->ctx->{page} = 'record';
+ my $ctx = $self->ctx;
+ $ctx->{page} = 'record';
- my $org = $self->cgi->param('loc') || $self->ctx->{aou_tree}->()->id;
+ my $org = $self->cgi->param('loc') || $ctx->{aou_tree}->()->id;
my $depth = $self->cgi->param('depth') || 0;
my $copy_limit = int($self->cgi->param('copy_limit') || 10);
my $copy_offset = int($self->cgi->param('copy_offset') || 0);
- my $rec_id = $self->ctx->{page_args}->[0]
+ my $rec_id = $ctx->{page_args}->[0]
or return Apache2::Const::HTTP_BAD_REQUEST;
# run copy retrieval in parallel to bib retrieval
+ # XXX unapi
my $copy_rec = OpenSRF::AppSession->create('open-ils.cstore')->request(
'open-ils.cstore.json_query.atomic',
$self->mk_copy_query($rec_id, $org, $depth, $copy_limit, $copy_offset));
- $self->ctx->{record} = $self->editor->retrieve_biblio_record_entry($rec_id);
- $self->ctx->{marc_xml} = XML::LibXML->new->parse_string($self->ctx->{record}->marc);
+ my (undef, @rec_data) = $self->get_records_and_facets([$rec_id], undef, {flesh => '{holdings_xml,mra}'});
+ $ctx->{bre_id} = $rec_data[0]->{id};
+ $ctx->{marc_xml} = $rec_data[0]->{marc_xml};
- $self->ctx->{copies} = $copy_rec->gather(1);
- $self->ctx->{copy_limit} = $copy_limit;
- $self->ctx->{copy_offset} = $copy_offset;
+ $ctx->{copies} = $copy_rec->gather(1);
+ $ctx->{copy_limit} = $copy_limit;
+ $ctx->{copy_offset} = $copy_offset;
for my $expand ($self->cgi->param('expand')) {
- $self->ctx->{"expand_$expand"} = 1;
+ $ctx->{"expand_$expand"} = 1;
if($expand eq 'marchtml') {
- $self->ctx->{marchtml} = $self->mk_marc_html($rec_id);
+ $ctx->{marchtml} = $self->mk_marc_html($rec_id);
}
}
<span class='opac-auto-030'>[% l("Author") %]:</span>
<em><a title='[% l("Perform an author search") %]'
id='rdetail_author'
- href="[% ctx.opac_root %]/results?qtype=author&query=[% attrs.author | replace('[,\.:;]', '') | uri %]&loc=[% CGI.param('loc') | uri %]">[% attrs.author %]</a>
- </em>
+ href="[% ctx.opac_root %]/results?qtype=author&query=[%-
+ attrs.author | replace('[,\.:;]', '') | uri %]&loc=[% CGI.param('loc') | uri %]">[% attrs.author %]</a></em>
[% END %]
</td>
<td align="right" valign="top" nowrap="nowrap" style="white-space:nowrap;">
<div style="width:230px;text-align:left;margin-top:3px;">
<div style="float:right;">
<div class="rdetail_aux_utils opac-auto-010">
- <a href="[% ctx.opac_root %]/place_hold[% propagator; propagator.length > 1 ? "&" : ""; %]hold_target=[% record.id %]&hold_type=T" id="rdetail_place_hold" class="no-dec"><img
- src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" />
- <span style="position:relative;top:-3px;left:3px;">Place Hold</span></a>
+ <a href="[% ctx.opac_root %]/place_hold[%-
+ propagator; propagator.length > 1 ? "&" : ""; %]hold_target=[% ctx.bre_id %]&hold_type=T" id="rdetail_place_hold" class="no-dec"><img
+ src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" /><span
+ style="position:relative;top:-3px;left:3px;">[% l('Place Hold') %]</span></a>
</div>
<div class="rdetail_aux_utils opac-auto-121">
- [% operation = ctx.mylist.grep(record.id).size ? "delete" : "add";
- label = (operation == "add") ? "Add to" : "Remove from"; %]
+ [%
+ operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
+ label = (operation == "add") ? l("Add to my list") : l("Remove from my list");
+ %]
<form action="[% ctx.opac_root %]/mylist/[% operation %]" method="POST">
- <input type="hidden" name="record" value="[% record.id %]" />
+ <input type="hidden" name="record" value="[% ctx.bre_id %]" />
<div class="pos-abs">
<div class="opac-auto-149">
- <input type="submit" title="[% l(label _ ' my list') %]" value="[% l(label _ ' my list') %]" class="subtle-button" />
+ <input type="submit" title="[% label %]" value="[% label %]" class="subtle-button" />
</div>
</div>
- <input type="image"
- alt="[% l(label _ ' my list') %]"
+ <input type="image" alt="[% label %]"
src="[% ctx.media_prefix %]/images/clipboard.png" />
</form>
</div>
</div>
<div style="float:right;margin-right:17px;">
- [% IF attrs.format %]
- <img alt="[% attrs.format %]"
- src="[% ctx.media_prefix %]/images/[% attrs.format_icon %]" />
+ [% IF attrs.format_icon %]
+ <img alt="[% attrs.format_label %]" title="[% attrs.format_label %]" src="[% attrs.format_icon %]" />
[% END %]
</div>
</div>
<td>
[%# For some reason, browsers render © (as in, ©_limit=foo) as the copyright
symbol, even though it's inside inside the href attribute string. Use ; instead %]
- <a href="[% ctx.opac_root %]/record/[% record.id %]?copy_offset=[% new_offset %];copy_limit=[% ctx.copy_limit %]">« [%
+ <a href="[% ctx.opac_root %]/record/[% ctx.bre_id %]?copy_offset=[% new_offset %];copy_limit=[% ctx.copy_limit %]">« [%
l('Previous [_1]', ctx.copy_offset - new_offset)
%]</a>
</td>
[% END %]
[% IF ctx.copies.size >= ctx.copy_limit %]
<td>
- <a href="[% ctx.opac_root %]/record/[% record.id %]?copy_offset=[% ctx.copy_offset + ctx.copy_limit %];copy_limit=[% ctx.copy_limit %]">[%
+ <a href="[% ctx.opac_root %]/record/[% ctx.bre_id %]?copy_offset=[% ctx.copy_offset + ctx.copy_limit %];copy_limit=[% ctx.copy_limit %]">[%
l('Next [_1]', ctx.copy_limit)
%] »</a>
</td>
</div>
</td>
<td width="1" valign="top" align="right" style="white-space:nowrap;">
- <a href="[% ctx.opac_root %]/place_hold[% propagator; propagator.length > 1 ? "&" : ""; %]hold_target=[% record.id %]&hold_type=T"><img alt="[% l('Place Hold') %]"
+ <a href="[% ctx.opac_root %]/place_hold[% propagator; propagator.length > 1 ? "&" : ""; %]hold_target=[% ctx.bre_id %]&hold_type=T"><img alt="[% l('Place Hold') %]"
src="[% ctx.media_prefix %]/images/place_hold.gif" /></a>
<a href="#" id="rd_reviews_and_more" target="_blank"><img
alt="[% l('Reviews and More') %]" src="[% ctx.media_prefix %]/images/reviews.gif" /></a>