Improve display of holds status in My Account user/kmlussier/improved-myopac-holds-screens
authorKathy Lussier <klussier@masslnc.org>
Thu, 11 Aug 2016 03:41:51 +0000 (23:41 -0400)
committerKathy Lussier <klussier@masslnc.org>
Thu, 11 Aug 2016 03:41:51 +0000 (23:41 -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>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
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 9aae602..3cab8ef 100644 (file)
@@ -60,9 +60,6 @@
                     <td><span>[% l('Author') %]</span></td>
                     <td> <span>[% l('Format') %]</span></td>
                     <td><span>[% l('Pickup Location') %]</span> </td>
-                    <td>[% l('Activate') %]</td>
-                    <td>[% l('Active') %]</td>
-                    <td>[% l('Date Fulfilled') %]</td>
                     <td><span>[% l('Status') %]</span></td>
                 </tr>
             </thead>
                         [% 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"
                             style="margin-top:10px;margin-bottom:10px;">
                             [% PROCESS get_hold_status hold=hold; %]
index 68f9b4e..ee8b040 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 %]
+