sub browse_call_numbers {
my ($self) = @_;
- my $cn = $self->any_call_number_label or return [];
-
- my $search = create OpenSRF::AppSession("open-ils.search");
-
- return $search->request(
- "open-ils.search.callnumber.browse",
- $cn, $self->cgi->param("loc"), 9, $self->cgi->param("cnoffset")
- )->gather(1);
+ my $cn = $self->any_call_number_label or
+ return [];
+
+ my $org_unit = $self->ctx->{get_aou}->($self->cgi->param('loc')) ||
+ $self->ctx->{aou_tree}->();
+
+ my $supercat = create OpenSRF::AppSession("open-ils.supercat");
+ my $results = $supercat->request(
+ "open-ils.supercat.call_number.browse",
+ $cn, $org_unit->shortname, 9, $self->cgi->param("cnoffset")
+ )->gather(1) || [];
+
+ return [
+ map {
+ $_->record->marc(
+ (new XML::LibXML)->parse_string($_->record->marc)
+ );
+ $_;
+ } @$results
+ ];
}
sub get_hold_copy_summary {
<thead>
<tr>
<td>
- <a id='cn_browse_prev' class='classic_link' href=">[% ctx.opac_root %]/record/[% ctx.bre_id _ extras_propagator _ '&cnoffset=' _ ((CGI.param('cnoffset') || 0) - 1) _ '&expand=cnbrowse#cnbrowse' %]"<b>[%
+ <a id='cn_browse_prev' class='classic_link' href="[% ctx.opac_root %]/record/[% ctx.bre_id _ extras_propagator _ '&cnoffset=' _ ((CGI.param('cnoffset') || 0) - 1) _ '&expand=cnbrowse#cnbrowse' %]"<b>[%
l("<< Previous Page")
%]</b></a>
</td>
</tr>
</thead>
<tbody id='cn_tbody'>
- [% tr_open = 0; FOR ent IN ctx.browsed_call_numbers %]
+ [% tr_open = 0; FOR cn IN ctx.browsed_call_numbers %]
[%- IF loop.index % 3 == 0; tr_open = 1 %]
<tr id='cn_browse_row'>
[% END -%]
<td id='cn_browse_td' class='cn_browse_item' width='25%' valign='top'>
- [% # Not to extend to life of the mvr fieldmapper class,
- # but should we add a upc field to it to make this better?
- IF ent.mods.isbn %]
- <a href="[% ctx.opac_root %]/record/[% ent.cn.record _ extras_propagator %]"><img height='60' width='50'
+ [% rec_attrs = {marc_xml => cn.record.marc};
+ PROCESS get_marc_attrs args=rec_attrs;
+ ident = rec_attrs.isbn_clean || rec_attrs.upc;
+ IF ident %]
+ <a href="[% ctx.opac_root %]/record/[% cn.record.id _ extras_propagator %]"><img height='60' width='50'
class='cn_browse_info' name='cn_browse_pic' border='0'
- src="[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ent.mods.isbn %]" /></a>
+ src="[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident %]" /></a>
[% END %]
- <div class='cn_browse_info bold' name='cn_browse_cn'>[% ent.cn.label %]</div>
+ <div class='cn_browse_info bold' name='cn_browse_cn'>[% cn.label %]</div>
<div class='cn_browse_info'>
- <a name='cn_browse_title' class='classic_link' href="[% ctx.opac_root %]/record/[% ent.cn.record _ extras_propagator %]">[% ent.mods.title %]</a>
+ <a name='cn_browse_title' class='classic_link' href="[% ctx.opac_root %]/record/[% cn.record.id _ extras_propagator %]">[% rec_attrs.title %]</a>
</div>
- [% IF ent.mods.author %]<div class='cn_browse_info'>
+ [% IF rec_attrs.author %]<div class='cn_browse_info'>
<a name='cn_browse_author' class='classic_link'
- href="[% ctx.opac_root %]/results?qtype=author&query=[%- ent.mods.author | replace('[,\.:;]', '') | uri %]&loc=[% CGI.param('loc') | uri %]">[% ent.mods.author %]</a>
+ href="[% ctx.opac_root %]/results?qtype=author&query=[%- rec_attrs.author | replace('[,\.:;]', '') | uri %]&loc=[% CGI.param('loc') | uri %]">[% rec_attrs.author %]</a>
</div>[% END %]
- <div class='cn_browse_info' name='cn_browse_lib'>[% ctx.get_aou(ent.cn.owning_lib).name %]</div>
+ <div class='cn_browse_info' name='cn_browse_lib'>[% cn.owning_lib.name %]</div>
</td>
[% IF loop.index % 3 == 2; tr_open = 0 %]
</tr>
# to extras.
# XXX move this off into a helper function
- extras_propagator = propagator.replace('&expand=.+($|&|;)', '$1');
- extras_propagator = extras_propagator.replace('&cnoffset=.+($|&|;)', '$1');
+ extras_propagator = propagator.replace('(&)?expand=.+($|&|;)', '$2');
+ extras_propagator = extras_propagator.replace('(&)?cnoffset=.+($|&|;)', '$2');
href = ctx.full_path _ extras_propagator _ '&expand=' _ name _ '#' _ name; %]