LP#1748006 Patron edit juv flag manual override
[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     </eg-date-input>
286   </div>
287   <div class="col-md-6 patron-reg-example">
288     [% draw_example_text('au', 'dob') %]
289   </div>
290 </div>
291
292 <!-- JUVENILE -->
293
294 <div class="row reg-field-row" ng-show="show_field('au.juvenile')">
295   [% draw_field_label('au', 'juvenile') %]
296   <div class="col-md-3 reg-field-input">
297     <div class='checkbox'>
298       <input 
299         ng-change="field_modified()" 
300         ng-blur="handle_field_changed(patron, 'juvenile')"
301         type='checkbox' ng-model="patron.juvenile"/>
302     </div>
303   </div>
304 </div>
305
306 <!-- ident_type -->
307
308 <div class="row reg-field-row" ng-show="show_field('au.ident_type')">
309   [% draw_field_label('au', 'ident_type') %]
310   <div class="col-md-3 reg-field-input">
311     <select 
312       class="form-control" 
313       ng-model="patron.ident_type"
314       ng-required="field_required('au', 'ident_type')"
315       ng-blur="handle_field_changed(patron, 'ident_type')"
316       ng-options="type.name() for type in ident_types track by type.id()">
317     </select>
318   </div>
319 </div>
320
321 <!-- IDENT_VALUE -->
322
323 <div class="row reg-field-row" ng-show="show_field('au.ident_value')">
324   [% draw_field_label('au', 'ident_value') %]
325   [% draw_form_input('au', 'ident_value') %]
326   <div class="col-md-6 patron-reg-example">
327     [% draw_example_text('au', 'ident_value') %]
328   </div>
329 </div>
330
331 <!-- ident_type2 -->
332
333 <div class="row reg-field-row" ng-show="show_field('au.ident_type2')">
334   [% draw_field_label('au', 'ident_type2') %]
335   <div class="col-md-3 reg-field-input">
336     <select 
337       class="form-control" 
338       ng-model="patron.ident_type2"
339       ng-required="field_required('au', 'ident_type2')"
340       ng-blur="handle_field_changed(patron, 'ident_type2')"
341       ng-options="type.name() for type in ident_types track by type.id()">
342     </select>
343   </div>
344 </div>
345
346 <!-- IDENT_VALUE2 -->
347 <div class="row reg-field-row" ng-show="show_field('au.ident_value2')">
348   [% draw_field_label('au', 'ident_value2') %]
349   [% draw_form_input('au', 'ident_value2') %]
350   <div class="col-md-6 patron-reg-example">
351     [% draw_example_text('au', 'ident_value2') %]
352   </div>
353 </div>
354
355
356 <!-- EMAIL -->
357 <div class="row reg-field-row" ng-show="show_field('au.email')">
358   [% draw_field_label('au', 'email') %]
359   [% draw_form_input('au', 'email', '', 'email') %]
360   <div class="col-md-6 patron-reg-example">
361     <button ng-show="patron.email && !patron.isnew" 
362       class="btn btn-default" 
363       ng-click="invalidate_field('email')">[% l('Invalidate') %]</button>
364     <span ng-if="org_settings['ui.patron.edit.au.email.example']">
365       [% l('Example: [_1]',
366         "{{org_settings['ui.patron.edit.au.email.example']}}") %]
367     </span>
368   </div>
369 </div>
370
371 <div class="row reg-field-row" ng-show="show_field('au.email') && opt_in_setting_types['circ.send_email_checkout_receipts']">
372   <div class="col-md-3 reg-field-label">
373     <label>{{opt_in_setting_types['circ.send_email_checkout_receipts'].label()}}</label>
374   </div>
375   <div class="col-md-3 reg-field-input">
376     <input
377       ng-change="field_modified()"
378       type='checkbox' ng-model="user_settings['circ.send_email_checkout_receipts']"/>
379   </div>
380 </div>
381
382 <!-- DAY_PHONE -->
383
384 <div class="row reg-field-row" ng-show="show_field('au.day_phone')">
385   [% draw_field_label('au', 'day_phone') %]
386   [% draw_form_input('au', 'day_phone') %]
387   <div class="col-md-6 patron-reg-example">
388     <button ng-show="patron.day_phone && !patron.isnew" 
389         class="btn btn-default" 
390         ng-click="invalidate_field('day_phone')">[% l('Invalidate') %]</button>
391     [% draw_example_text('au', 'day_phone') %]
392     <!-- phones have a fall-through example strings -->
393     <span ng-if="!org_settings['ui.patron.edit.au.day_phone.example'] && org_settings['ui.patron.edit.phone.example']">
394       [% l('Example: [_1]', 
395         "{{org_settings['ui.patron.edit.phone.example']}}") %]
396     </span>
397   </div>
398 </div>
399
400 <!-- EVENING_PHONE -->
401
402 <div class="row reg-field-row" ng-show="show_field('au.evening_phone')">
403   [% draw_field_label('au', 'evening_phone') %]
404   [% draw_form_input('au', 'evening_phone') %]
405   <div class="col-md-6 patron-reg-example">
406     <button ng-show="patron.evening_phone && !patron.isnew" 
407         class="btn btn-default" 
408         ng-click="invalidate_field('evening_phone')">[% l('Invalidate') %]</button>
409     [% draw_example_text('au', 'evening_phone') %]
410     <!-- phones have a fall-through example strings -->
411     <span ng-if="!org_settings['ui.patron.edit.au.evening_phone.example'] && org_settings['ui.patron.edit.phone.example']">
412       [% l('Example: [_1]', 
413         "{{org_settings['ui.patron.edit.phone.example']}}") %]
414     </span>
415   </div>
416 </div>
417
418 <!-- OTHER_PHONE -->
419
420 <div class="row reg-field-row" ng-show="show_field('au.other_phone')">
421   [% draw_field_label('au', 'other_phone') %]
422   [% draw_form_input('au', 'other_phone') %]
423   <div class="col-md-6 patron-reg-example">
424     <button ng-show="patron.other_phone && !patron.isnew" 
425         class="btn btn-default" 
426         ng-click="invalidate_field('other_phone')">[% l('Invalidate') %]</button>
427     [% draw_example_text('au', 'other_phone') %]
428     <!-- phones have a fall-through example strings -->
429     <span ng-if="!org_settings['ui.patron.edit.au.other_phone.example'] && org_settings['ui.patron.edit.phone.example']">
430       [% l('Example: [_1]', 
431         "{{org_settings['ui.patron.edit.phone.example']}}") %]
432     </span>
433   </div>
434 </div>
435
436 <!-- home org unit selector -->
437
438 <div class="row reg-field-row" ng-show="show_field('au.home_ou')">
439   [% draw_field_label('au', 'home_ou') %]
440   <div class="col-md-3 reg-field-input">
441     <eg-org-selector 
442       selected="patron.home_ou" 
443       onchange="handle_home_org_changed"
444       disable-test="disable_home_org">
445     </eg-org-selector>
446   </div>
447 </div>
448
449 <!-- profile selector -->
450
451 <div class="row reg-field-row" ng-show="show_field('au.profile')">
452   [% draw_field_label('au', 'profile') %]
453   <div class="col-md-3 reg-field-input">
454     <div class="btn-group" uib-dropdown>
455       <button type="button" class="btn btn-default" uib-dropdown-toggle
456           ng-class="{'ng-invalid' : invalid_profile()}">
457         <span style="padding-right: 5px;">
458           {{patron.profile.name() || "[% l('Profile Group') %]"}}
459         </span>
460         <span class="caret"></span>
461       </button>
462       <ul class="scrollable-menu" uib-dropdown-menu>
463         <li ng-repeat="grp in edit_profiles" 
464           ng-class="{disabled : grp.usergroup() == 'f'}">
465           <a href 
466             style="padding-left: {{pgt_depth(grp) * 10 + 5}}px"
467             ng-click="set_profile(grp)">{{grp.name()}}</a>
468         </li>
469       </ul>
470     </div>
471   </div>
472   <div class="col-md-3">
473     <button class="btn btn-default" ng-if="!offline" ng-disabled="!perms.CREATE_USER_GROUP_LINK"
474       ng-click="secondary_groups_dialog()">[% l('Secondary Groups') %]</button>
475   </div> 
476 </div>
477
478 <div class="row reg-field-row" ng-show="show_field('au.expire_date')">
479   [% draw_field_label('au', 'expire_date') %]
480   <div class="col-md-3 reg-field-input">
481     <eg-date-input 
482       ng-model="patron.expire_date">
483     </eg-date-input>
484   </div>
485   <div class="col-md-3">
486     <button class="btn btn-default" ng-click="set_expire_date()">
487       [% l('Update Expire Date') %]</button>
488   </div>
489 </div>
490
491 <!-- net_access_level -->
492
493 <div class="row reg-field-row" ng-show="show_field('au.net_access_level')">
494   [% draw_field_label('au', 'net_access_level') %]
495   <div class="col-md-3 reg-field-input">
496     <select 
497       class="form-control" 
498       ng-model="patron.net_access_level"
499       ng-required="field_required('au', 'net_access_level')"
500       ng-blur="handle_field_changed(patron, 'net_access_level')"
501       ng-options="level.name() for level in net_access_levels track by level.id()">
502     </select>
503   </div>
504 </div>
505
506 <!-- ACTIVE -->
507
508 <div class="row reg-field-row" ng-show="show_field('au.active')">
509   [% draw_field_label('au', 'active') %]
510   <div class="col-md-3 reg-field-input">
511     <div class='checkbox'>
512       <input 
513         ng-change="field_modified()" 
514         ng-blur="handle_field_changed(patron, 'active')"
515         type='checkbox' ng-model="patron.active"/>
516     </div>
517   </div>
518 </div>
519
520 <!-- BARRED -->
521
522 <div class="row reg-field-row" ng-show="show_field('au.barred')">
523   [% draw_field_label('au', 'barred') %]
524   <div class="col-md-3 reg-field-input">
525     <div class='checkbox'>
526       <input 
527         ng-change="field_modified()" 
528         ng-blur="handle_field_changed(patron, 'barred')"
529         type='checkbox' ng-model="patron.barred"/>
530     </div>
531   </div>
532 </div>
533
534 <!-- MASTER_ACCOUNT -->
535
536 <div class="row reg-field-row" ng-show="show_field('au.master_account')">
537   [% draw_field_label('au', 'master_account') %]
538   <div class="col-md-3 reg-field-input">
539     <div class='checkbox'>
540       <input 
541         ng-change="field_modified()" 
542         ng-blur="handle_field_changed(patron, 'master_account')"
543         type='checkbox' ng-model="patron.master_account"/>
544     </div>
545   </div>
546 </div>
547
548 <!-- CLAIMS_RETURNED_COUNT -->
549
550 <div class="row reg-field-row" ng-show="show_field('au.claims_returned_count')">
551   [% draw_field_label('au', 'claims_returned_count') %]
552   [% draw_form_input('au', 'claims_returned_count', 
553     '', 'number', '!perms.UPDATE_PATRON_CLAIM_RETURN_COUNT') %]
554   <div class="col-md-6 patron-reg-example">
555     [% draw_example_text('au', 'claims_returned_count') %]
556   </div>
557 </div>
558
559 <!-- CLAIMS_NEVER_CHECKED_OUT_COUNT -->
560
561 <div class="row reg-field-row" ng-show="show_field('au.claims_never_checked_out_count')">
562   [% draw_field_label('au', 'claims_never_checked_out_count') %]
563   [% draw_form_input('au', 'claims_never_checked_out_count',
564     '', 'number', '!perms.UPDATE_PATRON_CLAIM_NEVER_CHECKED_OUT_COUNT') %]
565   <div class="col-md-6 patron-reg-example">
566     [% draw_example_text('au', 'claims_never_checked_out_count') %]
567   </div>
568 </div>
569
570 <!-- ALERT_MESSAGE -->
571
572 <div class="row reg-field-row" ng-show="show_field('au.alert_message')">
573   [% draw_field_label('au', 'alert_message') %]
574   <div class="col-md-3 reg-field-input">
575     <textarea 
576       class="form-control" 
577       ng-model="patron.alert_message"
578       ng-pattern="field_pattern('au', 'alert_message')"
579       ng-change="field_modified()" 
580       ng-blur="handle_field_changed(patron, 'alert_message')">
581     </textarea>
582   </div>
583   <div class="col-md-6 patron-reg-example">
584     [% draw_example_text('au', 'alert_message') %]
585   </div>
586 </div>
587
588 <div ng-if="!offline">
589
590 <div class="alert alert-success row" role="alert">
591   <div class="col-md-6">[% l('User Settings') %]</div>
592 </div>
593
594 <div class="row reg-field-row">
595   <div class="col-md-3 reg-field-label">
596     <label>{{user_setting_types['opac.default_phone'].label()}}</label>
597   </div>
598   <div class="col-md-3 reg-field-input">
599     <input 
600       ng-change="field_modified()" 
601       type='text' ng-model="user_settings['opac.default_phone']"/>
602   </div>
603 </div>
604
605 <div class="row reg-field-row">
606   <div class="col-md-3 reg-field-label">
607     <label>{{user_setting_types['opac.default_pickup_location'].label()}}</label>
608   </div>
609   <div class="col-md-3 reg-field-input">
610     <eg-org-selector nodefault
611       disable-test="disable_pulib" 
612       selected="patron._pickup_lib"
613       onchange="handle_pulib_changed">
614     </eg-org-selector>
615   </div>
616 </div>
617
618 <div class="row reg-field-row" 
619     ng-if="org_settings['circ.holds.behind_desk_pickup_supported']">
620   <div class="col-md-3 reg-field-label">
621     <label>{{user_setting_types['circ.holds_behind_desk'].label()}}</label>
622   </div>
623   <div class="col-md-3 reg-field-input">
624     <div class='checkbox'>
625       <input 
626         ng-change="field_modified()" 
627         type='checkbox' ng-model="user_settings['circ.holds_behind_desk']"/>
628     </div>
629   </div>
630 </div>
631
632 <!-- TODO: Add circ.collections.exempt to master SQL seed data -->
633 <div class="row reg-field-row" 
634   ng-if="user_setting_types['circ.collections.exempt']">
635   <div class="col-md-3 reg-field-label">
636     <label>{{user_setting_types['circ.collections.exempt'].label()}}</label>
637   </div>
638   <div class="col-md-3 reg-field-input">
639     <div class='checkbox'>
640       <input 
641         type='checkbox' 
642         ng-change="field_modified()" 
643         ng-disabled="!perms.UPDATE_PATRON_COLLECTIONS_EXEMPT"
644         ng-model="user_settings['circ.collections.exempt']"/>
645     </div>
646   </div>
647 </div>
648
649 <div class="row reg-field-row">
650   <div class="col-md-3 reg-field-label">
651     <label>[% l('Holds Notices') %]</label>
652   </div>
653   <div class="col-md-3 reg-field-input flex-row">
654     <div class='flex-cell'>
655       <input 
656         ng-change="field_modified()" 
657         type='checkbox' ng-model="hold_notify_type.phone"/>
658       [% l('Phone') %]
659     </div>
660     <div class='flex-cell'>
661       <input 
662         ng-change="field_modified()" 
663         type='checkbox' ng-model="hold_notify_type.email"/>
664       [% l('Email') %]
665     </div>
666     <div class='flex-cell' ng-if="org_settings['sms.enable']">
667       <input 
668         ng-change="field_modified()" 
669         type='checkbox' ng-model="hold_notify_type.sms"/>
670       [% l('SMS') %]
671     </div>
672   </div>
673 </div>
674
675 <div class="row reg-field-row" ng-if="org_settings['sms.enable']">
676   <div class="col-md-3 reg-field-label">
677     <label>[% l('Default SMS/Text Number') %]</label>
678   </div>
679   <div class="col-md-3 reg-field-input">
680     <input 
681       ng-change="field_modified()" ng-model="user_settings['opac.default_sms_notify']"
682       type='text'/>
683   </div>
684 </div>
685
686 <div class="row reg-field-row" ng-if="org_settings['sms.enable']">
687   <div class="col-md-3 reg-field-label">
688     <label>[% l('Default SMS Carrier') %]</label>
689   </div>
690   <div class="col-md-3 reg-field-input">
691     <span class="nullable">
692       <select class="form-control" ng-model="user_settings['opac.default_sms_carrier']" ng-options="c.id() as c.name() for c in sms_carriers">
693         <option value="">Select a Carrier</option>
694       </select>
695     </span>
696   </div>
697 </div>
698
699 <div class="row reg-field-row" ng-repeat="type in opt_in_setting_types">
700   <div class="col-md-3 reg-field-label" ng-if="type.name() != 'circ.send_email_checkout_receipts'">
701     <label>{{type.label()}}</label>
702   </div>
703   <div class="col-md-3 reg-field-input" ng-if="type.name() != 'circ.send_email_checkout_receipts'">
704     <input 
705       ng-change="field_modified()" 
706       type='checkbox' ng-model="user_settings[type.name()]"/>
707   </div>
708 </div>
709
710 </div> <!-- end offline test -->
711
712 <!-- addresses -->
713
714 <div ng-repeat="addr in patron.addresses">
715   <div class="alert alert-success row" role="alert">
716       <div class="col-md-3">
717         [% l('Address') %]
718         <div ng-show="addr._linked_owner">
719           (<a target="_blank"
720             href="/eg/staff/circ/patron/{{addr._linked_owner_id}}/edit">
721             [% l('Owned by [_1]', '{{addr._linked_owner}}') %]
722           </a>)
723         </div>
724       </div>
725       <div class="col-md-3">
726           <span class='pad-all-min'>
727             [% l('Mailing') %] <input type='checkbox' 
728               ng-change="field_modified();set_addr_type(addr, 'mailing')" 
729               ng-model="addr._is_mailing"/>
730           </span>
731           <span class='pad-all-min'>
732             [% l('Physical') %] <input type='checkbox' 
733               ng-change="field_modified();set_addr_type(addr, 'billing')" 
734               ng-model="addr._is_billing"/>
735           </span>
736           <span class='pad-all-min'>
737             <button type="button" 
738               ng-click="field_modified();delete_address(addr.id)" 
739               class="btn btn-danger">[% l('X') %]</button>
740           </span>
741       </div>
742   </div>
743
744   <!-- ADDRESS_TYPE -->
745   <div class="row reg-field-row" ng-show="show_field('aua.address_type')">
746     [% draw_field_label('aua', 'address_type') %]
747     [% draw_form_input('aua', 
748       'address_type', 'addresses[$index]', '', 'addr._linked_owner') %]
749     <div class="col-md-6 patron-reg-example">
750       [% draw_example_text('aua', 'address_type') %]
751     </div>
752   </div>
753
754   <!-- POST_CODE -->
755
756   <div class="row reg-field-row" ng-show="show_field('aua.post_code')">
757     [% draw_field_label('aua', 'post_code') %]
758     [% draw_form_input('aua', 
759       'post_code', 'addresses[$index]', '', 'addr._linked_owner') %]
760     <div class="col-md-6 patron-reg-example">
761       [% draw_example_text('aua', 'post_code') %]
762     </div>
763   </div>
764
765   <!-- STREET1 -->
766
767   <div class="row reg-field-row" ng-show="show_field('aua.street1')">
768     [% draw_field_label('aua', 'street1') %]
769     [% draw_form_input('aua', 
770       'street1', 'addresses[$index]', '', 'addr._linked_owner') %]
771     <div class="col-md-6 patron-reg-example">
772       [% draw_example_text('aua', 'street1') %]
773     </div>
774   </div>
775
776   <!-- STREET2 -->
777
778   <div class="row reg-field-row" ng-show="show_field('aua.street2')">
779     [% draw_field_label('aua', 'street2') %]
780     [% draw_form_input('aua', 
781       'street2', 'addresses[$index]', '', 'addr._linked_owner') %]
782     <div class="col-md-6 patron-reg-example">
783       [% draw_example_text('aua', 'street2') %]
784     </div>
785   </div>
786
787   <!-- CITY -->
788
789   <div class="row reg-field-row" ng-show="show_field('aua.city')">
790     [% draw_field_label('aua', 'city') %]
791     [% draw_form_input('aua', 
792       'city', 'addresses[$index]', '', 'addr._linked_owner') %]
793     <div class="col-md-6 patron-reg-example">
794       [% draw_example_text('aua', 'city') %]
795     </div>
796   </div>
797
798   <!-- COUNTY -->
799
800   <div class="row reg-field-row" ng-show="show_field('aua.county')">
801     [% draw_field_label('aua', 'county') %]
802     [% draw_form_input('aua', 
803       'county', 'addresses[$index]', '', 'addr._linked_owner') %]
804     <div class="col-md-6 patron-reg-example">
805       [% draw_example_text('aua', 'county') %]
806     </div>
807   </div>
808
809   <!-- STATE -->
810
811   <div class="row reg-field-row" ng-show="show_field('aua.state')">
812     [% draw_field_label('aua', 'state') %]
813     [% draw_form_input('aua', 
814       'state', 'addresses[$index]', '', 'addr._linked_owner') %]
815     <div class="col-md-6 patron-reg-example">
816       [% draw_example_text('aua', 'state') %]
817     </div>
818   </div>
819
820   <!-- COUNTRY -->
821
822   <div class="row reg-field-row" ng-show="show_field('aua.country')">
823     [% draw_field_label('aua', 'country') %]
824     [% draw_form_input('aua', 
825       'country', 'addresses[$index]', '', 'addr._linked_owner') %]
826     <div class="col-md-6 patron-reg-example">
827       [% draw_example_text('aua', 'country') %]
828     </div>
829   </div>
830
831   <!-- VALID -->
832
833   <div class="row reg-field-row" ng-show="show_field('aua.valid')">
834     [% draw_field_label('aua', 'valid') %]
835     <div class="col-md-3 reg-field-input">
836       <div class='checkbox'>
837         <input 
838           type='checkbox' 
839           ng-change="field_modified()" 
840           ng-disabled='addr._linked_owner'
841           ng-blur="handle_field_changed(patron.addresses[$index], 'valid')"
842           ng-model="patron.addresses[$index].valid"/>
843       </div>
844     </div>
845     <div class="col-md-6 patron-reg-example">
846       [% draw_example_text('aua', 'valid') %]
847     </div>
848   </div>
849
850   <!-- WITHIN_CITY_LIMITS -->
851
852   <div class="row reg-field-row" ng-show="show_field('aua.within_city_limits')">
853     [% draw_field_label('aua', 'within_city_limits') %]
854     <div class="col-md-3 reg-field-input">
855       <div class='checkbox'>
856         <input 
857           type='checkbox' 
858           ng-change="field_modified()" 
859           ng-disabled='addr._linked_owner'
860           ng-blur="handle_field_changed(patron.addresses[$index], 'within_city_limits')"
861           ng-model="patron.addresses[$index].within_city_limits"/>
862       </div>
863     </div>
864     <div class="col-md-6 patron-reg-example">
865       [% draw_example_text('aua', 'within_city_limits') %]
866     </div>
867   </div>
868
869   <!-- pending address -->
870
871 </div> <!-- addresses -->
872
873 <div class="row">
874   <button type="button" ng-click="new_address()" 
875     class="btn btn-success">[% l('New Address') %]</button>
876 </div>
877
878 <div ng-if="!offline">
879 <div class="alert alert-success row" role="alert"
880     ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-if="stat_cats.length > 0">
881     <div class="col-md-6">[% l('Statistical Categories') %]</div>
882 </div>
883
884 <div class="row reg-field-row"
885      ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-repeat="cat in stat_cats">
886      <!-- Display this stat cat when displaying all stat cats
887        or when this stat cat is required.  Wrap the body of
888        stat cat display in a div for easy show/hide.  -->
889   <div ng-if="show_field('stat_cats') || cat.required() == 1">
890
891     <div class="col-md-3 reg-field-label">
892       <label>{{cat.name()}}</label>
893     </div>
894     <div class="col-md-3 reg-field-input">
895       <div ng-if="cat.entries().length != 0">
896         <div class="btn-group" uib-dropdown>
897           <button type="button" class="btn btn-default" ng-class="{'ng-invalid': cat.required() == 1 && !stat_cat_entry_maps[cat.id()] }" uib-dropdown-toggle>
898             <span style="padding-right: 5px;">
899               {{stat_cat_entry_maps[cat.id()]}}</span>
900             <span class="caret"></span>
901           </button>
902           <ul uib-dropdown-menu>
903             <li ng-repeat="entry in cat.entries()">
904               <a href
905                 ng-click="field_modified();stat_cat_entry_maps[cat.id()]=entry.value()">
906                 {{entry.value()}}
907               </a>
908             </li>
909           </ul>
910         </div>
911       </div>
912     </div>
913
914     <!-- Stat cat retrieval API uses open-ils.storage under the covers
915         which represents DB bools at 1/0 instead of cstore-style t/f -->
916     <div class="col-md-3 reg-field-input"
917       ng-show="show_field('stat_cats') || hasRequiredStatCat"
918       ng-if="cat.allow_freetext() == '1'">
919       <input type="text" ng-model="stat_cat_entry_maps[cat.id()]"
920         class="form-control" ng-required="cat.required() == 1"/>
921     </div>
922
923   </div><!-- show/hide wrapper -->
924 </div>
925 </div>
926
927 <!-- surveys -->
928
929 <div class="alert alert-success row" role="alert" 
930     ng-show="show_field('surveys')" ng-if="surveys.length > 0">
931     <div class="col-md-6">[% l('Surveys') %]</div>
932 </div>
933
934 <div class="row reg-field-row" 
935     ng-show="show_field('surveys')" ng-repeat="survey in surveys">
936   <div class="col-md-3 reg-field-label">
937     <label>{{survey.name()}}</label>
938   </div>
939   <div class="col-md-6 reg-field-input">
940     <div class="row" ng-repeat="question in survey.questions()" 
941       style="margin-bottom: 10px;">
942       <div class="col-md-6">{{question.question()}}</div>
943       <div class="col-md-6">
944         <div class="btn-group" uib-dropdown>
945           <button type="button" class="btn btn-default" uib-dropdown-toggle>
946             <span style="padding-right: 5px;">
947               {{survey_responses[question.id()].answer()}}
948             </span>
949             <span class="caret"></span>
950           </button>
951           <ul uib-dropdown-menu>
952             <li ng-repeat="answer in question.answers()">
953               <a href 
954                 ng-click="field_modified();survey_responses[question.id()] = answer"> 
955                 {{answer.answer()}} 
956               </a>
957             </li>
958           </ul>
959         </div>
960       </div>
961     </div>
962   </div>
963 </div>
964
965 </div><!-- /form wrapper -->