Lp 1799272: Option to Limit Hold Items in SIP2 msg 64 to Available
authorJason Stephenson <jason@sigio.com>
Fri, 2 Nov 2018 13:03:07 +0000 (09:03 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 6 Sep 2019 21:56:09 +0000 (17:56 -0400)
This commit adds an implementation option to the oils_sip.xml that,
when enabled, will limit the hold items list and hold items counts in
the patron information response (response 64) to only the holds
available for pickup by the patron.  When the setting is not enabled,
the full list of the patron's holds continues to be used.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/examples/oils_sip.xml.example
Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm
docs/RELEASE_NOTES_NEXT/SIP/hold_items_available_option.adoc [new file with mode: 0644]

index 2146775..06da91b 100644 (file)
                     <option name='msg64_hold_datatype' value='barcode' />
                     -->
 
+                    <!--
+                        When set, hold items details will return only available holds to the SIP client.
+                    -->
+                    <!--
+                    <option name='msg64_hold_items_available' value='true' />
+                    -->
+
                                        <!--
                                                If enabled, the PC field in patron-info requests will return the non-translated profile name
                                        <option name='patron_type_uses_code' value='true' />
        </institutions>
 </acsconfig>
 
-<!--
-    vim:noet:ts=4:sw=4:
--->
+<!-- vim:noet:ts=4:sw=4: -->
index 9de94b8..98a594d 100644 (file)
@@ -520,13 +520,17 @@ sub hold_items {
     my ($self, $start, $end, $ids_only) = @_;
     syslog('LOG_DEBUG', 'OILS: Patron->hold_items()');
 
-
     # all of my open holds
-    my $holds = $self->{editor}->search_action_hold_request({
-        usr => $self->{user}->id, 
-        fulfillment_time => undef, 
-        cancel_time => undef 
-    });
+    my $holds_query = {
+        usr => $self->{user}->id,
+        fulfillment_time => undef,
+        cancel_time => undef
+    };
+    if (OpenILS::SIP->get_option_value('msg64_hold_items_available')) {
+        # Limit to available holds.
+        $holds_query->{current_shelf_lib} = {'=' => {'+ahr' => 'pickup_lib'}};
+    }
+    my $holds = $self->{editor}->search_action_hold_request($holds_query);
 
     return $holds if $ids_only;
     return $self->__format_holds($holds, $start, $end);
diff --git a/docs/RELEASE_NOTES_NEXT/SIP/hold_items_available_option.adoc b/docs/RELEASE_NOTES_NEXT/SIP/hold_items_available_option.adoc
new file mode 100644 (file)
index 0000000..515d7e3
--- /dev/null
@@ -0,0 +1,11 @@
+Option to Limit Hold Items to Available
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A new option has been added to the SIP2 implementation configuration,
+`msg64_hold_items_available`.  When set, this option will limit the
+count and list of hold items in the SIP2 patron information response
+message (64) to only those holds that are available for pickup.  When
+not set, the full list of the patron's holds will continue to be sent.
+This option is useful because some self checks expect to receive only
+the list of available holds in the hold items and have few settings to
+control the display of holds.