LP#1454871: Fix KPAC Hold Notification Preferences user/mccanna/lp1454871_kpac_hold_notifications
authorTerran McCanna <tmccanna@georgialibraries.org>
Fri, 15 May 2015 17:09:52 +0000 (10:09 -0700)
committerTerran McCanna <tmccanna@georgialibraries.org>
Fri, 15 May 2015 17:09:52 +0000 (10:09 -0700)
Correction to KPAC holds notification default preferences to allow for
SMS text messaging options.

Prior to this correction, KPAC hold notifications would only pick up
hold preferences if set to email and/or phone. This correction allows
it to pick up email and/or phone and/or sms notification preferences.

To test, set hold preferences to different options, place hold via the
KPAC and then view the hold to see which preferences were recognized.

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/templates/kpac/getit.tt2

index 95d2931..3504b8d 100644 (file)
 
                                  <!-- HIDDEN FIELDS FOR DEFAULT NOTIFICATION PREFERENCES -->
                                  [%- IF ctx.notify_method -%]
-                                     [%- IF ctx.notify_method == '' OR ctx.notify_method == 'phone:email' -%]
+                                     [%- IF ctx.notify_method == '' -%]
                                          [%- SET ctx.notify_method = 'email|phone' -%]
                                      [%- END -%]
                                  [%- ELSE -%]
                                      [%- SET ctx.notify_method = 'email|phone' -%]
                                  [%- END -%]
+
+
+                                 [% ctx.notify_method.search('email') ? 
+                                     '<input type="hidden" id="email_notify" name="email_notify" value="t"/>' : '' %]
+
+
+                                 [%- IF allow_phone_notifications == 'true' -%]
+                                     [% IF ctx.default_phone %]
+                                            [% phone_value = ctx.default_phone %]
+                                     [% ELSE %]
+                                            [% phone_value= ctx.user.day_phone %]
+                                     [% END %]
+                                                   
+                                     [% ctx.notify_method.search('phone') ? 
+                                          '<input type="hidden" id="phone_notify_checkbox" name="phone_notify_checkbox" value="t"/>
+                                            <input type="hidden" name="phone_notify" value="' _ phone_value _ '"/>' : '' %]
+                                 [%- 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 -%]
+                                 [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %]
+                                       [% setting_notify = 'opac.default_sms_notify';
+                                          setting_carrier = 'opac.default_sms_carrier'; %]
+                                       [% ctx.notify_method.search('sms') ?
+                                            '<input type="hidden" id="sms_notify_checkbox" name="sms_notify_checkbox" value="t" />
+                                             <input type="hidden" id="sms_carrier" name="sms_carrier" value="' _ ctx.user_setting_map.$setting_carrier _ '" />
+                                             <input type="hidden" id="sms_notify" name="sms_notify" value="' _ ctx.user_setting_map.$setting_notify _ '" />' : '' %]
+                                 [% END %]
+
+
+                                </div>
+                                [% END %]
 
                                 </div>
                                 [% END %]