LP#1792621: Ignore deleted items on hold shelf
authorMike Rylander <mrylander@gmail.com>
Mon, 17 Sep 2018 14:19:34 +0000 (10:19 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 17 Sep 2018 14:19:34 +0000 (10:19 -0400)
The hold shelf rewrite brought back an old behavioral bug where items deleted
while on the hold shelf continued to show on the hold shelf list.  The most
recent behavior was to ignore those items, which this commit does.  It also
addresses an adjacent issue where holds may show with "Hold Shelf Delay"
instead of "Ready For Pickup" in some cases.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
Open-ILS/web/js/ui/default/staff/circ/holds/app.js

index 3c69f33..7278620 100644 (file)
@@ -2170,7 +2170,7 @@ SELECT  h.id, h.request_time, h.capture_time, h.fulfillment_time, h.checkin_time
              WHEN cp.status = 6 THEN 3
              WHEN EXTRACT(EPOCH FROM COALESCE(NULLIF(BTRIM(hold_wait_time.value,'"'),''),'0 seconds')::INTERVAL) = 0 THEN 4
              WHEN NOW() + COALESCE(NULLIF(BTRIM(hold_wait_time.value,'"'),''),'0 seconds')::INTERVAL > NOW() THEN 5
-             ELSE 5
+             ELSE 4
         END AS hold_status,
 
         (h.shelf_expire_time < NOW() OR h.cancel_time IS NOT NULL OR (h.current_shelf_lib IS NOT NULL AND h.current_shelf_lib <> h.pickup_lib)) AS clear_me,
@@ -2377,6 +2377,7 @@ SELECT  h.id, h.request_time, h.capture_time, h.fulfillment_time, h.checkin_time
         usr_id => 'u.id',
         cs_id => 'cs.id',
         cp_id => 'cp.id',
+        cp_deleted => 'cp.deleted',
         cancel_time => 'h.cancel_time',
         tr_cancel_time => 'tr.cancel_time',
     );
index 5ce21aa..1bd2eed 100644 (file)
@@ -84,6 +84,7 @@ function($scope , $q , $routeParams , $window , $location , egCore , egHolds , e
                 last_captured_hold: 'true',
                 capture_time      : { not : null },
                 cs_id             : 8, // on holds shelf
+                cp_deleted        : 'f',
                 fulfillment_time  : null,
                 current_shelf_lib : $scope.pickup_ou.id()
         };