]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/prefs_notify.tt2
LP#1268636 My account various repairs
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / prefs_notify.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     WRAPPER "opac/parts/myopac/prefs_base.tt2";
3     myopac_page = "prefs";
4     prefs_page = 'prefs_notify' %]
5
6 <form method='post'>
7     [% setting = 'opac.hold_notify' %]
8     <input name='[% setting %]' type="hidden"
9         [% IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/>
10
11     <table class="full-width data_grid" id="acct_search_main" 
12         title="[% l('Search Preferences') %]">
13         <tbody>
14
15             [% IF ctx.updated_user_settings %]
16             <tr><td colspan='2'>
17                 <div class='renew-summary'>
18                     [% l('Account Successfully Updated') %]
19                 </div>
20             </td></tr>
21             [% END %]
22
23             [% setting = 'opac.hold_notify' %]
24             <tr>
25                 [%# WCAG insists that labels for checkboxes contain the input
26                     or directly follow the input, which would not look right
27                     with the rest of the table.  As an alternative, we can
28                     repeat the label as a title attr.
29                     http://www.w3.org/TR/WCAG20-TECHS/H44.html %]
30                 [% email_label = l('Notify by Email by default when a hold is ready for pickup?') %]
31
32                 <td><label for='[% setting %].email'>[% email_label %]</label></td>
33                 <td>
34                     <input id='[% setting %].email' name='[% setting %].email' 
35                         type="checkbox" title="[% email_label %]"
36                         [% IF (matches = ctx.user_setting_map.$setting.match('email')); %] checked='checked' [% END %]/>
37                 </td>
38             </tr>
39             [%- IF allow_phone_notifications == 'true';
40                 setting = 'opac.hold_notify'; 
41             -%]
42             <tr>
43                 [% phone_label = l('Notify by Phone by default when a hold is ready for pickup?') %]
44                 <td><label for='[% setting %].phone'>[% phone_label %]</label></td>
45                 <td>
46                     <input id='[% setting %].phone' name='[% setting %].phone' 
47                         type="checkbox" title="[% phone_label %]"
48                         [% IF (matches = ctx.user_setting_map.$setting.match('phone')); %] checked='checked' [% END %]/>
49                 </td>
50             </tr>
51             [% setting = 'opac.default_phone' %]
52             <tr>
53                 <td><label for='[% setting %]'>[% l('Default Phone Number') %]</label></td>
54                 <td>
55                     <input id='[% setting %]' name='[% setting %]' type="text"
56                         [% IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/>
57                 </td>
58             </tr>
59             [%- END %]
60             [%- IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1;
61                setting = 'opac.hold_notify';
62             -%]
63             <tr>
64                 [% sms_label = l('Notify by Text by default when a hold is ready for pickup?') %]
65                 <td><label for='[% setting %].sms'>[% sms_label %]</label></td>
66                 <td>
67                     <input id='[% setting %].sms' name='[% setting %].sms' 
68                         type="checkbox" title="[% sms_label %]"
69                         [% IF (matches = ctx.user_setting_map.$setting.match('sms')); %] checked='checked' [% END %]/>
70                 </td>
71             </tr>
72             <tr>
73                 <td>[% l('Default Mobile Carrier') %]</td>
74                 <td>[% INCLUDE "opac/parts/sms_carrier_selector.tt2" sms_carrier_hide_label="true" %]</td>
75             </tr>
76             [% setting = 'opac.default_sms_notify' %]
77             <tr>
78                 <td><label for='[% setting %]'>[% l('Default Mobile Number') %]</label></td>
79                 <td>
80                     <input id='[% setting %]' name='[% setting %]' type="text"
81                         [% IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/>
82                     [% l('Hint: use the full 10 digits of your phone #, no spaces, no dashes'); %]
83                 </td>
84             </tr>
85             [% END %]
86         </tbody>
87     </table>
88
89     [% IF ctx.opt_in_settings.size > 0 %]
90     <div class='user_opt_in_settings'>
91       <table>
92         <thead><tr>
93             <th>[% l('Notification Type') %]</th>
94             <th>[% l('Enabled') %]</th>
95         </tr></thead>
96         <tbody class='data_grid'>
97             [% FOR optin IN ctx.opt_in_settings %]
98                 <tr>
99                     <td>[% optin.cust.label | html %]</td>
100                     <td>
101                         <input type='checkbox' name='setting' 
102                             value='[% optin.cust.name | uri %]' 
103                             title="[% optin.cust.label | html %]"
104                             [% IF optin.value %] checked='checked' [% END %]/>
105                     </td>
106                 </tr>
107             [% END %]
108         </tbody>
109       </table>
110     </div>
111     [% END %]
112     <input type='submit' value="[% l('Save') %]" class="opac-button" />
113 </form>
114 [% END %]
115
116