Additional changes to hold bugs fix
authorTerran McCanna <tmccanna@georgialibraries.org>
Thu, 31 Jul 2014 22:19:11 +0000 (18:19 -0400)
committerTerran McCanna <tmccanna@georgialibraries.org>
Thu, 31 Jul 2014 22:19:11 +0000 (18:19 -0400)
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm
Open-ILS/src/templates/kpac/getit.tt2

index c0fcca3..ea6dbd4 100644 (file)
@@ -93,7 +93,7 @@ sub load_getit {
         ]);
     }
 
-    # If user is logged in and has a default pickup location and phone for holds, grab them
+    # 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'}) {
@@ -102,6 +102,9 @@ sub load_getit {
         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
index ec467bc..aebf172 100644 (file)
                                         INCLUDE build_org_selector name='pickup_lib' 
                                         value=def_lib id='pickup_lib' can_have_vols_only=1 hold_pickup_lib=1 %]
 
-                                 <!-- HIDDEN FIELDS FOR DEFAULT EMAIL AND PHONE NUMBERS -->
+
+                                 <!-- HIDDEN FIELDS FOR DEFAULT NOTIFICATION PREFERENCES -->
+                                 
                                  [%- IF ctx.user.email -%]
-                                        <input type="hidden" id="email_notify" name="email_notify" value="t"/>
+                                      [%- 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' -%]
-                                        <input type="hidden" id="phone_notify_checkbox" name="phone_notify_checkbox" value="t"/>
-                                        <input type="hidden" name="phone_notify" [% setting = 'opac.default_phone';
-                                            IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]'
-                                            [%- ELSIF ctx.user.day_phone; %] value='[% ctx.user.day_phone | html %]' [%- END -%]/>
+                                      [%- 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>