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