[open-ils-commits] [GIT] Evergreen ILS branch master updated. 2f252638d4af78953bb5300760f995566b89b11f

Evergreen Git git at git.evergreen-ils.org
Wed Aug 27 21:58:35 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  2f252638d4af78953bb5300760f995566b89b11f (commit)
      from  39503e336731401beff4bc1b79f0fa7867e12f2f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2f252638d4af78953bb5300760f995566b89b11f
Author: Terran McCanna <tmccanna at georgialibraries.org>
Date:   Tue Aug 26 17:58:52 2014 -0400

    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 <tmccanna at georgialibraries.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm
index 30fbca2..0598947 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 a807b0d..95d2931 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);"><img 
                                         src="[% ctx.media_prefix %]/images/kpac/question_mark.png" alt="[% l('password help') %]" /></a>
 
+                                    <input type="hidden" name='pickup_lib' value='0' id='pickup_lib'>
+                                    
                                     <div class="clear">&nbsp;</div>
                                     <div class="hr">&nbsp;</div>
-                                [% END %]
+
+                                [% ELSE %]
 
                                 <p>[% l('Choose a Pickup Library:') %]</p>
                                 <div class="pickup_lib">
                                     [%  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 %]
+
+                                 <!-- HIDDEN FIELDS FOR DEFAULT NOTIFICATION PREFERENCES -->
+                                 [%- 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' -%]
+                                           <input type="hidden" id="email_notify" name="email_notify" value="t"/>
+                                      [%- END -%]
+			            [%- END -%]
+
+			            [%- IF allow_phone_notifications == 'true' -%]
+                                      [%- IF ctx.notify_method == 'phone' OR ctx.notify_method == 'email|phone' -%]
+			                      <input type="hidden" id="phone_notify_checkbox" name="phone_notify_checkbox" value="t"/>
+			                      <input type="hidden" name="phone_notify" 
+                                                value='[% IF ctx.default_phone %][%- ctx.default_phone -%][% ELSE %][%- ctx.user.day_phone -%][% END %]'/>
+                                      [%- END -%]
+			            [%- END -%]
+
                                 </div>
+                                [% END %]
                             </div>
                         </div>
                         <div class="submit_btn">

-----------------------------------------------------------------------

Summary of changes:
 .../src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm   |   19 ++++++++++++
 Open-ILS/src/templates/kpac/getit.tt2              |   32 ++++++++++++++++++-
 2 files changed, 49 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list