LP#1706107: Offline mode
[working/Evergreen.git] / Open-ILS / src / templates / staff / circ / patron / t_edit.tt2
1 [% DOC_IMG = '/images/question-mark.png' %]
2
3 <!-- register banner -->
4 <div ng-if="!patron_id" ng-class='{"patron-reg-fixed-bar":!offline}'>
5
6   <div class="container-fluid" style="text-align:center">
7     <div class="alert alert-info alert-less-pad strong-text-2">
8       <span >[% l('Register Patron') %]</span>
9     </div>
10   </div>
11
12   <div class="flex-row" class='patron-reg-actions-bar'>
13     [% INCLUDE 'staff/circ/patron/reg_actions.tt2' %]
14   </div>
15 </div>
16
17
18 <!-- edit banner -->
19 <div ng-if="patron_id"
20     class="strong-text-2">[% l('Patron Edit') %]</div>
21
22 <div id="reg-alert-pane">
23
24   <div id="reg-dupe-links">
25     [%# dupe_search_encoded is uri escaped in the JS %]
26     <div class="alert alert-danger" ng-show="dupe_counts.name">
27       <a target="_blank"
28         href="/eg/staff/circ/patron/search?search={{dupe_search_encoded}}&inactive=1">
29       [% l('[_1] patron(s) with same name', '{{dupe_counts.name}}') %]
30       </a>
31     </div>
32     <div class="alert alert-danger" ng-show="dupe_counts.email">
33       <a target="_blank"
34         href="/eg/staff/circ/patron/search?search={{dupe_search_encoded}}">
35         [% l('[_1] patron(s) with same email', 
36         '{{dupe_counts.email}}') %]</a>
37     </div>
38     <div class="alert alert-danger" ng-show="dupe_counts.ident">
39       <a target="_blank" 
40         href="/eg/staff/circ/patron/search?search={{dupe_search_encoded}}">
41         [% l('[_1] patron(s) with same identification', 
42         '{{dupe_counts.ident}}') %]</a>
43     </div>
44     <div class="alert alert-danger" ng-show="dupe_counts.phone">
45       <a target="_blank" 
46         href="/eg/staff/circ/patron/search?search={{dupe_search_encoded}}">
47         [% l('[_1] patron(s) with same phone', 
48         '{{dupe_counts.phone}}') %]</a>
49     </div>
50     <div class="alert alert-danger" ng-show="dupe_counts.address">
51       <a target="_blank" 
52         href="/eg/staff/circ/patron/search?search={{dupe_search_encoded}}" >
53         [% l('[_1] patron(s) with same address', 
54         '{{dupe_counts.address}}') %]</a>
55     </div>
56   </div>
57
58   <div class="alert alert-danger" ng-show="address_alerts.length > 0">
59       <div class="strong-text-3">[% l('Address Alert') %]</div>
60       <div ng-repeat="address_alert in address_alerts">
61         {{address_alert.alert_message()}}
62       </div>
63   </div>
64
65   <!-- IDL field documentation window -->
66   <div class="alert alert-info" ng-show="selected_field_doc">
67     <fieldset id="reg-field-doc">
68       <legend>
69       {{idl_fields[selected_field_doc.fm_class()][selected_field_doc.field()].label}}
70       </legend>
71       <div>{{selected_field_doc.string()}}</div>
72     </fieldset>
73   </div>
74
75   <div class="alert alert-info" ng-show="stage_user_requestor">
76     <a target="_blank" 
77       href="/eg/staff/circ/patron/{{stage_user.reqesting_usr()}}/edit">
78       [% l('Requested by [_1]', '{{stage_user_requestor}}') %]
79     </a>
80   </div>
81 </div>
82
83 [% MACRO draw_field_label (cls, field) BLOCK %]
84   <div class="col-md-3 reg-field-label"> <!-- field label -->
85     <label>{{idl_fields.[% cls %].[% field %].label}}</label>
86     <!-- field documentation img/link -->
87     <img ng-show="field_doc.[% cls %].[% field %]" 
88       ng-click="set_selected_field_doc('[% cls %]','[% field %]')"
89       src='[% DOC_IMG %]'></img>
90   </div>
91 [% END %]
92
93
94 [% 
95 # draws a vanilla form input field for inputs that require no 
96 # special additions.
97 MACRO draw_form_input(cls, field, path, type, disable) BLOCK;
98   IF !type; type = 'text'; END;
99   base_obj = path ? 'patron.' _ path : 'patron';
100   model = base_obj _ '.' _ field;
101 %]
102   <div class="col-md-3 reg-field-input">
103     <input 
104       type="[% type %]" 
105       class="form-control" 
106       name="[% model %]"
107       ng-change="field_modified()" 
108       ng-required="field_required('[% cls %]', '[% field %]')"
109       ng-blur="handle_field_changed([% base_obj %], '[% field %]')"
110       ng-pattern="field_pattern('[% cls %]', '[% field %]')"
111       [% IF disable %]ng-disabled="[% disable %]"[% END %]
112       ng-model="[% model %]"/>
113   </div>
114 [% END %]
115
116 [% MACRO draw_example_text(cls, field) BLOCK;
117   set_str = "org_settings['ui.patron.edit." _ cls _ "." _ field _ ".example']";
118 %]
119   <span ng-if="[% set_str %]">
120     [% l('Example: [_1]', '{{' _ set_str _ '}}') %]
121   </span>
122 [% END %]
123
124 <!-- progress dialog displayed as we await all data to finish loading -->
125 <div class="row" ng-show="!page_data_loaded">
126   <div class="col-md-6 pad-vert">
127     <div class="progress progress-striped active">
128         <div class="progress-bar"  role="progressbar" aria-valuenow="100" 
129               aria-valuemin="0" aria-valuemax="100" style="width: 100%">
130             <span class="sr-only">[% l('Loading...') %]</span>
131         </div>
132     </div>
133   </div>
134 </div>
135
136 <!--  
137 MAIN FORM
138 This div wraps the entire form so we can hide it until all needed data
139 has been loaded.  Setting ng-form and a name lets us refer to fields
140 within the "form" by name for validation.
141 -->
142 <div ng-form id="patron-reg-container" 
143   name="reg_form" ng-show="page_data_loaded">
144
145 <!-- BARCODE -->
146
147 <div class="row reg-field-row" ng-show="show_field('ac.barcode')">
148   [% draw_field_label('ac', 'barcode') %]
149   <div class="col-md-3 reg-field-input"> <!-- field form input -->
150       <input type="text" 
151         name="barcode"
152         ng-model="patron.card.barcode"
153         ng-pattern="field_pattern('ac', 'barcode')"
154         ng-required="field_required('ac', 'barcode')"
155         focus-me="focus_bc"
156         ng-change="field_modified()" 
157         ng-disabled="disable_bc"
158         class="form-control" 
159         ng-blur="handle_field_changed(patron.card, 'barcode')"/>
160   </div>
161   <div class="col-md-6 patron-reg-example">
162       <button class="btn btn-default" ng-show="!patron.isnew"
163         ng-click="replace_card()">[% l('Replace Barcode') %]</button>
164       <button class="btn btn-default" ng-if="!patron.isnew" 
165         ng-click="cards_dialog()">[% l('See All') %]</button>
166       <div ng-show="dupe_barcode" class="patron-reg-validation-alert">
167         <span>[% l('Barcode is already in use') %]</span>
168       </div>
169   </div>
170 </div>
171
172 <!-- USRNAME -->
173
174 <div class="row reg-field-row" ng-show="show_field('au.usrname')">
175   [% draw_field_label('au', 'usrname') %]
176   <div class="col-md-3 reg-field-input">
177     <input type="text" 
178       name='usrname'
179       ng-required="field_required('au', 'usrname')"
180       focus-me="focus_usrname"
181       ng-change="field_modified()" 
182       ng-pattern="field_pattern('au', 'usrname')"
183       ng-blur="handle_field_changed(patron, 'usrname')"
184       class="form-control" 
185       ng-model="patron.usrname"/>
186   </div>
187   <div class="col-md-6 patron-reg-example">
188     <div ng-show="dupe_username" class="patron-reg-validation-alert">
189       <span>[% l('Username is already in use') %]</span>
190     </div>
191   </div>
192 </div>
193
194 <!-- PASSWD -->
195
196 <div class="row reg-field-row" ng-show="show_field('au.passwd')">
197   [% draw_field_label('au', 'passwd') %]
198   [% draw_form_input('au', 'passwd'); %]
199   <div class="col-md-6 patron-reg-example">
200     <button class="btn btn-default" ng-click="generate_password()">
201       [% l('Generate Password') %]</button>
202   </div>
203 </div>
204
205 <!-- PREFIX -->
206
207 <div class="row reg-field-row" ng-show="show_field('au.prefix')">
208   [% draw_field_label('au', 'prefix') %]
209   [% draw_form_input('au', 'prefix'); %]
210   <div class="col-md-6 patron-reg-example">
211     [% draw_example_text('au', 'prefix') %]
212   </div>
213 </div>
214
215 <!-- FIRST_GIVEN_NAME -->
216
217 <div class="row reg-field-row" ng-show="show_field('au.first_given_name')">
218   [% draw_field_label('au', 'first_given_name') %]
219   [% draw_form_input('au', 'first_given_name'); %]
220   <div class="col-md-6 patron-reg-example">
221     [% draw_example_text('au', 'first_given_name') %]
222   </div>
223 </div>
224
225 <!-- SECOND_GIVEN_NAME -->
226
227 <div class="row reg-field-row" ng-show="show_field('au.second_given_name')">
228   [% draw_field_label('au', 'second_given_name') %]
229   [% draw_form_input('au', 'second_given_name'); %]
230   <div class="col-md-6 patron-reg-example">
231     [% draw_example_text('au', 'second_given_name') %]
232   </div>
233 </div>
234
235 <!-- FAMILY_NAME -->
236
237 <div class="row reg-field-row" ng-show="show_field('au.family_name')">
238   [% draw_field_label('au', 'family_name') %]
239   [% draw_form_input('au', 'family_name'); %]
240   <div class="col-md-6 patron-reg-example">
241     [% draw_example_text('au', 'family_name') %]
242   </div>
243 </div>
244
245 <!-- SUFFIX -->
246
247 <div class="row reg-field-row" ng-show="show_field('au.suffix')">
248   [% draw_field_label('au', 'suffix') %]
249   [% draw_form_input('au', 'suffix'); %]
250   <div class="col-md-6 patron-reg-example">
251     [% draw_example_text('au', 'suffix') %]
252   </div>
253 </div>
254
255 <!-- ALIAS -->
256
257 <div class="row reg-field-row" ng-show="show_field('au.alias')">
258   [% draw_field_label('au', 'alias') %]
259   [% draw_form_input('au', 'alias'); %]
260   <div class="col-md-6 patron-reg-example">
261     [% draw_example_text('au', 'alias') %]
262   </div>
263 </div>
264
265 <!-- DOB -->
266
267 <div class="row reg-field-row" ng-show="show_field('au.dob')">
268   [% draw_field_label('au', 'dob') %]
269   <div class="col-md-3 reg-field-input">
270     <eg-date-input 
271       ng-model="patron.dob"
272       ng-blur="handle_field_changed(patron, 'dob')">
273     </eg-date-input>
274   </div>
275   <div class="col-md-6 patron-reg-example">
276     [% draw_example_text('au', 'dob') %]
277   </div>
278 </div>
279
280 <!-- JUVENILE -->
281
282 <div class="row reg-field-row" ng-show="show_field('au.juvenile')">
283   [% draw_field_label('au', 'juvenile') %]
284   <div class="col-md-3 reg-field-input">
285     <div class='checkbox'>
286       <input 
287         ng-change="field_modified()" 
288         ng-blur="handle_field_changed(patron, 'juvenile')"
289         type='checkbox' ng-model="patron.juvenile"/>
290     </div>
291   </div>
292 </div>
293
294 <!-- ident_type -->
295
296 <div class="row reg-field-row" ng-show="show_field('au.ident_type')">
297   [% draw_field_label('au', 'ident_type') %]
298   <div class="col-md-3 reg-field-input">
299     <select 
300       class="form-control" 
301       ng-model="patron.ident_type"
302       ng-required="field_required('au', 'ident_type')"
303       ng-blur="handle_field_changed(patron, 'ident_type')"
304       ng-options="type.name() for type in ident_types track by type.id()">
305     </select>
306   </div>
307 </div>
308
309 <!-- IDENT_VALUE -->
310
311 <div class="row reg-field-row" ng-show="show_field('au.ident_value')">
312   [% draw_field_label('au', 'ident_value') %]
313   [% draw_form_input('au', 'ident_value') %]
314   <div class="col-md-6 patron-reg-example">
315     [% draw_example_text('au', 'ident_value') %]
316   </div>
317 </div>
318
319 <!-- IDENT_VALUE2 -->
320 <div class="row reg-field-row" ng-show="show_field('au.ident_value2')">
321   [% draw_field_label('au', 'ident_value2') %]
322   [% draw_form_input('au', 'ident_value2') %]
323   <div class="col-md-6 patron-reg-example">
324     [% draw_example_text('au', 'ident_value2') %]
325   </div>
326 </div>
327
328
329 <!-- EMAIL -->
330 <div class="row reg-field-row" ng-show="show_field('au.email')">
331   [% draw_field_label('au', 'email') %]
332   [% draw_form_input('au', 'email', '', 'email') %]
333   <div class="col-md-6 patron-reg-example">
334     <button ng-show="patron.email && !patron.isnew" 
335       class="btn btn-default" 
336       ng-click="invalidate_field('email')">[% l('Invalidate') %]</button>
337     <span ng-if="org_settings['ui.patron.edit.au.email.example']">
338       [% l('Example: [_1]',
339         "{{org_settings['ui.patron.edit.au.email.example']}}") %]
340     </span>
341   </div>
342 </div>
343
344 <div class="row reg-field-row" ng-show="show_field('au.email') && opt_in_setting_types['circ.send_email_checkout_receipts']">
345   <div class="col-md-3 reg-field-label">
346     <label>{{opt_in_setting_types['circ.send_email_checkout_receipts'].label()}}</label>
347   </div>
348   <div class="col-md-3 reg-field-input">
349     <input
350       ng-change="field_modified()"
351       type='checkbox' ng-model="user_settings['circ.send_email_checkout_receipts']"/>
352   </div>
353 </div>
354
355 <!-- DAY_PHONE -->
356
357 <div class="row reg-field-row" ng-show="show_field('au.day_phone')">
358   [% draw_field_label('au', 'day_phone') %]
359   [% draw_form_input('au', 'day_phone') %]
360   <div class="col-md-6 patron-reg-example">
361     <button ng-show="patron.day_phone && !patron.isnew" 
362         class="btn btn-default" 
363         ng-click="invalidate_field('day_phone')">[% l('Invalidate') %]</button>
364     [% draw_example_text('au', 'day_phone') %]
365     <!-- phones have a fall-through example strings -->
366     <span ng-if="!org_settings['ui.patron.edit.au.day_phone.example'] && org_settings['ui.patron.edit.phone.example']">
367       [% l('Example: [_1]', 
368         "{{org_settings['ui.patron.edit.phone.example']}}") %]
369     </span>
370   </div>
371 </div>
372
373 <!-- EVENING_PHONE -->
374
375 <div class="row reg-field-row" ng-show="show_field('au.evening_phone')">
376   [% draw_field_label('au', 'evening_phone') %]
377   [% draw_form_input('au', 'evening_phone') %]
378   <div class="col-md-6 patron-reg-example">
379     <button ng-show="patron.evening_phone && !patron.isnew" 
380         class="btn btn-default" 
381         ng-click="invalidate_field('evening_phone')">[% l('Invalidate') %]</button>
382     [% draw_example_text('au', 'evening_phone') %]
383     <!-- phones have a fall-through example strings -->
384     <span ng-if="!org_settings['ui.patron.edit.au.evening_phone.example'] && org_settings['ui.patron.edit.phone.example']">
385       [% l('Example: [_1]', 
386         "{{org_settings['ui.patron.edit.phone.example']}}") %]
387     </span>
388   </div>
389 </div>
390
391 <!-- OTHER_PHONE -->
392
393 <div class="row reg-field-row" ng-show="show_field('au.other_phone')">
394   [% draw_field_label('au', 'other_phone') %]
395   [% draw_form_input('au', 'other_phone') %]
396   <div class="col-md-6 patron-reg-example">
397     <button ng-show="patron.other_phone && !patron.isnew" 
398         class="btn btn-default" 
399         ng-click="invalidate_field('other_phone')">[% l('Invalidate') %]</button>
400     [% draw_example_text('au', 'other_phone') %]
401     <!-- phones have a fall-through example strings -->
402     <span ng-if="!org_settings['ui.patron.edit.au.other_phone.example'] && org_settings['ui.patron.edit.phone.example']">
403       [% l('Example: [_1]', 
404         "{{org_settings['ui.patron.edit.phone.example']}}") %]
405     </span>
406   </div>
407 </div>
408
409 <!-- home org unit selector -->
410
411 <div class="row reg-field-row" ng-show="show_field('au.home_ou')">
412   [% draw_field_label('au', 'home_ou') %]
413   <div class="col-md-3 reg-field-input">
414     <eg-org-selector 
415       selected="patron.home_ou" 
416       onchange="handle_home_org_changed"
417       disable-test="disable_home_org">
418     </eg-org-selector>
419   </div>
420 </div>
421
422 <!-- profile selector -->
423
424 <div class="row reg-field-row" ng-show="show_field('au.profile')">
425   [% draw_field_label('au', 'profile') %]
426   <div class="col-md-3 reg-field-input">
427     <div class="btn-group" uib-dropdown>
428       <button type="button" class="btn btn-default" uib-dropdown-toggle
429           ng-class="{'ng-invalid' : invalid_profile()}">
430         <span style="padding-right: 5px;">
431           {{patron.profile.name() || "[% l('Profile Group') %]"}}
432         </span>
433         <span class="caret"></span>
434       </button>
435       <ul uib-dropdown-menu>
436         <li ng-repeat="grp in edit_profiles" 
437           ng-class="{disabled : grp.usergroup() == 'f'}">
438           <a href 
439             style="padding-left: {{pgt_depth(grp) * 10 + 5}}px"
440             ng-click="set_profile(grp)">{{grp.name()}}</a>
441         </li>
442       </ul>
443     </div>
444   </div>
445   <div class="col-md-3">
446     <button class="btn btn-default" ng-if="!offline" ng-disabled="!perms.CREATE_USER_GROUP_LINK"
447       ng-click="secondary_groups_dialog()">[% l('Secondary Groups') %]</button>
448   </div> 
449 </div>
450
451 <div class="row reg-field-row" ng-show="show_field('au.expire_date')">
452   [% draw_field_label('au', 'expire_date') %]
453   <div class="col-md-3 reg-field-input">
454     <eg-date-input 
455       ng-blur="handle_field_changed(patron, 'expire_date')"
456       ng-model="patron.expire_date">
457     </eg-date-input>
458   </div>
459   <div class="col-md-3">
460     <button class="btn btn-default" ng-click="set_expire_date()">
461       [% l('Update Expire Date') %]</button>
462   </div>
463 </div>
464
465 <!-- net_access_level -->
466
467 <div class="row reg-field-row" ng-show="show_field('au.net_access_level')">
468   [% draw_field_label('au', 'net_access_level') %]
469   <div class="col-md-3 reg-field-input">
470     <select 
471       class="form-control" 
472       ng-model="patron.net_access_level"
473       ng-required="field_required('au', 'net_access_level')"
474       ng-blur="handle_field_changed(patron, 'net_access_level')"
475       ng-options="level.name() for level in net_access_levels track by level.id()">
476     </select>
477   </div>
478 </div>
479
480 <!-- ACTIVE -->
481
482 <div class="row reg-field-row" ng-show="show_field('au.active')">
483   [% draw_field_label('au', 'active') %]
484   <div class="col-md-3 reg-field-input">
485     <div class='checkbox'>
486       <input 
487         ng-change="field_modified()" 
488         ng-blur="handle_field_changed(patron, 'active')"
489         type='checkbox' ng-model="patron.active"/>
490     </div>
491   </div>
492 </div>
493
494 <!-- BARRED -->
495
496 <div class="row reg-field-row" ng-show="show_field('au.barred')">
497   [% draw_field_label('au', 'barred') %]
498   <div class="col-md-3 reg-field-input">
499     <div class='checkbox'>
500       <input 
501         ng-change="field_modified()" 
502         ng-blur="handle_field_changed(patron, 'barred')"
503         type='checkbox' ng-model="patron.barred"/>
504     </div>
505   </div>
506 </div>
507
508 <!-- MASTER_ACCOUNT -->
509
510 <div class="row reg-field-row" ng-show="show_field('au.master_account')">
511   [% draw_field_label('au', 'master_account') %]
512   <div class="col-md-3 reg-field-input">
513     <div class='checkbox'>
514       <input 
515         ng-change="field_modified()" 
516         ng-blur="handle_field_changed(patron, 'master_account')"
517         type='checkbox' ng-model="patron.master_account"/>
518     </div>
519   </div>
520 </div>
521
522 <!-- CLAIMS_RETURNED_COUNT -->
523
524 <div class="row reg-field-row" ng-show="show_field('au.claims_returned_count')">
525   [% draw_field_label('au', 'claims_returned_count') %]
526   [% draw_form_input('au', 'claims_returned_count', 
527     '', 'number', '!perms.UPDATE_PATRON_CLAIM_RETURN_COUNT') %]
528   <div class="col-md-6 patron-reg-example">
529     [% draw_example_text('au', 'claims_returned_count') %]
530   </div>
531 </div>
532
533 <!-- CLAIMS_NEVER_CHECKED_OUT_COUNT -->
534
535 <div class="row reg-field-row" ng-show="show_field('au.claims_never_checked_out_count')">
536   [% draw_field_label('au', 'claims_never_checked_out_count') %]
537   [% draw_form_input('au', 'claims_never_checked_out_count',
538     '', 'number', '!perms.UPDATE_PATRON_CLAIM_NEVER_CHECKED_OUT_COUNT') %]
539   <div class="col-md-6 patron-reg-example">
540     [% draw_example_text('au', 'claims_never_checked_out_count') %]
541   </div>
542 </div>
543
544 <!-- ALERT_MESSAGE -->
545
546 <div class="row reg-field-row" ng-show="show_field('au.alert_message')">
547   [% draw_field_label('au', 'alert_message') %]
548   <div class="col-md-3 reg-field-input">
549     <textarea 
550       class="form-control" 
551       ng-model="patron.alert_message"
552       ng-pattern="field_pattern('au', 'alert_message')"
553       ng-change="field_modified()" 
554       ng-blur="handle_field_changed(patron, 'alert_message')">
555     </textarea>
556   </div>
557   <div class="col-md-6 patron-reg-example">
558     [% draw_example_text('au', 'alert_message') %]
559   </div>
560 </div>
561
562 <div ng-if="!offline">
563
564 <div class="alert alert-success row" role="alert">
565   <div class="col-md-6">[% l('User Settings') %]</div>
566 </div>
567
568 <div class="row reg-field-row">
569   <div class="col-md-3 reg-field-label">
570     <label>{{user_setting_types['opac.default_phone'].label()}}</label>
571   </div>
572   <div class="col-md-3 reg-field-input">
573     <input 
574       ng-change="field_modified()" 
575       type='text' ng-model="user_settings['opac.default_phone']"/>
576   </div>
577 </div>
578
579 <div class="row reg-field-row">
580   <div class="col-md-3 reg-field-label">
581     <label>{{user_setting_types['opac.default_pickup_location'].label()}}</label>
582   </div>
583   <div class="col-md-3 reg-field-input">
584     <eg-org-selector 
585       xonchange="field_modified" 
586       selected="patron.home_ou"></eg-org-selector>
587   </div>
588 </div>
589
590 <div class="row reg-field-row" 
591     ng-if="org_settings['circ.holds.behind_desk_pickup_supported']">
592   <div class="col-md-3 reg-field-label">
593     <label>{{user_setting_types['circ.holds_behind_desk'].label()}}</label>
594   </div>
595   <div class="col-md-3 reg-field-input">
596     <div class='checkbox'>
597       <input 
598         ng-change="field_modified()" 
599         type='checkbox' ng-model="user_settings['circ.holds_behind_desk']"/>
600     </div>
601   </div>
602 </div>
603
604 <!-- TODO: Add circ.collections.exempt to master SQL seed data -->
605 <div class="row reg-field-row" 
606   ng-if="user_setting_types['circ.collections.exempt']">
607   <div class="col-md-3 reg-field-label">
608     <label>{{user_setting_types['circ.collections.exempt'].label()}}</label>
609   </div>
610   <div class="col-md-3 reg-field-input">
611     <div class='checkbox'>
612       <input 
613         type='checkbox' 
614         ng-change="field_modified()" 
615         ng-disabled="!perms.UPDATE_PATRON_COLLECTIONS_EXEMPT"
616         ng-model="user_settings['circ.collections.exempt']"/>
617     </div>
618   </div>
619 </div>
620
621 <div class="row reg-field-row">
622   <div class="col-md-3 reg-field-label">
623     <label>[% l('Holds Notices') %]</label>
624   </div>
625   <div class="col-md-3 reg-field-input flex-row">
626     <div class='flex-cell'>
627       <input 
628         ng-change="field_modified()" 
629         type='checkbox' ng-model="hold_notify_type.phone"/>
630       [% l('Phone') %]
631     </div>
632     <div class='flex-cell'>
633       <input 
634         ng-change="field_modified()" 
635         type='checkbox' ng-model="hold_notify_type.email"/>
636       [% l('Email') %]
637     </div>
638     <div class='flex-cell' ng-if="org_settings['sms.enable']">
639       <input 
640         ng-change="field_modified()" 
641         type='checkbox' ng-model="hold_notify_type.sms"/>
642       [% l('SMS') %]
643     </div>
644   </div>
645 </div>
646
647 <div class="row reg-field-row" ng-if="org_settings['sms.enable']">
648   <div class="col-md-3 reg-field-label">
649     <label>[% l('Default SMS/Text Number') %]</label>
650   </div>
651   <div class="col-md-3 reg-field-input">
652     <input 
653       ng-change="field_modified()" ng-model="user_settings['opac.default_sms_notify']"
654       type='text'/>
655   </div>
656 </div>
657
658 <div class="row reg-field-row" ng-if="org_settings['sms.enable']">
659   <div class="col-md-3 reg-field-label">
660     <label>[% l('Default SMS Carrier') %]</label>
661   </div>
662   <div class="col-md-3 reg-field-input">
663     <span class="nullable">
664       <select class="form-control" ng-model="user_settings['opac.default_sms_carrier']" ng-options="c.id() as c.name() for c in sms_carriers">
665         <option value="">Select a Carrier</option>
666       </select>
667     </span>
668   </div>
669 </div>
670
671 <div class="row reg-field-row" ng-repeat="type in opt_in_setting_types">
672   <div class="col-md-3 reg-field-label" ng-if="type.name() != 'circ.send_email_checkout_receipts'">
673     <label>{{type.label()}}</label>
674   </div>
675   <div class="col-md-3 reg-field-input" ng-if="type.name() != 'circ.send_email_checkout_receipts'">
676     <input 
677       ng-change="field_modified()" 
678       type='checkbox' ng-model="user_settings[type.name()]"/>
679   </div>
680 </div>
681
682 </div> <!-- end offline test -->
683
684 <!-- addresses -->
685
686 <div ng-repeat="addr in patron.addresses">
687   <div class="alert alert-success row" role="alert">
688       <div class="col-md-3">
689         [% l('Address') %]
690         <div ng-show="addr._linked_owner">
691           (<a target="_blank"
692             href="/eg/staff/circ/patron/{{addr._linked_owner_id}}/edit">
693             [% l('Owned by [_1]', '{{addr._linked_owner}}') %]
694           </a>)
695         </div>
696       </div>
697       <div class="col-md-3">
698           <span class='pad-all-min'>
699             [% l('Mailing') %] <input type='checkbox' 
700               ng-change="field_modified();set_addr_type(addr, 'mailing')" 
701               ng-model="addr._is_mailing"/>
702           </span>
703           <span class='pad-all-min'>
704             [% l('Physical') %] <input type='checkbox' 
705               ng-change="field_modified();set_addr_type(addr, 'billing')" 
706               ng-model="addr._is_billing"/>
707           </span>
708           <span class='pad-all-min'>
709             <button type="button" 
710               ng-click="field_modified();delete_address(addr.id)" 
711               class="btn btn-danger">[% l('X') %]</button>
712           </span>
713       </div>
714   </div>
715
716   <!-- ADDRESS_TYPE -->
717   <div class="row reg-field-row" ng-show="show_field('aua.address_type')">
718     [% draw_field_label('aua', 'address_type') %]
719     [% draw_form_input('aua', 
720       'address_type', 'addresses[$index]', '', 'addr._linked_owner') %]
721     <div class="col-md-6 patron-reg-example">
722       [% draw_example_text('aua', 'address_type') %]
723     </div>
724   </div>
725
726   <!-- POST_CODE -->
727
728   <div class="row reg-field-row" ng-show="show_field('aua.post_code')">
729     [% draw_field_label('aua', 'post_code') %]
730     [% draw_form_input('aua', 
731       'post_code', 'addresses[$index]', '', 'addr._linked_owner') %]
732     <div class="col-md-6 patron-reg-example">
733       [% draw_example_text('aua', 'post_code') %]
734     </div>
735   </div>
736
737   <!-- STREET1 -->
738
739   <div class="row reg-field-row" ng-show="show_field('aua.street1')">
740     [% draw_field_label('aua', 'street1') %]
741     [% draw_form_input('aua', 
742       'street1', 'addresses[$index]', '', 'addr._linked_owner') %]
743     <div class="col-md-6 patron-reg-example">
744       [% draw_example_text('aua', 'street1') %]
745     </div>
746   </div>
747
748   <!-- STREET2 -->
749
750   <div class="row reg-field-row" ng-show="show_field('aua.street2')">
751     [% draw_field_label('aua', 'street2') %]
752     [% draw_form_input('aua', 
753       'street2', 'addresses[$index]', '', 'addr._linked_owner') %]
754     <div class="col-md-6 patron-reg-example">
755       [% draw_example_text('aua', 'street2') %]
756     </div>
757   </div>
758
759   <!-- CITY -->
760
761   <div class="row reg-field-row" ng-show="show_field('aua.city')">
762     [% draw_field_label('aua', 'city') %]
763     [% draw_form_input('aua', 
764       'city', 'addresses[$index]', '', 'addr._linked_owner') %]
765     <div class="col-md-6 patron-reg-example">
766       [% draw_example_text('aua', 'city') %]
767     </div>
768   </div>
769
770   <!-- COUNTY -->
771
772   <div class="row reg-field-row" ng-show="show_field('aua.county')">
773     [% draw_field_label('aua', 'county') %]
774     [% draw_form_input('aua', 
775       'county', 'addresses[$index]', '', 'addr._linked_owner') %]
776     <div class="col-md-6 patron-reg-example">
777       [% draw_example_text('aua', 'county') %]
778     </div>
779   </div>
780
781   <!-- STATE -->
782
783   <div class="row reg-field-row" ng-show="show_field('aua.state')">
784     [% draw_field_label('aua', 'state') %]
785     [% draw_form_input('aua', 
786       'state', 'addresses[$index]', '', 'addr._linked_owner') %]
787     <div class="col-md-6 patron-reg-example">
788       [% draw_example_text('aua', 'state') %]
789     </div>
790   </div>
791
792   <!-- COUNTRY -->
793
794   <div class="row reg-field-row" ng-show="show_field('aua.country')">
795     [% draw_field_label('aua', 'country') %]
796     [% draw_form_input('aua', 
797       'country', 'addresses[$index]', '', 'addr._linked_owner') %]
798     <div class="col-md-6 patron-reg-example">
799       [% draw_example_text('aua', 'country') %]
800     </div>
801   </div>
802
803   <!-- VALID -->
804
805   <div class="row reg-field-row" ng-show="show_field('aua.valid')">
806     [% draw_field_label('aua', 'valid') %]
807     <div class="col-md-3 reg-field-input">
808       <div class='checkbox'>
809         <input 
810           type='checkbox' 
811           ng-change="field_modified()" 
812           ng-disabled='addr._linked_owner'
813           ng-blur="handle_field_changed(patron.addresses[$index], 'valid')"
814           ng-model="patron.addresses[$index].valid"/>
815       </div>
816     </div>
817     <div class="col-md-6 patron-reg-example">
818       [% draw_example_text('aua', 'valid') %]
819     </div>
820   </div>
821
822   <!-- WITHIN_CITY_LIMITS -->
823
824   <div class="row reg-field-row" ng-show="show_field('aua.within_city_limits')">
825     [% draw_field_label('aua', 'within_city_limits') %]
826     <div class="col-md-3 reg-field-input">
827       <div class='checkbox'>
828         <input 
829           type='checkbox' 
830           ng-change="field_modified()" 
831           ng-disabled='addr._linked_owner'
832           ng-blur="handle_field_changed(patron.addresses[$index], 'within_city_limits')"
833           ng-model="patron.addresses[$index].within_city_limits"/>
834       </div>
835     </div>
836     <div class="col-md-6 patron-reg-example">
837       [% draw_example_text('aua', 'within_city_limits') %]
838     </div>
839   </div>
840
841   <!-- pending address -->
842
843 </div> <!-- addresses -->
844
845 <div class="row">
846   <button type="button" ng-click="new_address()" 
847     class="btn btn-success">[% l('New Address') %]</button>
848 </div>
849
850 <div ng-if="!offline">
851 <div class="alert alert-success row" role="alert"
852     ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-if="stat_cats.length > 0">
853     <div class="col-md-6">[% l('Statistical Categories') %]</div>
854 </div>
855
856 <div class="row reg-field-row"
857      ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-repeat="cat in stat_cats">
858      <!-- Display this stat cat when displaying all stat cats
859        or when this stat cat is required.  Wrap the body of
860        stat cat display in a div for easy show/hide.  -->
861   <div ng-if="show_field('stat_cats') || cat.required() == 1">
862
863     <div class="col-md-3 reg-field-label">
864       <label>{{cat.name()}}</label>
865     </div>
866     <div class="col-md-3 reg-field-input">
867       <div ng-if="cat.entries().length != 0">
868         <div class="btn-group" uib-dropdown>
869           <button type="button" class="btn btn-default" ng-class="{'ng-invalid': cat.required() == 1 && !stat_cat_entry_maps[cat.id()] }" uib-dropdown-toggle>
870             <span style="padding-right: 5px;">
871               {{stat_cat_entry_maps[cat.id()]}}</span>
872             <span class="caret"></span>
873           </button>
874           <ul uib-dropdown-menu>
875             <li ng-repeat="entry in cat.entries()">
876               <a href
877                 ng-click="field_modified();stat_cat_entry_maps[cat.id()]=entry.value()">
878                 {{entry.value()}}
879               </a>
880             </li>
881           </ul>
882         </div>
883       </div>
884     </div>
885
886     <!-- Stat cat retrieval API uses open-ils.storage under the covers
887         which represents DB bools at 1/0 instead of cstore-style t/f -->
888     <div class="col-md-3 reg-field-input"
889       ng-show="show_field('stat_cats') || hasRequiredStatCat"
890       ng-if="cat.allow_freetext() == '1'">
891       <input type="text" ng-model="stat_cat_entry_maps[cat.id()]"
892         class="form-control" ng-required="cat.required() == 1"/>
893     </div>
894
895   </div><!-- show/hide wrapper -->
896 </div>
897 </div>
898
899 <!-- surveys -->
900
901 <div class="alert alert-success row" role="alert" 
902     ng-show="show_field('surveys')" ng-if="surveys.length > 0">
903     <div class="col-md-6">[% l('Surveys') %]</div>
904 </div>
905
906 <div class="row reg-field-row" 
907     ng-show="show_field('surveys')" ng-repeat="survey in surveys">
908   <div class="col-md-3 reg-field-label">
909     <label>{{survey.name()}}</label>
910   </div>
911   <div class="col-md-6 reg-field-input">
912     <div class="row" ng-repeat="question in survey.questions()" 
913       style="margin-bottom: 10px;">
914       <div class="col-md-6">{{question.question()}}</div>
915       <div class="col-md-6">
916         <div class="btn-group" uib-dropdown>
917           <button type="button" class="btn btn-default" uib-dropdown-toggle>
918             <span style="padding-right: 5px;">
919               {{survey_responses[question.id()].answer()}}
920             </span>
921             <span class="caret"></span>
922           </button>
923           <ul uib-dropdown-menu>
924             <li ng-repeat="answer in question.answers()">
925               <a href 
926                 ng-click="field_modified();survey_responses[question.id()] = answer"> 
927                 {{answer.answer()}} 
928               </a>
929             </li>
930           </ul>
931         </div>
932       </div>
933     </div>
934   </div>
935 </div>
936
937 </div><!-- /form wrapper -->