This uses the holds page of myopac with a special param.
Also, tiny bit of JS just to focus the username field on the login page.
Couldn't resist.
my $hold_ids = shift;
my $ids_only = shift;
my $flesh = shift;
+ my $available = shift;
my $limit = shift;
my $offset = shift;
last if $first and not @ses;
if(@collected) {
+ # If desired by the caller, filter any holds that are not available.
+ if ($available) {
+ @collected = grep { $_->{hold}->{status} == 4 } @collected;
+ }
while(my $blob = pop(@collected)) {
$blob->{marc_xml} = XML::LibXML->new->parse_string($blob->{hold}->{bre}->marc) if $flesh;
push(@holds, $blob);
my $limit = $self->cgi->param('limit') || 0;
my $offset = $self->cgi->param('offset') || 0;
my $action = $self->cgi->param('action') || '';
+ my $available = int($self->cgi->param('available'));
$self->handle_hold_update($action) if $action;
- $ctx->{holds} = $self->fetch_user_holds(undef, 0, 1, $limit, $offset);
+ $ctx->{holds} = $self->fetch_user_holds(undef, 0, 1, $available, $limit, $offset);
return Apache2::Const::OK;
}
.opac-auto-094 { padding: 5px 7px 0px 0px; }
.opac-auto-095 { padding: 5px 7px 0px 0px; white-space: nowrap; }
.opac-auto-096 { padding: 6px }
-.opac-auto-097 { padding: 8px 0px 6px 0px; }
+.opac-auto-097 { padding: 8px 0px 6px 0px; width: 100%; border: 0; }
+.opac-auto-097b { padding: 8px 0px 6px 0px; border: 0; }
.opac-auto-098 { padding-bottom: 10px; }
.opac-auto-099 { padding-bottom: 12px; color: #666; }
.opac-auto-100 { padding-bottom: 16px; }
<div id="main-content">
[% INCLUDE "default/opac/parts/login/form.tt2" %]
<div class="clear-both very-big-height"></div>
+ <script type="text/javascript">
+ var _onload = window.onload;
+ window.onload = function() {
+ try {
+ document.getElementById("username_field").focus();
+ if (_onload) _onload();
+ } catch (E) {
+ void(0);
+ }
+ };
+ </script>
</div>
</div>
[% END %]
</div>
<div class="clear-both"></div>
<div id='checked_main'>
- <table cellpadding='0' cellspacing='0' border='0'
- style="padding:8px 0px 6px 0px;">
+ <table cellpadding='0' cellspacing='0' class="opac-auto-097b">
<tr>
<td>
<a href="#">Renew Selected Titles</a>
</div>
<div class="header_middle">
<span id="acct_holds_header" style="float:left;">
- Current Items on Hold
+ [% IF CGI.param("available");
+ l("Items Ready for Pickup");
+ ELSE;
+ l("Current Items on Hold");
+ END
+ %]
</span>
<span style="float:right;">
<a class="hide_me" href="#">Export List</a>
</div>
<div class="clear-both"></div>
<div id='holds_main'>
- <table cellpadding='0' cellspacing='0' border='0'
- style="padding:8px 0px 6px 0px;">
+ <table cellpadding='0' cellspacing='0' class="opac-auto-097">
<tr>
<td width="1">
<select id="acct_holds_actions">
src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
</td>
<td align="right">
+ [% l("Show") %]
+ [% IF CGI.param("available") %]
+ <a href="holds">[% l('all') %]</a> |
+ <strong>[% l("only available") %]</strong>
+ [% ELSE %]
+ <strong>[% l("all") %]</strong> |
+ <a href="holds?available=1">[% l("only available") %]</a>
+ [% END %]
+ [% l("holds") %]
<select class="hide_me" id="holds_sort">
<option value="">-- Sort By --</option>
<option value="title">Title</option>
</span>
</td>
<td align="right" class="view_link">
- <a href="#">View All</a>
+ <a href="[% ctx.opac_root %]/myopac/holds?available=1">View All</a>
</td>
</tr>
</table>
</td>
<td width="58%" valign="top">
<div class="input_bg">
- <input type="text" name="username"/>
+ <input type="text" id="username_field" name="username"/>
</div>
</td>
</tr>