]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
LP#1570072: update hold notification methods upon preference changes
[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       [% IF type == "email" %]type="text" ng-required="hold_notify_type.email"
117       [% ELSE %]type="[% type %]"
118       [% END %]
119       class="form-control" 
120       name="[% model %]"
121       ng-change="field_modified()" 
122       ng-required="field_required('[% cls %]', '[% field %]')"
123       ng-blur="handle_field_changed([% base_obj %], '[% field %]')"
124       ng-pattern="field_pattern('[% cls %]', '[% field %]')"
125       [% IF disable %]ng-disabled="[% disable %]"[% END %]
126       ng-model="[% model %]"/>
127   </div>
128 [% END %]
129
130 [% MACRO draw_example_text(cls, field) BLOCK;
131   set_str = "org_settings['ui.patron.edit." _ cls _ "." _ field _ ".example']";
132 %]
133   <span ng-if="[% set_str %]">
134     [% l('Example: [_1]', '{{' _ set_str _ '}}') %]
135   </span>
136 [% END %]
137
138 <!-- progress dialog displayed as we await all data to finish loading -->
139 <div class="row" ng-show="!page_data_loaded">
140   <div class="col-md-6 pad-vert">
141     <div class="progress progress-striped active">
142         <div class="progress-bar"  role="progressbar" aria-valuenow="100" 
143               aria-valuemin="0" aria-valuemax="100" style="width: 100%">
144             <span class="sr-only">[% l('Loading...') %]</span>
145         </div>
146     </div>
147   </div>
148 </div>
149
150 <!--  
151 MAIN FORM
152 This div wraps the entire form so we can hide it until all needed data
153 has been loaded.  Setting ng-form and a name lets us refer to fields
154 within the "form" by name for validation.
155 -->
156 <div ng-form id="patron-reg-container" 
157   name="reg_form" ng-show="page_data_loaded">
158
159 <!-- BARCODE -->
160
161 <div class="row reg-field-row" ng-show="show_field('ac.barcode')">
162   [% draw_field_label('ac', 'barcode') %]
163   <div class="col-md-3 reg-field-input"> <!-- field form input -->
164       <input type="text" 
165         name="barcode"
166         ng-model="patron.card.barcode"
167         ng-pattern="field_pattern('ac', 'barcode')"
168         ng-required="field_required('ac', 'barcode')"
169         focus-me="focus_bc"
170         ng-change="field_modified()" 
171         ng-disabled="disable_bc"
172         class="form-control" 
173         ng-blur="handle_field_changed(patron.card, 'barcode')"/>
174   </div>
175   <div class="col-md-6 patron-reg-example">
176       <button class="btn btn-default" ng-show="!patron.isnew"
177         ng-click="replace_card()">[% l('Replace Barcode') %]</button>
178       <button class="btn btn-default" ng-if="!patron.isnew" 
179         ng-click="cards_dialog()">[% l('See All') %]</button>
180       <div ng-show="dupe_barcode" class="patron-reg-validation-alert">
181         <span>[% l('Barcode is already in use') %]</span>
182       </div>
183   </div>
184 </div>
185
186 <!-- USRNAME -->
187
188 <div class="row reg-field-row" ng-show="show_field('au.usrname')">
189   [% draw_field_label('au', 'usrname') %]
190   <div class="col-md-3 reg-field-input">
191     <input type="text" 
192       name='usrname'
193       ng-required="field_required('au', 'usrname')"
194       focus-me="focus_usrname"
195       ng-change="field_modified()" 
196       ng-pattern="field_pattern('au', 'usrname')"
197       ng-blur="handle_field_changed(patron, 'usrname')"
198       class="form-control" 
199       ng-model="patron.usrname"/>
200   </div>
201   <div class="col-md-6 patron-reg-example">
202     <div ng-show="dupe_username" class="patron-reg-validation-alert">
203       <span>[% l('Username is already in use') %]</span>
204     </div>
205   </div>
206 </div>
207
208 <!-- PASSWD -->
209
210 <div class="row reg-field-row" ng-show="show_field('au.passwd')">
211   [% draw_field_label('au', 'passwd') %]
212   [% draw_form_input('au', 'passwd'); %]
213   <div class="col-md-6 patron-reg-example">
214     <button class="btn btn-default" ng-click="generate_password()">
215       [% l('Generate Password') %]</button>
216   </div>
217 </div>
218
219 <div class="row reg-field-row">
220   <div class="col-md-6">
221     <ul class="nav nav-pills nav-pills-like-tabs">
222       <li ng-class="{active : name_tab == 'primary'}">
223         <a ng-click="name_tab='primary'">[% l('Primary Name') %]</a>
224       </li>
225       <li ng-class="{active : name_tab == 'preferred'}">
226         <a ng-click="name_tab='preferred'">[% l('Preferred Name') %]</a>
227       </li>
228     </ul>
229   </div>
230 </div>
231
232 <div ng-show="name_tab == 'primary'">
233
234   <!-- PREFIX -->
235
236   <div class="row reg-field-row" ng-show="show_field('au.prefix')">
237     [% draw_field_label('au', 'prefix') %]
238     [% draw_form_input('au', 'prefix'); %]
239     <div class="col-md-6 patron-reg-example">
240       [% draw_example_text('au', 'prefix') %]
241     </div>
242   </div>
243
244   <!-- FIRST_GIVEN_NAME -->
245
246   <div class="row reg-field-row" ng-show="show_field('au.first_given_name')">
247     [% draw_field_label('au', 'first_given_name') %]
248     [% draw_form_input('au', 'first_given_name'); %]
249     <div class="col-md-6 patron-reg-example">
250       [% draw_example_text('au', 'first_given_name') %]
251     </div>
252   </div>
253
254   <!-- SECOND_GIVEN_NAME -->
255
256   <div class="row reg-field-row" ng-show="show_field('au.second_given_name')">
257     [% draw_field_label('au', 'second_given_name') %]
258     [% draw_form_input('au', 'second_given_name'); %]
259     <div class="col-md-6 patron-reg-example">
260       [% draw_example_text('au', 'second_given_name') %]
261     </div>
262   </div>
263
264   <!-- FAMILY_NAME -->
265
266   <div class="row reg-field-row" ng-show="show_field('au.family_name')">
267     [% draw_field_label('au', 'family_name') %]
268     [% draw_form_input('au', 'family_name'); %]
269     <div class="col-md-6 patron-reg-example">
270       [% draw_example_text('au', 'family_name') %]
271     </div>
272   </div>
273
274   <!-- SUFFIX -->
275
276   <div class="row reg-field-row" ng-show="show_field('au.suffix')">
277     [% draw_field_label('au', 'suffix') %]
278     [% draw_form_input('au', 'suffix'); %]
279     <div class="col-md-6 patron-reg-example">
280       [% draw_example_text('au', 'suffix') %]
281     </div>
282   </div>
283 </div> <!-- ng-show == primary -->
284
285 <div ng-show="name_tab == 'preferred'" class="patron-reg-pref-names">
286
287   <!-- PREFIX -->
288
289   <div class="row reg-field-row" ng-show="show_field('au.pref_prefix')">
290     [% draw_field_label('au', 'pref_prefix') %]
291     [% draw_form_input('au', 'pref_prefix'); %]
292     <div class="col-md-6 patron-reg-example">
293       [% draw_example_text('au', 'pref_prefix') %]
294     </div>
295   </div>
296
297   <!-- FIRST_GIVEN_NAME -->
298
299   <div class="row reg-field-row" ng-show="show_field('au.pref_first_given_name')">
300     [% draw_field_label('au', 'pref_first_given_name') %]
301     [% draw_form_input('au', 'pref_first_given_name'); %]
302     <div class="col-md-6 patron-reg-example">
303       [% draw_example_text('au', 'pref_first_given_name') %]
304     </div>
305   </div>
306
307   <!-- SECOND_GIVEN_NAME -->
308
309   <div class="row reg-field-row" ng-show="show_field('au.pref_second_given_name')">
310     [% draw_field_label('au', 'pref_second_given_name') %]
311     [% draw_form_input('au', 'pref_second_given_name'); %]
312     <div class="col-md-6 patron-reg-example">
313       [% draw_example_text('au', 'pref_second_given_name') %]
314     </div>
315   </div>
316
317   <!-- FAMILY_NAME -->
318
319   <div class="row reg-field-row" ng-show="show_field('au.pref_family_name')">
320     [% draw_field_label('au', 'pref_family_name') %]
321     [% draw_form_input('au', 'pref_family_name'); %]
322     <div class="col-md-6 patron-reg-example">
323       [% draw_example_text('au', 'pref_family_name') %]
324     </div>
325   </div>
326
327   <!-- SUFFIX -->
328
329   <div class="row reg-field-row" ng-show="show_field('au.pref_suffix')">
330     [% draw_field_label('au', 'pref_suffix') %]
331     [% draw_form_input('au', 'pref_suffix'); %]
332     <div class="col-md-6 patron-reg-example">
333       [% draw_example_text('au', 'pref_suffix') %]
334     </div>
335   </div>
336 </div> <!-- ng-show == preferred -->
337
338 <!-- indicate bottom of name tabs -->
339 <div class="row reg-field-row">
340   <div class="col-md-6"><hr class="patron-reg-names-separator"/></div>
341 </div>
342
343 <div class="row reg-field-row" ng-show="show_field('au.name_keywords')">
344   [% draw_field_label('au', 'name_keywords') %]
345   <div class="col-md-3 reg-field-input">
346     <textarea 
347       class="form-control" 
348       ng-model="patron.name_keywords"
349       ng-pattern="field_pattern('au', 'name_keywords')"
350       ng-change="field_modified()" 
351       ng-blur="handle_field_changed(patron, 'name_keywords')">
352     </textarea>
353   </div>
354   <div class="col-md-6 patron-reg-example">
355     [% draw_example_text('au', 'name_keywords') %]
356   </div>
357 </div>
358
359 <!-- ALIAS -->
360
361 <div class="row reg-field-row" ng-show="show_field('au.alias')">
362   [% draw_field_label('au', 'alias') %]
363   [% draw_form_input('au', 'alias'); %]
364   <div class="col-md-6 patron-reg-example">
365     [% draw_example_text('au', 'alias') %]
366   </div>
367 </div>
368
369 <!-- DOB -->
370
371 <div class="row reg-field-row" ng-show="show_field('au.dob')">
372   [% draw_field_label('au', 'dob') %]
373   <div class="col-md-3 reg-field-input">
374     <eg-date-input
375       ng-required="field_required('au', 'dob')" 
376       ng-model="patron.dob">
377     </eg-date-input>
378   </div>
379   <div class="col-md-6 patron-reg-example">
380     [% draw_example_text('au', 'dob') %]
381   </div>
382 </div>
383
384 <!-- JUVENILE -->
385
386 <div class="row reg-field-row" ng-show="show_field('au.juvenile')">
387   [% draw_field_label('au', 'juvenile') %]
388   <div class="col-md-3 reg-field-input">
389       <input 
390         ng-change="field_modified()" 
391         ng-blur="handle_field_changed(patron, 'juvenile')"
392         type='checkbox' ng-model="patron.juvenile"/>
393   </div>
394 </div>
395
396 <!-- GUARDIAN -->
397
398 <div class="row reg-field-row" ng-show="show_field('au.guardian')">
399   [% draw_field_label('au', 'guardian') %]
400   [% draw_form_input('au', 'guardian'); %]
401   <div class="col-md-6 patron-reg-example">
402     [% draw_example_text('au', 'guardian') %]
403   </div>
404 </div>
405
406 <!-- ident_type -->
407
408 <div class="row reg-field-row" ng-show="show_field('au.ident_type')">
409   [% draw_field_label('au', 'ident_type') %]
410   <div class="col-md-3 reg-field-input">
411     <select 
412       class="form-control" 
413       ng-model="patron.ident_type"
414       ng-required="field_required('au', 'ident_type')"
415       ng-blur="handle_field_changed(patron, 'ident_type')"
416       ng-options="type.name() for type in ident_types track by type.id()">
417     </select>
418   </div>
419 </div>
420
421 <!-- IDENT_VALUE -->
422
423 <div class="row reg-field-row" ng-show="show_field('au.ident_value')">
424   [% draw_field_label('au', 'ident_value') %]
425   [% draw_form_input('au', 'ident_value') %]
426   <div class="col-md-6 patron-reg-example">
427     [% draw_example_text('au', 'ident_value') %]
428   </div>
429 </div>
430
431 <!-- ident_type2 -->
432
433 <div class="row reg-field-row" ng-show="show_field('au.ident_type2')">
434   [% draw_field_label('au', 'ident_type2') %]
435   <div class="col-md-3 reg-field-input">
436     <select 
437       class="form-control" 
438       ng-model="patron.ident_type2"
439       ng-required="field_required('au', 'ident_type2')"
440       ng-blur="handle_field_changed(patron, 'ident_type2')"
441       ng-options="type.name() for type in ident_types track by type.id()">
442     </select>
443   </div>
444 </div>
445
446 <!-- IDENT_VALUE2 -->
447 <div class="row reg-field-row" ng-show="show_field('au.ident_value2')">
448   [% draw_field_label('au', 'ident_value2') %]
449   [% draw_form_input('au', 'ident_value2') %]
450   <div class="col-md-6 patron-reg-example">
451     [% draw_example_text('au', 'ident_value2') %]
452   </div>
453 </div>
454
455
456 <!-- EMAIL -->
457 <div class="row reg-field-row" ng-show="show_field('au.email')">
458   [% draw_field_label('au', 'email') %]
459   [% draw_form_input('au', 'email', '', 'email') %]
460   <div class="col-md-6 patron-reg-example">
461     <button ng-show="patron.email && !patron.isnew" 
462       class="btn btn-default" 
463       ng-click="invalidate_field('email')">[% l('Invalidate') %]</button>
464     <span ng-if="org_settings['ui.patron.edit.au.email.example']">
465       [% l('Example: [_1]',
466         "{{org_settings['ui.patron.edit.au.email.example']}}") %]
467     </span>
468   </div>
469 </div>
470
471 <div class="row reg-field-row" ng-show="show_field('au.email') && opt_in_setting_types['circ.send_email_checkout_receipts']">
472   <div class="col-md-3 reg-field-label">
473     <label>{{opt_in_setting_types['circ.send_email_checkout_receipts'].label()}}</label>
474   </div>
475   <div class="col-md-3 reg-field-input">
476     <input
477       ng-change="field_modified()"
478       type='checkbox' ng-model="user_settings['circ.send_email_checkout_receipts']"/>
479   </div>
480 </div>
481
482 <!-- DAY_PHONE -->
483
484 <div class="row reg-field-row" ng-show="show_field('au.day_phone')">
485   [% draw_field_label('au', 'day_phone') %]
486   [% draw_form_input('au', 'day_phone') %]
487   <div class="col-md-6 patron-reg-example">
488     <button ng-show="patron.day_phone && !patron.isnew" 
489         class="btn btn-default" 
490         ng-click="invalidate_field('day_phone')">[% l('Invalidate') %]</button>
491     [% draw_example_text('au', 'day_phone') %]
492     <!-- phones have a fall-through example strings -->
493     <span ng-if="!org_settings['ui.patron.edit.au.day_phone.example'] && org_settings['ui.patron.edit.phone.example']">
494       [% l('Example: [_1]', 
495         "{{org_settings['ui.patron.edit.phone.example']}}") %]
496     </span>
497   </div>
498 </div>
499
500 <!-- EVENING_PHONE -->
501
502 <div class="row reg-field-row" ng-show="show_field('au.evening_phone')">
503   [% draw_field_label('au', 'evening_phone') %]
504   [% draw_form_input('au', 'evening_phone') %]
505   <div class="col-md-6 patron-reg-example">
506     <button ng-show="patron.evening_phone && !patron.isnew" 
507         class="btn btn-default" 
508         ng-click="invalidate_field('evening_phone')">[% l('Invalidate') %]</button>
509     [% draw_example_text('au', 'evening_phone') %]
510     <!-- phones have a fall-through example strings -->
511     <span ng-if="!org_settings['ui.patron.edit.au.evening_phone.example'] && org_settings['ui.patron.edit.phone.example']">
512       [% l('Example: [_1]', 
513         "{{org_settings['ui.patron.edit.phone.example']}}") %]
514     </span>
515   </div>
516 </div>
517
518 <!-- OTHER_PHONE -->
519
520 <div class="row reg-field-row" ng-show="show_field('au.other_phone')">
521   [% draw_field_label('au', 'other_phone') %]
522   [% draw_form_input('au', 'other_phone') %]
523   <div class="col-md-6 patron-reg-example">
524     <button ng-show="patron.other_phone && !patron.isnew" 
525         class="btn btn-default" 
526         ng-click="invalidate_field('other_phone')">[% l('Invalidate') %]</button>
527     [% draw_example_text('au', 'other_phone') %]
528     <!-- phones have a fall-through example strings -->
529     <span ng-if="!org_settings['ui.patron.edit.au.other_phone.example'] && org_settings['ui.patron.edit.phone.example']">
530       [% l('Example: [_1]', 
531         "{{org_settings['ui.patron.edit.phone.example']}}") %]
532     </span>
533   </div>
534 </div>
535
536 <!-- home org unit selector -->
537
538 <div class="row reg-field-row" ng-show="show_field('au.home_ou')">
539   [% draw_field_label('au', 'home_ou') %]
540   <div class="col-md-3 reg-field-input">
541     <eg-org-selector 
542       selected="patron.home_ou" 
543       onchange="handle_home_org_changed"
544       disable-test="disable_home_org">
545     </eg-org-selector>
546   </div>
547 </div>
548
549 <!-- profile selector -->
550
551 <div class="row reg-field-row" ng-show="show_field('au.profile')">
552   [% draw_field_label('au', 'profile') %]
553   <div class="col-md-3 reg-field-input">
554     <div class="btn-group" uib-dropdown>
555       <button type="button" class="btn btn-default" uib-dropdown-toggle
556           ng-class="{'ng-invalid' : invalid_profile()}">
557         <span style="padding-right: 5px;">
558           {{patron.profile.name() || "[% l('Profile Group') %]"}}
559         </span>
560         <span class="caret"></span>
561       </button>
562       <ul class="scrollable-menu" uib-dropdown-menu>
563         <li ng-repeat="entry in edit_profile_entries" ng-if="edit_profile_entries.length"
564           ng-class="{disabled : entry.grp().usergroup() == 'f'}">
565           <a href 
566             style="padding-left: {{pgtde_depth(entry) * 10 + 5}}px"
567             ng-click="set_profile(entry.grp())">{{entry.grp().name()}}</a>
568         </li>
569         <li ng-repeat="grp in edit_profiles" ng-if="!edit_profile_entries.length"
570           ng-class="{disabled : grp.usergroup() == 'f'}">
571           <a href 
572             style="padding-left: {{pgt_depth(grp) * 10 + 5}}px"
573             ng-click="set_profile(grp)">{{grp.name()}}</a>
574         </li>
575       </ul>
576     </div>
577   </div>
578   <div class="col-md-3">
579     <button class="btn btn-default" ng-if="!offline" ng-disabled="!perms.CREATE_USER_GROUP_LINK"
580       ng-click="secondary_groups_dialog()">[% l('Secondary Groups') %]</button>
581   </div> 
582 </div>
583
584 <div class="row reg-field-row" ng-show="show_field('au.expire_date')">
585   [% draw_field_label('au', 'expire_date') %]
586   <div class="col-md-3 reg-field-input">
587     <eg-date-input 
588       ng-model="patron.expire_date">
589     </eg-date-input>
590   </div>
591   <div class="col-md-3">
592     <button class="btn btn-default" ng-click="set_expire_date()">
593       [% l('Update Expire Date') %]</button>
594   </div>
595 </div>
596
597 <!-- net_access_level -->
598
599 <div class="row reg-field-row" ng-show="show_field('au.net_access_level')">
600   [% draw_field_label('au', 'net_access_level') %]
601   <div class="col-md-3 reg-field-input">
602     <select 
603       class="form-control" 
604       ng-model="patron.net_access_level"
605       ng-required="field_required('au', 'net_access_level')"
606       ng-blur="handle_field_changed(patron, 'net_access_level')"
607       ng-options="level.name() for level in net_access_levels track by level.id()">
608     </select>
609   </div>
610 </div>
611
612 <!-- ACTIVE -->
613
614 <div class="row reg-field-row" ng-show="show_field('au.active')">
615   [% draw_field_label('au', 'active') %]
616   <div class="col-md-3 reg-field-input">
617       <input 
618         ng-change="field_modified()" 
619         ng-blur="handle_field_changed(patron, 'active')"
620         type='checkbox' ng-model="patron.active"/>
621   </div>
622 </div>
623
624 <!-- BARRED -->
625
626 <div class="row reg-field-row" ng-show="show_field('au.barred')">
627   [% draw_field_label('au', 'barred') %]
628   <div class="col-md-3 reg-field-input">
629       <input 
630         ng-change="field_modified()" 
631         ng-blur="handle_field_changed(patron, 'barred')"
632         type='checkbox' ng-model="patron.barred"/>
633   </div>
634 </div>
635
636 <!-- MASTER_ACCOUNT -->
637
638 <div class="row reg-field-row" ng-show="show_field('au.master_account')">
639   [% draw_field_label('au', 'master_account') %]
640   <div class="col-md-3 reg-field-input">
641       <input 
642         ng-change="field_modified()" 
643         ng-blur="handle_field_changed(patron, 'master_account')"
644         type='checkbox' ng-model="patron.master_account"/>
645   </div>
646 </div>
647
648 <!-- CLAIMS_RETURNED_COUNT -->
649
650 <div class="row reg-field-row" ng-show="show_field('au.claims_returned_count')">
651   [% draw_field_label('au', 'claims_returned_count') %]
652   [% draw_form_input('au', 'claims_returned_count', 
653     '', 'number', '!perms.UPDATE_PATRON_CLAIM_RETURN_COUNT') %]
654   <div class="col-md-6 patron-reg-example">
655     [% draw_example_text('au', 'claims_returned_count') %]
656   </div>
657 </div>
658
659 <!-- CLAIMS_NEVER_CHECKED_OUT_COUNT -->
660
661 <div class="row reg-field-row" ng-show="show_field('au.claims_never_checked_out_count')">
662   [% draw_field_label('au', 'claims_never_checked_out_count') %]
663   [% draw_form_input('au', 'claims_never_checked_out_count',
664     '', 'number', '!perms.UPDATE_PATRON_CLAIM_NEVER_CHECKED_OUT_COUNT') %]
665   <div class="col-md-6 patron-reg-example">
666     [% draw_example_text('au', 'claims_never_checked_out_count') %]
667   </div>
668 </div>
669
670 <!-- ALERT_MESSAGE -->
671
672 <div class="row reg-field-row" ng-show="show_field('au.alert_message')">
673   [% draw_field_label('au', 'alert_message') %]
674   <div class="col-md-3 reg-field-input">
675     <textarea 
676       class="form-control" 
677       ng-model="patron.alert_message"
678       ng-pattern="field_pattern('au', 'alert_message')"
679       ng-change="field_modified()" 
680       ng-blur="handle_field_changed(patron, 'alert_message')">
681     </textarea>
682   </div>
683   <div class="col-md-6 patron-reg-example">
684     [% draw_example_text('au', 'alert_message') %]
685   </div>
686 </div>
687
688 <div ng-if="!offline">
689
690 <div class="alert alert-success row" role="alert">
691   <div class="col-md-6">[% l('User Settings') %]</div>
692 </div>
693
694 <div class="row reg-field-row">
695   <div class="col-md-3 reg-field-label">
696     <label>{{user_setting_types['opac.default_phone'].label()}}</label>
697   </div>
698   <div class="col-md-3 reg-field-input">
699     <input ng-required="hold_notify_type.phone" 
700       ng-change="field_modified()" 
701       ng-blur="handle_field_changed(user_settings, 'opac.default_phone')"
702       type='text' ng-model="user_settings['opac.default_phone']"/>
703   </div>
704 </div>
705
706 <div class="row reg-field-row">
707   <div class="col-md-3 reg-field-label">
708     <label>{{user_setting_types['opac.default_pickup_location'].label()}}</label>
709   </div>
710   <div class="col-md-3 reg-field-input">
711     <eg-org-selector nodefault
712       disable-test="disable_pulib" 
713       selected="patron._pickup_lib"
714       onchange="handle_pulib_changed">
715     </eg-org-selector>
716   </div>
717 </div>
718
719 <div class="row reg-field-row" 
720     ng-if="org_settings['circ.holds.behind_desk_pickup_supported']">
721   <div class="col-md-3 reg-field-label">
722     <label>{{user_setting_types['circ.holds_behind_desk'].label()}}</label>
723   </div>
724   <div class="col-md-3 reg-field-input">
725       <input 
726         ng-change="field_modified()" 
727         type='checkbox' ng-model="user_settings['circ.holds_behind_desk']"/>
728   </div>
729 </div>
730
731 <!-- TODO: Add circ.collections.exempt to master SQL seed data -->
732 <div class="row reg-field-row" 
733   ng-if="user_setting_types['circ.collections.exempt']">
734   <div class="col-md-3 reg-field-label">
735     <label>{{user_setting_types['circ.collections.exempt'].label()}}</label>
736   </div>
737   <div class="col-md-3 reg-field-input">
738       <input 
739         type='checkbox' 
740         ng-change="field_modified()" 
741         ng-disabled="!perms.UPDATE_PATRON_COLLECTIONS_EXEMPT"
742         ng-model="user_settings['circ.collections.exempt']"/>
743   </div>
744 </div>
745
746 <div class="row reg-field-row">
747   <div class="col-md-3 reg-field-label">
748     <label>[% l('Holds Notices') %]</label>
749   </div>
750   <div class="col-md-3 reg-field-input flex-row">
751     <div class='flex-cell'>
752       <input 
753         ng-change="field_modified()" 
754         type='checkbox' ng-model="hold_notify_type.phone"/>
755       [% l('Phone') %]
756     </div>
757     <div class='flex-cell'>
758       <input 
759         ng-change="field_modified()" 
760         type='checkbox' ng-model="hold_notify_type.email"/>
761       [% l('Email') %]
762     </div>
763     <div class='flex-cell' ng-if="org_settings['sms.enable']">
764       <input 
765         ng-change="field_modified()" 
766         type='checkbox' ng-model="hold_notify_type.sms"/>
767       [% l('SMS') %]
768     </div>
769   </div>
770 </div>
771
772 <div class="row reg-field-row" ng-if="org_settings['sms.enable']">
773   <div class="col-md-3 reg-field-label">
774     <label>[% l('Default SMS/Text Number') %]</label>
775   </div>
776   <div class="col-md-3 reg-field-input">
777     <input ng-required="hold_notify_type.sms" 
778       ng-change="field_modified()" ng-model="user_settings['opac.default_sms_notify']"
779       ng-blur="handle_field_changed(user_settings, 'opac.default_sms_notify')"
780       type='text'/>
781   </div>
782 </div>
783
784 <div class="row reg-field-row" ng-if="org_settings['sms.enable']">
785   <div class="col-md-3 reg-field-label">
786     <label>[% l('Default SMS Carrier') %]</label>
787   </div>
788   <div class="col-md-3 reg-field-input">
789     <span class="nullable">
790       <select str-to-int ng-required="user_settings['opac.default_sms_notify']" class="form-control" ng-model="user_settings['opac.default_sms_carrier']" ng-options="c.id() as c.name() for c in sms_carriers"
791       ng-blur="handle_field_changed(user_settings, 'opac.default_sms_carrier')">
792         <option value="">Select a Carrier</option>
793       </select>
794     </span>
795   </div>
796 </div>
797
798 <div class="row reg-field-row" ng-repeat="type in opt_in_setting_types">
799   <div class="col-md-3 reg-field-label" ng-if="type.name() != 'circ.send_email_checkout_receipts'">
800     <label>{{type.label()}}</label>
801   </div>
802   <div class="col-md-3 reg-field-input" ng-if="type.name() != 'circ.send_email_checkout_receipts'">
803     <input 
804       ng-change="field_modified()" 
805       type='checkbox' ng-model="user_settings[type.name()]"/>
806   </div>
807 </div>
808
809 <div class="row reg-field-row" ng-if="org_settings['circ.privacy_waiver']">
810   <div class="col-md-3 reg-field-label">
811     <label>[% l('Allow others to use my account') %]</label>
812   </div>
813   <div class="col-md-3 reg-field-input">
814     <div class="row" ng-repeat="waiver_entry in patron.waiver_entries" ng-hide="waiver_entry.isdeleted">
815       <div class="row flex-row">
816         <div class="flex-cell">
817           <input ng-change="field_modified()"
818             type='text' ng-model="waiver_entry.name"/>
819         </div>
820         <div class="flex-cell">
821           <button type="button" 
822             ng-click="field_modified();delete_waiver_entry(waiver_entry)" 
823             class="btn btn-danger">[% l('X') %]</button>
824         </div>
825       </div>
826       <div class="row flex-row reg-field-input">
827         <div class="flex-cell">
828           <label><input ng-change="field_modified()"
829             type='checkbox' ng-model="waiver_entry.place_holds"/>
830             [% l('Place Holds?') %]</label>
831         </div>
832         <div class="flex-cell">
833           <label><input ng-change="field_modified()"
834             type='checkbox' ng-model="waiver_entry.pickup_holds"/>
835             [% l('Pick Up Holds?') %]</label>
836         </div>
837         <div class="flex-cell">
838           <label><input ng-change="field_modified()"
839             type='checkbox' ng-model="waiver_entry.view_history"/>
840             [% l('View Borrowing History?') %]</label>
841         </div>
842         <div class="flex-cell">
843           <label><input ng-change="field_modified()"
844             type='checkbox' ng-model="waiver_entry.checkout_items"/>
845             [% l('Check Out Items?') %]</label>
846         </div>
847       </div> <!-- end checkboxes -->
848     </div> <!-- end ng-repeat waiver_entry -->
849     <div class="row">
850       <div class="col-md-3 reg-field-input">
851       <button type="button" ng-click="new_waiver_entry()" 
852         class="btn btn-success">[% l('Add Person') %]</button>
853       </div>
854     </div>
855   </div> <!-- end waiver entries input -->
856 </div> <!-- end waiver entries row -->
857
858 </div> <!-- end offline test -->
859
860 <!-- addresses -->
861
862 <div ng-repeat="addr in patron.addresses">
863   <div class="alert alert-success row" role="alert">
864       <div class="col-md-3">
865         [% l('Address') %]
866         <div ng-show="addr._linked_owner">
867           (<a target="_blank"
868             href="/eg/staff/circ/patron/{{addr._linked_owner_id}}/edit">
869             [% l('Owned by [_1]', '{{addr._linked_owner}}') %]
870           </a>)
871         </div>
872       </div>
873       <div class="col-md-3">
874           <span class='pad-all-min'>
875             [% l('Mailing') %] <input type='checkbox' 
876               ng-change="field_modified();set_addr_type(addr, 'mailing')" 
877               ng-model="addr._is_mailing"/>
878           </span>
879           <span class='pad-all-min'>
880             [% l('Physical') %] <input type='checkbox' 
881               ng-change="field_modified();set_addr_type(addr, 'billing')" 
882               ng-model="addr._is_billing"/>
883           </span>
884           <span class='pad-all-min'>
885             <button type="button" 
886               ng-click="field_modified();delete_address(addr.id)" 
887               class="btn btn-danger">[% l('X') %]</button>
888           </span>
889       </div>
890   </div>
891
892   <div ng-if="addr.pending" class="row">
893     <div class="col-md-6 patron-reg-pending-address">
894       <div class="row">
895         <div class="col-md-6">
896           [% l('This is a pending address') %]
897         </div>
898         <div class="col-md-6">
899           <button class="btn btn-success" 
900             ng-click="approve_pending_address(addr)">[% l('Approve') %]</button>
901         </div>
902       </div>
903       <div class="row" ng-if="addr._replaces">
904         <div class="col-md-6">
905           [% | l(
906             '{{addr._replaces.street1}}',
907             '{{addr._replaces.street2}}',
908             '<br/>'
909             '{{addr._replaces.city}}',
910             '{{addr._replaces.state}}',
911             '{{addr._replaces.post_code}}') %]
912             Replaces: [_1] [_2] [_3] [_4], [_5] [_6]
913           [% END %]
914         </div>
915       </div>
916     </div>
917     <!-- make sure we occupy the entire row -->
918     <div class="col-md-6"> </div>
919   </div>
920
921   <!-- ADDRESS_TYPE -->
922   <div class="row reg-field-row" ng-show="show_field('aua.address_type')">
923     [% draw_field_label('aua', 'address_type') %]
924     [% draw_form_input('aua', 
925       'address_type', 'addresses[$index]', '', 'addr._linked_owner') %]
926     <div class="col-md-6 patron-reg-example">
927       [% draw_example_text('aua', 'address_type') %]
928     </div>
929   </div>
930
931   <!-- POST_CODE -->
932
933   <div class="row reg-field-row" ng-show="show_field('aua.post_code')">
934     [% draw_field_label('aua', 'post_code') %]
935     [% draw_form_input('aua', 
936       'post_code', 'addresses[$index]', '', 'addr._linked_owner') %]
937     <div class="col-md-6 patron-reg-example">
938       [% draw_example_text('aua', 'post_code') %]
939     </div>
940   </div>
941
942   <!-- STREET1 -->
943
944   <div class="row reg-field-row" ng-show="show_field('aua.street1')">
945     [% draw_field_label('aua', 'street1') %]
946     [% draw_form_input('aua', 
947       'street1', 'addresses[$index]', '', 'addr._linked_owner') %]
948     <div class="col-md-6 patron-reg-example">
949       [% draw_example_text('aua', 'street1') %]
950     </div>
951   </div>
952
953   <!-- STREET2 -->
954
955   <div class="row reg-field-row" ng-show="show_field('aua.street2')">
956     [% draw_field_label('aua', 'street2') %]
957     [% draw_form_input('aua', 
958       'street2', 'addresses[$index]', '', 'addr._linked_owner') %]
959     <div class="col-md-6 patron-reg-example">
960       [% draw_example_text('aua', 'street2') %]
961     </div>
962   </div>
963
964   <!-- CITY -->
965
966   <div class="row reg-field-row" ng-show="show_field('aua.city')">
967     [% draw_field_label('aua', 'city') %]
968     [% draw_form_input('aua', 
969       'city', 'addresses[$index]', '', 'addr._linked_owner') %]
970     <div class="col-md-6 patron-reg-example">
971       [% draw_example_text('aua', 'city') %]
972     </div>
973   </div>
974
975   <!-- COUNTY -->
976
977   <div class="row reg-field-row" ng-show="show_field('aua.county')">
978     [% draw_field_label('aua', 'county') %]
979     [% draw_form_input('aua', 
980       'county', 'addresses[$index]', '', 'addr._linked_owner') %]
981     <div class="col-md-6 patron-reg-example">
982       [% draw_example_text('aua', 'county') %]
983     </div>
984   </div>
985
986   <!-- STATE -->
987
988   <div class="row reg-field-row" ng-show="show_field('aua.state')">
989     [% draw_field_label('aua', 'state') %]
990     [% draw_form_input('aua', 
991       'state', 'addresses[$index]', '', 'addr._linked_owner') %]
992     <div class="col-md-6 patron-reg-example">
993       [% draw_example_text('aua', 'state') %]
994     </div>
995   </div>
996
997   <!-- COUNTRY -->
998
999   <div class="row reg-field-row" ng-show="show_field('aua.country')">
1000     [% draw_field_label('aua', 'country') %]
1001     [% draw_form_input('aua', 
1002       'country', 'addresses[$index]', '', 'addr._linked_owner') %]
1003     <div class="col-md-6 patron-reg-example">
1004       [% draw_example_text('aua', 'country') %]
1005     </div>
1006   </div>
1007
1008   <!-- VALID -->
1009
1010   <div class="row reg-field-row" ng-show="show_field('aua.valid')">
1011     [% draw_field_label('aua', 'valid') %]
1012     <div class="col-md-3 reg-field-input">
1013         <input 
1014           type='checkbox' 
1015           ng-change="field_modified()" 
1016           ng-disabled='addr._linked_owner'
1017           ng-blur="handle_field_changed(patron.addresses[$index], 'valid')"
1018           ng-model="patron.addresses[$index].valid"/>
1019     </div>
1020     <div class="col-md-6 patron-reg-example">
1021       [% draw_example_text('aua', 'valid') %]
1022     </div>
1023   </div>
1024
1025   <!-- WITHIN_CITY_LIMITS -->
1026
1027   <div class="row reg-field-row" ng-show="show_field('aua.within_city_limits')">
1028     [% draw_field_label('aua', 'within_city_limits') %]
1029     <div class="col-md-3 reg-field-input">
1030         <input 
1031           type='checkbox' 
1032           ng-change="field_modified()" 
1033           ng-disabled='addr._linked_owner'
1034           ng-blur="handle_field_changed(patron.addresses[$index], 'within_city_limits')"
1035           ng-model="patron.addresses[$index].within_city_limits"/>
1036     </div>
1037     <div class="col-md-6 patron-reg-example">
1038       [% draw_example_text('aua', 'within_city_limits') %]
1039     </div>
1040   </div>
1041
1042   <!-- pending address -->
1043
1044 </div> <!-- addresses -->
1045
1046 <div class="row">
1047   <button type="button" ng-click="new_address()" 
1048     class="btn btn-success">[% l('New Address') %]</button>
1049 </div>
1050
1051 <div ng-if="!offline">
1052 <div class="alert alert-success row" role="alert"
1053     ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-if="stat_cats.length > 0">
1054     <div class="col-md-6">[% l('Statistical Categories') %]</div>
1055 </div>
1056
1057 <div class="row reg-field-row"
1058      ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-repeat="cat in stat_cats">
1059      <!-- Display this stat cat when displaying all stat cats
1060        or when this stat cat is required.  Wrap the body of
1061        stat cat display in a div for easy show/hide.  -->
1062   <div ng-if="show_field('stat_cats') || cat.required() == 1">
1063
1064     <div class="col-md-3 reg-field-label">
1065       <label>{{cat.name()}}</label>
1066     </div>
1067     <div class="col-md-3 reg-field-input">
1068       <div ng-if="cat.entries().length != 0">
1069         <div class="btn-group" uib-dropdown>
1070           <button type="button" class="btn btn-default" ng-class="{'ng-invalid': cat.required() == 1 && !stat_cat_entry_maps[cat.id()] }" uib-dropdown-toggle>
1071             <span style="padding-right: 5px;">
1072               {{stat_cat_entry_maps[cat.id()]}}</span>
1073             <span class="caret"></span>
1074           </button>
1075           <ul uib-dropdown-menu>
1076             <li ng-repeat="entry in cat.entries()">
1077               <a href
1078                 ng-click="field_modified();stat_cat_entry_maps[cat.id()]=entry.value()">
1079                 {{entry.value()}}
1080               </a>
1081             </li>
1082           </ul>
1083         </div>
1084       </div>
1085     </div>
1086
1087     <!-- Stat cat retrieval API uses open-ils.storage under the covers
1088         which represents DB bools at 1/0 instead of cstore-style t/f -->
1089     <div class="col-md-3 reg-field-input"
1090       ng-show="show_field('stat_cats') || hasRequiredStatCat"
1091       ng-if="cat.allow_freetext() == '1'">
1092       <input type="text" ng-model="stat_cat_entry_maps[cat.id()]"
1093         class="form-control" ng-required="cat.required() == 1"/>
1094     </div>
1095
1096   </div><!-- show/hide wrapper -->
1097 </div>
1098 </div>
1099
1100 <!-- surveys -->
1101
1102 <div class="alert alert-success row" role="alert" 
1103     ng-show="show_field('surveys')" ng-if="surveys.length > 0">
1104     <div class="col-md-6">[% l('Surveys') %]</div>
1105 </div>
1106
1107 <div class="row reg-field-row" 
1108     ng-show="show_field('surveys')" ng-repeat="survey in surveys">
1109   <div class="col-md-3 reg-field-label">
1110     <label>{{survey.name()}}</label>
1111   </div>
1112   <div class="col-md-6 reg-field-input">
1113     <div class="row" ng-repeat="question in survey.questions()" 
1114       style="margin-bottom: 10px;">
1115       <div class="col-md-6">{{question.question()}}</div>
1116       <div class="col-md-6">
1117         <div class="btn-group" uib-dropdown>
1118           <button type="button" class="btn btn-default" uib-dropdown-toggle>
1119             <span style="padding-right: 5px;">
1120               {{survey_responses[question.id()].answer()}}
1121             </span>
1122             <span class="caret"></span>
1123           </button>
1124           <ul uib-dropdown-menu>
1125             <li ng-repeat="answer in question.answers()">
1126               <a href 
1127                 ng-click="field_modified();survey_responses[question.id()] = answer"> 
1128                 {{answer.answer()}} 
1129               </a>
1130             </li>
1131           </ul>
1132         </div>
1133       </div>
1134     </div>
1135   </div>
1136 </div>
1137
1138 </div><!-- /form wrapper -->