LP#1612274: Improve display of holds status in My Account
authorKathy Lussier <klussier@masslnc.org>
Thu, 11 Aug 2016 03:41:51 +0000 (23:41 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 24 Aug 2016 14:23:22 +0000 (10:23 -0400)
Collapse the data contained in the Activate, Active, and Date Fulfilled columns
into the status filed on the My Account holds and holds history interfaces.
This change cleans up the display and removes extraneous information that the
user doesn't need to see.

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
Open-ILS/src/templates/opac/css/style.css.tt2
Open-ILS/src/templates/opac/myopac/hold_history.tt2
Open-ILS/src/templates/opac/myopac/holds.tt2
Open-ILS/src/templates/opac/parts/hold_status.tt2

index 65c3a6f..021d3bb 100644 (file)
@@ -1231,6 +1231,7 @@ Returns event on error or:
  6 for 'canceled'
  7 for 'suspended'
  8 for 'captured, on wrong hold shelf'
+ 9 for 'fulfilled'
 END_OF_DESC
         }
     }
@@ -1263,6 +1264,9 @@ sub _hold_status {
     if ($hold->current_shelf_lib and $hold->current_shelf_lib ne $hold->pickup_lib) {
         return 8;
     }
+    if ($hold->fulfillment_time) {
+        return 9;
+    }
     return 1 unless $hold->current_copy;
     return 2 unless $hold->capture_time;
 
index b266730..7f2c933 100644 (file)
@@ -2079,19 +2079,14 @@ a.preflib_change {
         table#acct_holds_main_header td:nth-of-type(3):before { content: "[% l('Author') %]"; }
         table#acct_holds_main_header td:nth-of-type(4):before { content: "[% l('Format') %]"; }
         table#acct_holds_main_header td:nth-of-type(5):before { content: "[% l('Pickup Location') %]"; }
-        table#acct_holds_main_header td:nth-of-type(6):before { content: "[% l('Activate') %]"; }
-        table#acct_holds_main_header td:nth-of-type(7):before { content: "[% l('Cancel on') %]"; }
-        table#acct_holds_main_header td:nth-of-type(8):before { content: "[% l('Active') %]"; }
-        table#acct_holds_main_header td:nth-of-type(9):before { content: "[% l('Status') %]"; }
+        table#acct_holds_main_header td:nth-of-type(6):before { content: "[% l('Cancel on') %]"; }
+        table#acct_holds_main_header td:nth-of-type(7):before { content: "[% l('Status') %]"; }
         table#acct_holds_main_header td.hold_notes:before { content: "[% l('Notes') %]"; }
 
         table#acct_holds_hist_header td:nth-of-type(1):before { content: "[% l('Title') %]";}
         table#acct_holds_hist_header td:nth-of-type(2):before { content: "[% l('Author') %]"; }
         table#acct_holds_hist_header td:nth-of-type(3):before { content: "[% l('Format') %]"; }
         table#acct_holds_hist_header td:nth-of-type(4):before { content: "[% l('Pickup Location') %]"; }
-        table#acct_holds_hist_header td:nth-of-type(5):before { content: "[% l('Activate') %]"; }
-        table#acct_holds_hist_header td:nth-of-type(6):before { content: "[% l('Active') %]"; }
-        table#acct_holds_hist_header td:nth-of-type(7):before { content: "[% l('Date Fulfilled') %]"; }
         table#acct_holds_hist_header td:nth-of-type(8):before { content: "[% l('Status') %]"; }
 
 
index a142bf5..44178b7 100644 (file)
         <table id='acct_holds_hist_header' class='table_no_border_space table_no_cell_pad' title="[% l('History of items on hold') %]">
             <thead>
                 <tr>
-                    <th><span>[% l('Title') %]</span></td>
-                    <th><span>[% l('Author') %]</span></td>
-                    <th> <span>[% l('Format') %]</span></td>
-                    <th><span>[% l('Pickup Location') %]</span> </td>
-                    <th>[% l('Activate') %]</td>
-                    <th>[% l('Active') %]</td>
-                    <th>[% l('Date Fulfilled') %]</td>
-                    <th><span>[% l('Status') %]</span></td>
+                    <td><span>[% l('Title') %]</span></td>
+                    <td><span>[% l('Author') %]</span></td>
+                    <td> <span>[% l('Format') %]</span></td>
+                    <td><span>[% l('Pickup Location') %]</span> </td>
+                    <td><span>[% l('Status') %]</span></td>
                 </tr>
             </thead>
             <tbody id='holds_temp_parent'>
                         [% ctx.get_aou(ahr.pickup_lib).name | html %]
                     </td>
                     <td>
-                        [% IF ahr.frozen == 't' AND ahr.thaw_date;
-                            date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT);
-                        END %]
-                    </td>
-                    <td>
-                        [% IF ahr.fulfillment_time;
-                             l('Fulfilled');
-                           ELSIF hold.hold.status == 6;
-                             l('Canceled'); 
-                           ELSE; 
-                             l(ahr.frozen == 'f' ? 'Active' : 'Suspended');
-                        END %]
-                    </td>
-                    <td>
-                        [% IF ahr.fulfillment_time;
-                            date.format(ctx.parse_datetime(ahr.fulfillment_time), DATE_FORMAT);
-                        END %]
-                    </td>
-                    <td>
                         <div name="acct_holds_status">
                             [% PROCESS get_hold_status hold=hold; %]
                         </div>
index 6c28275..7fc808c 100644 (file)
                 <th>[% sort_head("author", l('Author')) %]</th>
                 <th>[% sort_head("format", l('Format')) %]</th>
                 <th>[% l('Pickup Location') %]</th>
-                <th>[% l('Activate') %]</th>
                 <th>[% l('Cancel if not filled by') %]</th>
-                <th>[% l('Active') %]</th>
                 <th>[% l('Status') %]</th>
                 <th>[% l('Notes') %]</th>
             </tr>
                         [% ctx.get_aou(ahr.pickup_lib).name | html %]
                     </td>
                     <td>
-                        [% IF ahr.frozen == 't' AND ahr.thaw_date;
-                            date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT);
-                        END %]
-                    </td>
-                    <td>
                         [% IF ahr.expire_time;
                             date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT);
                         END %]
                     </td>
                     <td>
-                        [% l(ahr.frozen == 'f' ? 'Active' : 'Suspended') %]
-                    </td>
-                    <td>
                         <div name="acct_holds_status">
                             [% PROCESS get_hold_status hold=hold; %]
                         </div>
index d6e838f..183ead6 100644 (file)
@@ -1,14 +1,30 @@
 [% BLOCK get_hold_status %]
     <div>
-    [% 
+    [%
         IF hold.hold.status == 4;
             l("Available") | html;
             IF ahr.shelf_expire_time;
                 '<br/>';
-                l('Expires [_1]', 
+                l('Expires [_1]',
                     date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT)) | html;
             END;
 
+        ELSIF hold.hold.status == 6;
+               l("Canceled [_1]",
+                  date.format(ctx.parse_datetime(ahr.cancel_time), DATE_FORMAT)) | html;
+
+        ELSIF hold.hold.status == 7;
+               l("Suspended") | html;
+               IF ahr.thaw_date;
+                   "<br/>";
+                   l("Activate On [_1]",
+                       date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT)) | html;
+               END;
+
+        ELSIF hold.hold.status == 9;
+               l("Fulfilled [_1]",
+                  date.format(ctx.parse_datetime(ahr.fulfillment_time), DATE_FORMAT))| html;
+
         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);
 
         ELSIF hold.hold.status < 3;
             l("Waiting for copy") | html;
-        END 
+        END
     %]
     </div>
     <div>
-        [% l('Hold #[_1] on [quant,_2, copy, copies]', 
-            hold.hold.queue_position, hold.hold.potential_copies) | html %]
+        [% # Only show the count for holds that have not been captured
+           IF hold.hold.status < 3 OR hold.hold.status == 7;
+             l('Hold #[_1] on [quant,_2, copy, copies]',
+              hold.hold.queue_position, hold.hold.potential_copies) | html;
+          END
+        %]
     </div>
 [% END %]
+