From 2f252638d4af78953bb5300760f995566b89b11f Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Tue, 26 Aug 2014 17:58:52 -0400 Subject: [PATCH] LP#1282783: Use patron hold notification defaults for KPAC Since the KPAC interface doesn't display a patron's email/phone notification preferences, we had initially assumed it was pulling in the patron's default notification info, but we've found that it does not. Emails are not sent to patrons who have their notification preferences set to email, and hold slips print out without phone numbers or email addresses. This causes extra work for Circ staff in processing incoming holds as they need to look up each account number to get the patron's contact information. This patch pulls in the patron's email & phone notification preferences and related values in hidden fields and allows the patron to choose their pickup library at time of hold placement (defaults to their preferred pickup location). Signed-off-by: Terran McCanna Signed-off-by: Ben Shum --- .../perlmods/lib/OpenILS/WWW/EGKPacLoader.pm | 19 +++++++++++ Open-ILS/src/templates/kpac/getit.tt2 | 32 +++++++++++++++++-- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm index 30fbca261d..0598947b62 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm @@ -92,6 +92,20 @@ sub load_getit { ]); } + # If user is logged in, get default hold pickup and notification info + if ($ctx->{user}) { + my $set_map = $self->ctx->{user_setting_map}; + if ($$set_map{'opac.default_pickup_location'}) { + $ctx->{default_pickup_lib} = $$set_map{'opac.default_pickup_location'}; + } + if ($$set_map{'opac.default_phone'}) { + $ctx->{default_phone} = $$set_map{'opac.default_phone'}; + } + if ($$set_map{'opac.hold_notify'}) { + $ctx->{notify_method} = $$set_map{'opac.hold_notify'}; + } + } + $self->ctx->{page} = 'getit'; # repair the page return Apache2::Const::OK; } @@ -107,6 +121,11 @@ sub login_and_place_hold { return Apache2::Const::HTTP_BAD_REQUEST unless $pickup_lib =~ /^\d+$/; + #If a pickup library hasn't been selected, reload page + if ($pickup_lib == '0') { + return $self->load_login; + } + my $new_uri = $self->apache->unparsed_uri; my $sep = ($new_uri =~ /\?/) ? '&' : '?'; diff --git a/Open-ILS/src/templates/kpac/getit.tt2 b/Open-ILS/src/templates/kpac/getit.tt2 index a807b0d233..95d293146f 100644 --- a/Open-ILS/src/templates/kpac/getit.tt2 +++ b/Open-ILS/src/templates/kpac/getit.tt2 @@ -62,17 +62,45 @@ onclick="helpPopup('password_help', this, event);">[% l('password help') %] + +
 
 
- [% END %] + + [% ELSE %]

[% l('Choose a Pickup Library:') %]

[% def_lib = ctx.default_pickup_lib || ctx.physical_loc; PROCESS "opac/parts/org_selector.tt2"; INCLUDE build_org_selector name='pickup_lib' - value=def_lib id='pickup_lib' can_have_vols_only=1 %] + value=def_lib id='pickup_lib' can_have_vols_only=1 hold_pickup_lib=0 %] + + + [%- IF ctx.notify_method -%] + [%- IF ctx.notify_method == '' OR ctx.notify_method == 'phone:email' -%] + [%- SET ctx.notify_method = 'email|phone' -%] + [%- END -%] + [%- ELSE -%] + [%- SET ctx.notify_method = 'email|phone' -%] + [%- END -%] + + [%- IF ctx.user.email -%] + [%- IF ctx.notify_method == 'email' OR ctx.notify_method == 'email|phone' -%] + + [%- END -%] + [%- END -%] + + [%- IF allow_phone_notifications == 'true' -%] + [%- IF ctx.notify_method == 'phone' OR ctx.notify_method == 'email|phone' -%] + + + [%- END -%] + [%- END -%] +
+ [% END %]
-- 2.43.2