implemented holds history template w/ links to/from active holds page; TODO: verify...
authorberick <berick@esilibrary.com>
Tue, 29 Mar 2011 14:29:27 +0000 (10:29 -0400)
committerberick <berick@esilibrary.com>
Tue, 29 Mar 2011 14:29:27 +0000 (10:29 -0400)
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/web/templates/default/opac/myopac/hold_history.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/opac/myopac/holds.tt2

index 99223c1..3ad5525 100644 (file)
@@ -408,6 +408,7 @@ sub load_myopac_circ_history {
     return Apache2::Const::OK;
 }
 
+# TODO: action.usr_visible_holds does not return cancelled holds.  Should it?
 sub load_myopac_hold_history {
     my $self = shift;
     my $e = $self->editor;
diff --git a/Open-ILS/web/templates/default/opac/myopac/hold_history.tt2 b/Open-ILS/web/templates/default/opac/myopac/hold_history.tt2
new file mode 100644 (file)
index 0000000..e2151e2
--- /dev/null
@@ -0,0 +1,123 @@
+[%  PROCESS "default/opac/parts/header.tt2";
+    PROCESS "default/opac/parts/marc_misc.tt2";
+    WRAPPER "default/opac/parts/base.tt2" +
+        "default/opac/parts/myopac/base.tt2";
+    myopac_page = "holds"  
+    limit = CGI.param('limit') || 25;
+    offset = CGI.param('offset') || 0;
+%]
+
+<div id='myopac_holds_div'>
+
+    <div id="acct_holds_tabs" style="padding-bottom: 12px;color:#666;">
+        <div class="align selected">
+            <a href='holds'><img src="[% ctx.media_prefix %]/images/sub_holds_off.jpg"/></a>
+        </div>
+        <div class="align">
+            <img src="[% ctx.media_prefix %]/images/sub_holds_hist_on.jpg"/>
+        </div>
+        <div class="clear-both"></div>
+    </div>
+
+    <div class="header_middle">
+        <span id="acct_holds_header" style="float:left;">
+            [% l("Previously Held Items") %]
+        </span>
+        <span style="float:right;">
+            <a class="hide_me" href="#">Export List</a>
+        </span>
+    </div>
+    <div class="clear-both"></div>
+
+    <div id='holds_main'>
+        [% IF ctx.holds.size < 1 %]
+        <div class="opac-auto-079">
+            <big><strong>[% l('No holds found.') %]</strong></big>
+        </div>
+        [% ELSE %]
+        <table style='border-collapse:collapse; width: 100%;'>
+            <thead id='acct_holds_main_header'>
+                <tr>
+                    <td width="138"><span>[% l('Title') %]</span></td>
+                    <td width="123"><span>[% l('Author') %]</span></td>
+                    <td width="64"> <span>[% l('Format') %]</span></td>
+                    <td width="136"><span>[% l('Pickup Location') %]</span> </td>
+                    <td width="104">[% l('Active On') %]</td>
+                    <td width="95">[% l('Active') %]</td>
+                    <td width="106">[% l('Date Fulfilled') %]</td>
+                    <td width="172"><span>[% l('Status') %]</span></td>
+                </tr>
+            </thead>
+            <tbody>
+                [% FOR hold IN ctx.holds;
+                    attrs = {marc_xml => hold.marc_xml};
+                    PROCESS get_marc_attrs args=attrs;
+                    ahr = hold.hold.hold %]
+
+                <tr id="acct_holds_temp" name="acct_holds_temp" class="acct_holds_temp">
+
+                    <td width="138">
+                        <div style="margin-top:10px;margin-bottom:10px;">
+                            <a href="[% ctx.opac_root %]/record/[% hold.hold.bre.id %]">[% attrs.title | html %]</a>
+                        </div>
+                    </td>
+                    <td width="123">
+                        <div style="margin-top:10px;margin-bottom:10px;">
+                            <a href="[% ctx.opac_root %]/results?qtype=author&query=[% attrs.author | replace('[,\.:;]', '') | url %]">[% attrs.author | html %]</a>
+                        </div>
+                    </td>
+                    <td width="64">
+                        <div style="width:26px;height:23px;margin-top:6px;margin-bottom:6px;">
+                            [% IF attrs.format_icon %]
+                            <img src="[% ctx.media_prefix %]/images/[% attrs.form_icon %]"
+                                title="[% attrs.format %]" alt="[% attrs.format %]" />
+                            [% ELSE;
+                                attrs.format;
+                               END %]
+                        </div>
+                    </td>
+                    <td width="136">
+                        [% ctx.find_aou(ahr.pickup_lib).name %]
+                    </td>
+                    <td width="104">
+                        [% IF ahr.frozen == 't' AND ahr.thaw_date;
+                            date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT);
+                        END %]
+                    </td>
+                    <td width="95">
+                        [% l(ahr.frozen == 'f' ? 'Active' : 'Suspended') %]
+                    </td>
+                    <td width="106">
+                        [% IF ahr.fulfillment_time;
+                            date.format(ctx.parse_datetime(ahr.fulfillment_time), DATE_FORMAT);
+                        END %]
+                    </td>
+                    <td width="110">
+                        <div name="acct_holds_status"
+                            style="margin-top:10px;margin-bottom:10px;">
+                            [%
+                                IF hold.hold.status == 4;
+                                    l("Available");
+                                    IF ahr.shelf_expire_time;
+                                        l('<br/>Expires [_1]', 
+                                            date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT));
+                                    END;
+                                ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0;
+                                    # estimated wait is delivered as seconds.
+                                    SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400);
+                                    l("Estimated wait: [quant,_1,day,days]", hwait);
+                                ELSIF hold.hold.status == 3;
+                                    l("In Transit");
+                                ELSIF hold.hold.status < 3;
+                                    l("Waiting for copy");
+                                END;
+                            %]
+                        </div>
+                    </td>
+                </tr>
+                [% END %]
+            </tbody>
+        </table>
+        [% END %]
+    </div>
+[% END %]
index cd4ce31..f0691de 100644 (file)
@@ -4,23 +4,17 @@
         "default/opac/parts/myopac/base.tt2";
     myopac_page = "holds"  %]
 <div id='myopac_holds_div'>
-    <div id="acct_holds_tabs" style="padding-bottom: 12px;color:#666;" class="hide_me">
-        <div class="align selected" id="holds_label">
-            <img src="[% ctx.media_prefix %]/images/sub_holds_on.jpg" />
-        </div>
-        <div class="align hide_me" id="holds_hist_link">
-            <a href="#"><img
-                src="[% ctx.media_prefix %]/images/sub_holds_hist_off.jpg" /></a>
+
+    <div id="acct_holds_tabs" style="padding-bottom: 12px;color:#666;">
+        <div class="align selected">
+            <img src="[% ctx.media_prefix %]/images/sub_holds_on.jpg"/>
         </div>
-        <div class="align hide_me" id="holds_link">
-            <a href="#"><img
-                src="[% ctx.media_prefix %]/images/sub_holds_off.jpg" /></a>
+        <div class="align">
+            <a href='hold_history'><img src="[% ctx.media_prefix %]/images/sub_holds_hist_off.jpg"/></a>
         </div>
-        <div class="align selected hide_me" id="holds_hist_label">
-            <img src="[% ctx.media_prefix %]/images/sub_holds_hist_on.jpg" />
-        </div> 
         <div class="clear-both"></div>
     </div>
+
     <div class="header_middle">
         <span id="acct_holds_header" style="float:left;">
             [%  IF CGI.param("available");