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