From 7d76898b674441d989d096442861831c9adb4ba3 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Fri, 2 Nov 2018 09:03:07 -0400 Subject: [PATCH] Lp 1799272: Option to Limit Hold Items in SIP2 msg 64 to Available 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 Signed-off-by: Galen Charlton --- Open-ILS/examples/oils_sip.xml.example | 11 ++++++++--- Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm | 16 ++++++++++------ .../SIP/hold_items_available_option.adoc | 11 +++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 docs/RELEASE_NOTES_NEXT/SIP/hold_items_available_option.adoc diff --git a/Open-ILS/examples/oils_sip.xml.example b/Open-ILS/examples/oils_sip.xml.example index 2146775f19..06da91bec7 100644 --- a/Open-ILS/examples/oils_sip.xml.example +++ b/Open-ILS/examples/oils_sip.xml.example @@ -116,6 +116,13 @@ --> + + + + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm index 9de94b82e3..98a594da84 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm @@ -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 index 0000000000..515d7e3711 --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/SIP/hold_items_available_option.adoc @@ -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. -- 2.43.2