From 03fc73f5e383017164c07efa8e9ece8a6f1bfe6b Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 19 Jul 2019 18:59:19 -0400 Subject: [PATCH] lp1841270 eg1_title_holds_via_item_status 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 --- .../perlmods/lib/OpenILS/Application/Circ/Holds.pm | 30 +++++++++++ .../src/templates/staff/cat/bucket/copy/index.tt2 | 4 ++ .../staff/cat/catalog/t_request_items.tt2 | 15 +++++- Open-ILS/src/templates/staff/cat/item/index.tt2 | 4 ++ .../web/js/ui/default/staff/cat/bucket/copy/app.js | 61 +++++++++++++++++++--- Open-ILS/web/js/ui/default/staff/cat/item/app.js | 5 +- .../web/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 @@