"Items Ready For Pickup" works
authorsenator <lebbeous@esilibrary.com>
Tue, 15 Feb 2011 18:37:47 +0000 (13:37 -0500)
committersenator <lebbeous@esilibrary.com>
Tue, 15 Feb 2011 18:37:47 +0000 (13:37 -0500)
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.

Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/web/css/skin/default/opac/semiauto.css
Open-ILS/web/templates/default/opac/login.tt2
Open-ILS/web/templates/default/opac/myopac/circs.tt2
Open-ILS/web/templates/default/opac/myopac/holds.tt2
Open-ILS/web/templates/default/opac/myopac/main.tt2
Open-ILS/web/templates/default/opac/parts/login/form.tt2

index dd89852..fb15179 100644 (file)
@@ -34,6 +34,7 @@ sub fetch_user_holds {
     my $hold_ids = shift;
     my $ids_only = shift;
     my $flesh = shift;
+    my $available = shift;
     my $limit = shift;
     my $offset = shift;
 
@@ -91,6 +92,10 @@ sub fetch_user_holds {
         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);
@@ -167,10 +172,11 @@ sub load_myopac_holds {
     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;
 }
index 61355d6..6902837 100644 (file)
@@ -85,7 +85,8 @@
 .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; }
index 67e76f1..0265f71 100644 (file)
         <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 %]
index 77ba056..8d7fa21 100644 (file)
@@ -33,8 +33,7 @@
     </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>
index 6c6cafe..bf0932e 100644 (file)
     </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>
@@ -31,8 +36,7 @@
     </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") %] &nbsp; &nbsp;
+                    [% 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 %] &nbsp; &nbsp;
+                    [% l("holds") %]
                     <select class="hide_me" id="holds_sort">
                         <option value="">-- Sort By --</option>
                         <option value="title">Title</option>
index dd0d5cc..2d7b375 100644 (file)
@@ -83,7 +83,7 @@
                                 </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>
index 38a6a2d..c0624ae 100644 (file)
                             </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>