scalar(@{$ctx->{holding_summaries}->{supplement}});
}
+ # XXX probably should replace the following with a dispatch table
for my $expand ($self->cgi->param('expand')) {
$ctx->{"expand_$expand"} = 1;
if ($expand eq 'marchtml') {
} elsif ($expand eq 'issues' and $ctx->{have_holdings_to_show}) {
$ctx->{expanded_holdings} =
$self->get_expanded_holdings($rec_id, $org, $depth);
+ } elsif ($expand eq 'cnbrowse') {
+ $ctx->{browsed_call_numbers} = $self->browse_call_numbers();
}
+
}
return Apache2::Const::OK;
)->gather(1);
}
+sub any_call_number_label {
+ my ($self) = @_;
+
+ if ($self->ctx->{copies} and @{$self->ctx->{copies}}) {
+ return $self->ctx->{copies}->[0]->{call_number_label};
+ } else {
+ return;
+ }
+}
+
+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, map { $self->cgi->param($_) } qw/loc cnoffset/, 9
+ )->gather(1);
+}
sub get_hold_copy_summary {
my ($self, $rec_id, $org) = @_;
+++ /dev/null
-<!-- ****************** cn_browse.xml ***************************** -->
-<div id='cn_browse' class='cn_browser'>
- <div id='cn_browse_loading' class='cn_browse_loading hide_me'>
- [% l("Loading Callnumber Page...") %]
- </div>
- <div id='cn_browse_div'>
- <div class='color_4'>
- <span>[% l("You are now browsing") %]</span>
- <b id='cn_browse_where'> </b>
- </div>
- <table class='data_grid bookshelf' width='100%'>
- <thead>
- <tr>
- <td>
- <a id='cn_browse_next' class='classic_link'
- href='javascript:cnBrowsePrev();'><b>[% l("<< Previous Page") %]</b></a>
- </td>
- <td colspan='1' align='center'>[% l("Shelf Browser") %]</td>
- <td>
- <a id='cn_browse_prev' class='classic_link'
- href='javascript:cnBrowseNext();'><b>[% l("Next Page >>") %]</b></a>
- </td>
- </tr>
- </thead>
- <tbody id='cn_tbody'>
- <tr id='cn_browse_row'>
- <td id='cn_browse_td' class='cn_browse_item' width='25%' valign='top'>
- <a><img height='60' width='50'
- class='cn_browse_info' name='cn_browse_pic' border='0' /></a>
- <div class='cn_browse_info bold' name='cn_browse_cn'></div>
- <div class='cn_browse_info'>
- <a name='cn_browse_title' class='classic_link'></a>
- </div>
- <div class='cn_browse_info'>
- <a name='cn_browse_author' class='classic_link'> </a>
- </div>
- <div class='cn_browse_info' name='cn_browse_lib'> </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
-</div>
-<!-- ****************** end: cn_browse.xml ***************************** -->
--- /dev/null
+<div id='cn_browse' class='cn_browser'>
+ <div id='cn_browse_div'>
+ <div class='color_4'>
+ <span>[% l("You are now browsing") %]</span>
+ <strong>[% ctx.get_aou(CGI.param('loc')).name %]</strong>
+ </div>
+ <table class='data_grid bookshelf' width='100%'>
+ <thead>
+ <tr>
+ <td>[% IF CGI.param("cnoffset") > 0 %]
+ <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>
+ [% END %]</td>
+ <td colspan='1' align='center'>[% l("Shelf Browser") %]</td>
+ <td>[% IF ctx.browsed_call_numbers.size == 9 %]
+ <a id='cn_browse_next' class='classic_link' href="[% ctx.opac_root %]/record/[% ctx.bre_id _ extras_propagator _ '&cnoffset=' _ ((CGI.param('cnoffset') || 0) + 1) _ '&expand=cnbrowse#cnbrowse' %]"<b>[%
+ l("Next Page >>")
+ %]</b></a>
+ [% END %]</td>
+ </tr>
+ </thead>
+ <tbody id='cn_tbody'>
+ [% tr_open = 0; FOR ent 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'
+ class='cn_browse_info' name='cn_browse_pic' border='0'
+ src="[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ent.mods.isbn %]" /></a>
+ [% END %]
+ <div class='cn_browse_info bold' name='cn_browse_cn'>[% ent.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>
+ </div>
+ <div class='cn_browse_info'>
+ <a name='cn_browse_author' class='classic_link'>[% ent.mods.author %]</a>
+ </div>
+ <div class='cn_browse_info' name='cn_browse_lib'>[% ctx.get_aou(ent.cn.owning_lib).name %]</div>
+ </td>
+ [% IF loop.index % 3 == 2; tr_open = 0 %]
+ </tr>
+ [% END %]
+ [% END; IF tr_open %]</tr>[% END %]
+ </tbody>
+ </table>
+ </div>
+</div>
{name => 'excerpt', label => l('Excerpt'), hide => 1},
{name => 'issues', label => l('Issues Held'), hide => !ctx.have_holdings_to_show},
{name => 'preview', label => l('Preview'), hide => 1},
- {name => 'cnbrowse', label => l('Shelf Browser'), hide => 1},
+ {name => 'cnbrowse', label => l('Shelf Browser')},
{name => 'copyinfo', label => l('Copy Summary'), hide => 1},
{name => 'marchtml', label => l('MARC Record')}
];
<div class="rdetail_extras">
<div class="rdetail_extras_hr"></div>
<div class="rdetail_extras_link">
- [% href = ctx.full_path _ '?expand=' _ name _ '#' _ name; %]
+ [% # extras_propagator should be used in place of propagator
+ # in opac extras interfaces... it just avoids duplicating
+ # the expands CGI param and parameters that are specific
+ # to extras.
+ # XXX move this off into a helper function
+
+ extras_propagator = propagator.replace('&expand=.+($|&|;)', '$1');
+ extras_propagator = extras_propagator.replace('&cnoffset=.+($|&|;)', '$1');
+
+
+ href = ctx.full_path _ extras_propagator _ '&expand=' _ name _ '#' _ name; %]
<a name='[% name %]' href='[% href %]'><img
alt='[% extra.label %]' src="[% ctx.media_prefix %]/images/rdetail_arrow.png" /></a>
<a href='[% href %]' class="rdetail_extras_lbl">[% extra.label %]</a>