From dd6d21a7615d893065869829ce969e71bc5c7678 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 19 Jul 2019 18:59:19 -0400 Subject: [PATCH] LP#1841270: add Title Hold option in various places in staff client * Adds a Title Hold option to certain invocations of Request Items (Item Status, Copy Buckets, but not Holdings View) * Switches count of items to count of titles when Title hold option is selected * Adds a checkbox for honoring the preferred notification settings and default pickup library of the selected patron * Adds a success/failure toast for Request Items Signed-off-by: Jason Etheridge Signed-off-by: Galen Charlton --- .../lib/OpenILS/Application/Circ/Holds.pm | 30 +++++++++ .../templates/staff/cat/bucket/copy/index.tt2 | 4 ++ .../staff/cat/catalog/t_request_items.tt2 | 15 ++++- .../src/templates/staff/cat/item/index.tt2 | 4 ++ .../ui/default/staff/cat/bucket/copy/app.js | 61 ++++++++++++++++--- .../web/js/ui/default/staff/cat/item/app.js | 5 +- .../js/ui/default/staff/circ/services/item.js | 57 +++++++++++++++-- 7 files changed, 160 insertions(+), 16 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 1336e4efa2..e19915e75c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -108,6 +108,36 @@ sub test_and_create_hold_batch { $params->{'depth'} = $res->{'depth'} if $res->{'depth'}; + if ($$oargs{honor_user_settings}) { + my $recipient = $e->retrieve_actor_user($$params{patronid}) + or return $e->die_event; + my $opac_hold_notify = $e->search_actor_user_setting( + {usr => $$params{patronid}, name => 'opac.hold_notify'})->[0]; + if ($opac_hold_notify) { + if ($opac_hold_notify->value =~ 'email') { + $$params{email_notify} = 1; + } + if ($opac_hold_notify->value =~ 'phone') { + my $opac_default_phone = $e->search_actor_user_setting( + {usr => $$params{patronid}, name => 'opac.default_phone'})->[0]; + # FIXME - what's up with the ->value putting quotes around the string? + if ($opac_default_phone && $opac_default_phone->value =~ /^"(.*)"$/) { + $$params{phone_notify} = $1; + } + } + if ($opac_hold_notify->value =~ 'sms') { + my $opac_default_sms_carrier = $e->search_actor_user_setting( + {usr => $$params{patronid}, name => 'opac.default_sms_carrier'})->[0]; + $$params{sms_carrier} = $opac_default_sms_carrier->value if $opac_default_sms_carrier; + my $opac_default_sms_notify = $e->search_actor_user_setting( + {usr => $$params{patronid}, name => 'opac.default_sms_notify'})->[0]; + if ($opac_default_sms_notify && $opac_default_sms_notify->value =~ /^"(.*)"$/) { + $$params{sms_notify} = $1; + } + } + } + } + # Remove oargs from params so holds can be created. if ($$params{oargs}) { delete $$params{oargs}; diff --git a/Open-ILS/src/templates/staff/cat/bucket/copy/index.tt2 b/Open-ILS/src/templates/staff/cat/bucket/copy/index.tt2 index 91d2f204fc..74a379f17e 100644 --- a/Open-ILS/src/templates/staff/cat/bucket/copy/index.tt2 +++ b/Open-ILS/src/templates/staff/cat/bucket/copy/index.tt2 @@ -23,6 +23,10 @@ "[% l('One or more items could not be transferred. Override?') %]"; s.OVERRIDE_TRANSFER_COPY_BUCKET_ITEMS_TO_MARKED_VOLUME_BODY = "[% l('Reason(s) include: [_1]', '{{evt_desc}}') %]"; + s.SUCCESS_HOLD_REQUEST = + "[% l('Hold successfully requested') %]"; + s.FAILURE_HOLD_REQUEST = + "[% l('Hold not successfully requested') %]"; }]) [% END %] diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_request_items.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_request_items.tt2 index f28a521801..15fba0497a 100644 --- a/Open-ILS/src/templates/staff/cat/catalog/t_request_items.tt2 +++ b/Open-ILS/src/templates/staff/cat/catalog/t_request_items.tt2 @@ -15,6 +15,15 @@
{{user_name}}
+
+
+ +
+
+
@@ -23,6 +32,7 @@ +
@@ -36,9 +46,12 @@