2db15e591de17289dcad904624a5fa4dcd649bd1
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / prefs.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     WRAPPER "opac/parts/myopac/prefs_base.tt2";
3     myopac_page = "prefs";
4     prefs_page = 'personal' %]
5
6 <div id="acct_info_main">
7     <div id='myopac.expired.alert'
8          class='hide_me'
9          style='margin-bottom: 20px;'>
10         <table class='data_grid'
11                width='100%'>
12             <tbody>
13                 <tr>
14                     <td width='100%' class='red'>
15                         [% l("Your account expired on") %]
16                         <span id='myopac.expired.date'></span>!
17                         [% l("Please see a librarian to renew your account.") %]</td>
18                 </tr>
19             </tbody>
20         </table>
21     </div>
22
23     <div id='myopac.notes.div'
24          class='hide_me'>
25         <table class='data_grid'
26                width='100%'>
27             <thead>
28                 <tr>
29                     <td colspan='2'>
30                     <b>[% l("* Staff Notes *") %]</b></td>
31                 </tr>
32             </thead>
33
34             <tbody id='myopac.notes.tbody'>
35                 <tr id='myopac.notes.tr'>
36                     <td><b name='title'></b> : <span name=
37                     'value'></span></td>
38                 </tr>
39             </tbody>
40         </table><br />
41     </div>
42
43     <table width='70%'
44            class='light_border data_grid'>
45         <tbody id='myopac_summary_tbody'>
46             <tr>
47                 <td width='30%'
48                     class='color_4 light_border'>[% l("Name") %]</td>
49
50                 <td class='light_border'>[% l(
51                     HUMAN_NAME_FORMAT,
52                     ctx.user.prefix, ctx.user.first_given_name,
53                     ctx.user.second_given_name, ctx.user.family_name,
54                     ctx.user.suffix
55                 ) | html %]</td>
56
57                 <td></td>
58             </tr>
59
60             <tr>
61                 <td class='color_4 light_border'>
62                 [% l("Day Phone") %]</td>
63
64                 <td class='light_border'
65                     id='myopac_summary_dayphone'>[% ctx.user.day_phone | html %]</td>
66
67                 <td class='light_border'><a href='#'
68                    class="hide_me"
69                    id='myopac_summary_phone1_change'
70                    style=
71                    'text-decoration: underline;'>[% l("Change") %]</a></td>
72             </tr>
73
74             <tr id='myopac_update_phone1_row'
75                 class='hide_me'>
76                 <td class='myopac_update_cell'
77                     colspan='3'>
78                     <span class='myopac_update_span'>
79                         Enter New [% l("Day Phone") %]:
80                     </span>
81
82                     <input type='text' size='24' id='myopac_new_phone1' />
83                     <span class='myopac_update_span'>
84                         <button>
85                             <span class='myopac_update_span'>
86                                 [% l("Submit") %]</span>
87                         </button>
88                     </span>
89                     <span class='myopac_update_span'>
90                         <button>
91                             <span class='myopac_update_span'>
92                                 [% l("Cancel") %]</span>
93                         </button>
94                     </span>
95                 </td>
96             </tr>
97
98             <tr>
99                 <td class='color_4 light_border'>
100                 [% l("Evening Phone") %]</td>
101
102                 <td class='light_border'
103                     id='myopac_summary_eveningphone'>[% ctx.user.evening_phone | html %]</td>
104
105                 <td class='light_border'><a href='#'
106                    class="hide_me"
107                    id='myopac_summary_phone2_change'
108                    style=
109                    'text-decoration: underline;'>[% l("Change") %]</a></td>
110             </tr>
111
112             <tr id='myopac_update_phone2_row'
113                 class='hide_me'>
114                 <td class='myopac_update_cell'
115                     colspan='3'><span class='myopac_update_span'>New
116                     [% l("Evening Phone") %]:</span>
117                     <input type='text' size='24' id='myopac_new_phone2' />
118                     <span class='myopac_update_span'><button><span class=
119                         'myopac_update_span'>[% l("Submit") %]</span></button></span>
120                     <span class='myopac_update_span'><button><span class=
121                         'myopac_update_span'>[% l("Cancel") %]</span></button></span>
122                 </td>
123             </tr>
124
125             <tr>
126                 <td class='color_4 light_border'>
127                 [% l("Other Phone") %]</td>
128
129                 <td class='light_border'
130                     id='myopac_summary_otherphone'>[% ctx.user.other_phone | html %]</td>
131
132                 <td class='light_border'><a href='#'
133                    class="hide_me"
134                    id='myopac_summary_phone3_change'
135                    style=
136                    'text-decoration: underline;'>[% l("Change") %]</a></td>
137             </tr>
138
139             <tr id='myopac_update_phone3_row'
140                 class='hide_me'>
141                 <td class='myopac_update_cell'
142                     colspan='3'><span class='myopac_update_span'>Enter
143                     New [% l("Other Phone") %]:</span>
144                     <input type='text' size='24' id='myopac_new_phone3' />
145                     <span class='myopac_update_span'><button><span class=
146                         'myopac_update_span'>[% l("Submit") %]</span></button></span>
147                     <span class='myopac_update_span'><button><span class=
148                         'myopac_update_span'>[% l("Cancel") %]</span></button></span>
149                 </td>
150             </tr>
151
152             <tr>
153                 <td class='color_4 light_border'>
154                     <div style="position:absolute">
155                         <div class="hide_me" style="position:relative;left:70px;top:-3px;">
156                             <a href="#"><img alt="Username Help" src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
157                         </div>
158                     </div>[% l("Username") %]
159                 </td>
160                 <td class='light_border'>[% ctx.user.usrname | html %]</td>
161                 <td class='light_border'><a href='update_username'>[% l("Change") %]</a></td>
162             </tr>
163             <tr>
164                 <td class='color_4 light_border'>[% l("Password") %]</td>
165                 <td class='light_border'>[% l("(not shown)") %]</td>
166                 <td class='light_border'><a href='update_password'>[% l("Change") %]</a></td>
167             </tr>
168             <tr>
169                 <td class='color_4 light_border'>[% l("Email Address") %]</td>
170                 <td class='light_border'>[% ctx.user.email | html %]</td>
171                 <td class='light_border'><a href='update_email'>[% l('Change') %]</a></td>
172             </tr>
173
174             [% IF ctx.user.ident_value %]<tr class="hide_me">
175                 <td class='color_4 light_border'>
176                 [% l("Primary Identification") %]</td>
177
178                 <td class='light_border'>
179                     [%
180                     # l('[_1] ([_2])', ctx.user.ident_value, ctx.user.ident_type.name) | html
181                     # XXX uncomment the above line to show primary
182                     # identification. With a minor tweak it could
183                     # alternatively be shown but partially obscured. 
184                     %]
185                 </td>
186                 <td></td>
187             </tr>[% END %]
188
189             <tr>
190                 <td class='color_4 light_border'>
191                 [% l("Active Barcode") %]</td>
192
193                 <td class='light_border'>[% ctx.user.card.barcode %]</td>
194
195                 <td></td>
196             </tr>
197
198             <tr>
199                 <td class='color_4 light_border'>
200                 [% l("Home Library") %]</td>
201                 <td class='light_border'>[% ctx.user.home_ou.name | html %]</td>
202                 <td><a href='#'
203                    class="hide_me"
204                    style='text-decoration: underline;'>[% l("Change") %]</a></td>
205             </tr>
206             <tr class='hide_me'>
207                 <td class='myopac_update_cell'
208                     colspan='3'>
209                     <span class='myopac_update_span'>
210                         New home library:</span>
211                     <select>
212                     </select>
213                     <span class='myopac_update_span'>
214                         <button>
215                             <span class= 'myopac_update_span'>
216                                 [% l("Submit") %]</span>
217                         </button>
218                     </span>
219                     <span class='myopac_update_span'>
220                         <button>
221                             <span class= 'myopac_update_span'>
222                                 [% l("Cancel") %]</span>
223                         </button>
224                     </span>
225                 </td>
226             </tr>
227             <tr class="hide_me">
228                 <td class='color_4 light_border'>
229                     [% l("Account Creation Date") %]
230                 </td>
231                 <td class='light_border'
232                     id='myopac_summary_create_date'></td>
233                 <td></td>
234             </tr>
235         </tbody>
236     </table><br />
237     <hr class='opac-auto-013' color="#DCDBDB" />
238     <br />
239
240     <table width='100%' class='light_border data_grid'>
241         <thead>
242             <tr>
243                 <td><strong>[% l("Addresses") %]</strong></td>
244                 <td><strong>[% l("Pending Addresses") %]</strong></td>
245             </tr>
246         </thead>
247         <tbody>
248             [% 
249                 # cycle through the non-pending address.  For each non-pending addr
250                 # that has a corresponding pending addr, render the pending addr 
251                 # along the right inside it's own edit form
252                 pending = {};
253                 regular = [];
254                 edit_addr_id = CGI.param('edit_address');
255                 FOR addr IN ctx.user.addresses;
256                     IF addr.pending == 't';
257                         replaces = addr.replaces;
258                         pending.$replaces = addr;
259                     ELSE;
260                         regular.push(addr);
261                     END;
262                 END;
263             FOR addr IN regular;
264                 cur_id = addr.id; 
265                 pending_addr = pending.$cur_id;
266             %]
267             <tr>
268                 <td>
269                     <!-- read-only address display -->
270                     <table class='light_border'>
271                         <tr><td>[% l("Address Type") %]</td><td>[% addr.address_type | html %]</td></tr>
272                         <tr><td>[% l("Street") %]</td><td>[% addr.street1 | html %]</td></tr>
273                         <tr><td>[% l("Street") %]</td><td>[% addr.street2 | html %]</td></tr>
274                         <tr><td>[% l("City") %]</td><td>[% addr.city | html %]</td></tr>
275                         <tr><td>[% l("County") %]</td><td>[% addr.county| html  %]</td></tr>
276                         <tr><td>[% l("State") %]</td><td>[% addr.state | html %]</td></tr>
277                         <tr><td>[% l("Country") %]</td><td>[% addr.country | html %]</td></tr>
278                         <tr><td>[% l("Zip") %]</td><td>[% addr.post_code | html %]</td></tr>
279                         [% IF ctx.get_org_setting(ctx.user.home_ou.id, 'opac.allow_pending_address') 
280                                 AND !pending_addr AND edit_addr_id != cur_id %]
281                         <tr>
282                             <td colspan='2'>
283                                 <a href='?edit_address=[% addr.id %]'>[% l('Edit Address') %]</a>
284                             </td>
285                         </tr>
286                         [% END %]
287                     </table>
288                 </td>
289
290                 <!-- pending address form -->
291                 [% IF pending_addr OR edit_addr_id == cur_id;
292                     update_addr = pending_addr || addr %]
293                 <td>
294                     <form method='POST'>
295                         [% IF pending_addr %]
296                             <input type='hidden' name='pending_addr' value='[% pending_addr.id %]'/>
297                         [% ELSE %]
298                             <input type='hidden' name='replace_addr' value='[% edit_addr_id | html %]'/>
299                         [% END %]
300                         <table class='pending-addr'>
301                             <tr>
302                                 <td>[% l("Address Type") %]</td>
303                                 <td><input name='address_type' value='[% update_addr.address_type | html %]'/></td>
304                             </tr>
305                             <tr>
306                                 <td>[% l("Street") %]</td>
307                                 <td><input name='street1' value='[% update_addr.street1 | html %]'/></td>
308                             </tr>
309                             <tr>
310                                 <td>[% l("Street") %]</td>
311                                 <td><input name='street2' value='[% update_addr.street2 | html %]'/></td>
312                             </tr>
313                             <tr>
314                                 <td>[% l("City") %]</td>
315                                 <td><input name='city' value='[% update_addr.city | html %]'/></td>
316                             </tr>
317                             <tr>
318                                 <td>[% l("County") %]</td>
319                                 <td><input name='county' value='[% update_addr.county| html %]'/></td>
320                             </tr>
321                             <tr>
322                                 <td>[% l("State") %]</td>
323                                 <td><input name='state' value='[% update_addr.state | html %]'</td>
324                             </tr>
325                             <tr>
326                                 <td>[% l("Country") %]</td>
327                                 <td><input name='country' value='[% update_addr.country | html %]'/></td>
328                             </tr>
329
330                             <tr>
331                                 <td>[% l("Zip") %]</td>
332                                 <td><input name='post_code' value='[% update_addr.post_code | html %]'/></td>
333                             </tr>
334                             <tr>
335                                 <td><input type='submit' value="[% l('Save Changes') %]"/></td>
336                                 <td>
337                                     [% IF pending_addr;
338                                         url = mkurl('', {delete_pending => pending_addr.id}, 1);
339                                     ELSE;
340                                         url = mkurl('', {}, 1);
341                                     END %]
342                                     <a href="[% url %]">[% l('Discard Pending Address') %]</a>
343                                 </td>
344                             </tr>
345                             <tr><td colspan='2'><i>[% l('Address changes will be verified by staff') %]</i></td></tr>
346                         </table>
347                     </form>
348                 </td>
349                 [% END %] <!-- if pending_addr -->
350             </tr>
351             [% END %]
352         </tbody>
353     </table>
354 </div>
355
356 [% END %]