Lp 1799272: Limit SIP2 hold items to available hold items. user/dyrcona/lp1799272-limit-sip2-hold-items-to-available
authorJason Stephenson <jason@sigio.com>
Mon, 22 Oct 2018 19:17:14 +0000 (15:17 -0400)
committerJason Stephenson <jason@sigio.com>
Mon, 22 Oct 2018 19:17:14 +0000 (15:17 -0400)
Only inlcude holds that are available for pickup in the hold items
count and hold items fields of the SIP2 patron information
response. Given some confusion over the purpose of this field, that
there is also a field to list unavailable holds, and that a list of
holds avaialable for pickup would be more useful than a list of all
holds to a patron using a self-check, this seems like a good change.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm

index 3b458cb..67bc8ef 100644 (file)
@@ -514,18 +514,19 @@ sub too_many_billed {
 
 
 #
-# List of outstanding holds placed
+# List of available holds
 #
 sub hold_items {
     my ($self, $start, $end, $ids_only) = @_;
     syslog('LOG_DEBUG', 'OILS: Patron->hold_items()');
 
 
-    # all of my open holds
+    # all of my available holds
     my $holds = $self->{editor}->search_action_hold_request({
-        usr => $self->{user}->id, 
-        fulfillment_time => undef, 
-        cancel_time => undef 
+        usr => $self->{user}->id,
+        fulfillment_time => undef,
+        cancel_time => undef,
+        current_shelf_lib => {'=' => {'+ahr' => 'pickup_lib'}}
     });
 
     return $holds if $ids_only;