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