2b85fd081e28406d84ec024d956c146535174ad7
[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" class='patron-reg-fixed-bar'>
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" 
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-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 class="alert alert-success row" role="alert">
563   <div class="col-md-6">[% l('User Settings') %]</div>
564 </div>
565
566 <div class="row reg-field-row">
567   <div class="col-md-3 reg-field-label">
568     <label>{{user_setting_types['opac.default_phone'].label()}}</label>
569   </div>
570   <div class="col-md-3 reg-field-input">
571     <input 
572       ng-change="field_modified()" 
573       type='text' ng-model="user_settings['opac.default_phone']"/>
574   </div>
575 </div>
576
577 <div class="row reg-field-row">
578   <div class="col-md-3 reg-field-label">
579     <label>{{user_setting_types['opac.default_pickup_location'].label()}}</label>
580   </div>
581   <div class="col-md-3 reg-field-input">
582     <eg-org-selector 
583       xonchange="field_modified" 
584       selected="patron.home_ou"></eg-org-selector>
585   </div>
586 </div>
587
588 <div class="row reg-field-row" 
589     ng-if="org_settings['circ.holds.behind_desk_pickup_supported']">
590   <div class="col-md-3 reg-field-label">
591     <label>{{user_setting_types['circ.holds_behind_desk'].label()}}</label>
592   </div>
593   <div class="col-md-3 reg-field-input">
594     <div class='checkbox'>
595       <input 
596         ng-change="field_modified()" 
597         type='checkbox' ng-model="user_settings['circ.holds_behind_desk']"/>
598     </div>
599   </div>
600 </div>
601
602 <!-- TODO: Add circ.collections.exempt to master SQL seed data -->
603 <div class="row reg-field-row" 
604   ng-if="user_setting_types['circ.collections.exempt']">
605   <div class="col-md-3 reg-field-label">
606     <label>{{user_setting_types['circ.collections.exempt'].label()}}</label>
607   </div>
608   <div class="col-md-3 reg-field-input">
609     <div class='checkbox'>
610       <input 
611         type='checkbox' 
612         ng-change="field_modified()" 
613         ng-disabled="!perms.UPDATE_PATRON_COLLECTIONS_EXEMPT"
614         ng-model="user_settings['circ.collections.exempt']"/>
615     </div>
616   </div>
617 </div>
618
619 <div class="row reg-field-row">
620   <div class="col-md-3 reg-field-label">
621     <label>[% l('Holds Notices') %]</label>
622   </div>
623   <div class="col-md-3 reg-field-input flex-row">
624     <div class='flex-cell'>
625       <input 
626         ng-change="field_modified()" 
627         type='checkbox' ng-model="hold_notify_type.phone"/>
628       [% l('Phone') %]
629     </div>
630     <div class='flex-cell'>
631       <input 
632         ng-change="field_modified()" 
633         type='checkbox' ng-model="hold_notify_type.email"/>
634       [% l('Email') %]
635     </div>
636     <div class='flex-cell' ng-if="org_settings['sms.enable']">
637       <input 
638         ng-change="field_modified()" 
639         type='checkbox' ng-model="hold_notify_type.sms"/>
640       [% l('SMS') %]
641     </div>
642   </div>
643 </div>
644
645 <div class="row reg-field-row" ng-if="org_settings['sms.enable']">
646   <div class="col-md-3 reg-field-label">
647     <label>[% l('Default SMS/Text Number') %]</label>
648   </div>
649   <div class="col-md-3 reg-field-input">
650     <input 
651       ng-change="field_modified()" ng-model="user_settings['opac.default_sms_notify']"
652       type='text'/>
653   </div>
654 </div>
655
656 <div class="row reg-field-row" ng-if="org_settings['sms.enable']">
657   <div class="col-md-3 reg-field-label">
658     <label>[% l('Default SMS Carrier') %]</label>
659   </div>
660   <div class="col-md-3 reg-field-input">
661     <span class="nullable">
662       <select class="form-control" ng-model="user_settings['opac.default_sms_carrier']" ng-options="c.id() as c.name() for c in sms_carriers">
663         <option value="">Select a Carrier</option>
664       </select>
665     </span>
666   </div>
667 </div>
668
669 <div class="row reg-field-row" ng-repeat="type in opt_in_setting_types">
670   <div class="col-md-3 reg-field-label" ng-if="type.name() != 'circ.send_email_checkout_receipts'">
671     <label>{{type.label()}}</label>
672   </div>
673   <div class="col-md-3 reg-field-input" ng-if="type.name() != 'circ.send_email_checkout_receipts'">
674     <input 
675       ng-change="field_modified()" 
676       type='checkbox' ng-model="user_settings[type.name()]"/>
677   </div>
678 </div>
679
680 <!-- addresses -->
681
682 <div ng-repeat="addr in patron.addresses">
683   <div class="alert alert-success row" role="alert">
684       <div class="col-md-3">
685         [% l('Address') %]
686         <div ng-show="addr._linked_owner">
687           (<a target="_blank"
688             href="/eg/staff/circ/patron/{{addr._linked_owner_id}}/edit">
689             [% l('Owned by [_1]', '{{addr._linked_owner}}') %]
690           </a>)
691         </div>
692       </div>
693       <div class="col-md-3">
694           <span class='pad-all-min'>
695             [% l('Mailing') %] <input type='checkbox' 
696               ng-change="field_modified();set_addr_type(addr, 'mailing')" 
697               ng-model="addr._is_mailing"/>
698           </span>
699           <span class='pad-all-min'>
700             [% l('Physical') %] <input type='checkbox' 
701               ng-change="field_modified();set_addr_type(addr, 'billing')" 
702               ng-model="addr._is_billing"/>
703           </span>
704           <span class='pad-all-min'>
705             <button type="button" 
706               ng-click="field_modified();delete_address(addr.id)" 
707               class="btn btn-danger">[% l('X') %]</button>
708           </span>
709       </div>
710   </div>
711
712   <!-- ADDRESS_TYPE -->
713   <div class="row reg-field-row" ng-show="show_field('aua.address_type')">
714     [% draw_field_label('aua', 'address_type') %]
715     [% draw_form_input('aua', 
716       'address_type', 'addresses[$index]', '', 'addr._linked_owner') %]
717     <div class="col-md-6 patron-reg-example">
718       [% draw_example_text('aua', 'address_type') %]
719     </div>
720   </div>
721
722   <!-- POST_CODE -->
723
724   <div class="row reg-field-row" ng-show="show_field('aua.post_code')">
725     [% draw_field_label('aua', 'post_code') %]
726     [% draw_form_input('aua', 
727       'post_code', 'addresses[$index]', '', 'addr._linked_owner') %]
728     <div class="col-md-6 patron-reg-example">
729       [% draw_example_text('aua', 'post_code') %]
730     </div>
731   </div>
732
733   <!-- STREET1 -->
734
735   <div class="row reg-field-row" ng-show="show_field('aua.street1')">
736     [% draw_field_label('aua', 'street1') %]
737     [% draw_form_input('aua', 
738       'street1', 'addresses[$index]', '', 'addr._linked_owner') %]
739     <div class="col-md-6 patron-reg-example">
740       [% draw_example_text('aua', 'street1') %]
741     </div>
742   </div>
743
744   <!-- STREET2 -->
745
746   <div class="row reg-field-row" ng-show="show_field('aua.street2')">
747     [% draw_field_label('aua', 'street2') %]
748     [% draw_form_input('aua', 
749       'street2', 'addresses[$index]', '', 'addr._linked_owner') %]
750     <div class="col-md-6 patron-reg-example">
751       [% draw_example_text('aua', 'street2') %]
752     </div>
753   </div>
754
755   <!-- CITY -->
756
757   <div class="row reg-field-row" ng-show="show_field('aua.city')">
758     [% draw_field_label('aua', 'city') %]
759     [% draw_form_input('aua', 
760       'city', 'addresses[$index]', '', 'addr._linked_owner') %]
761     <div class="col-md-6 patron-reg-example">
762       [% draw_example_text('aua', 'city') %]
763     </div>
764   </div>
765
766   <!-- COUNTY -->
767
768   <div class="row reg-field-row" ng-show="show_field('aua.county')">
769     [% draw_field_label('aua', 'county') %]
770     [% draw_form_input('aua', 
771       'county', 'addresses[$index]', '', 'addr._linked_owner') %]
772     <div class="col-md-6 patron-reg-example">
773       [% draw_example_text('aua', 'county') %]
774     </div>
775   </div>
776
777   <!-- STATE -->
778
779   <div class="row reg-field-row" ng-show="show_field('aua.state')">
780     [% draw_field_label('aua', 'state') %]
781     [% draw_form_input('aua', 
782       'state', 'addresses[$index]', '', 'addr._linked_owner') %]
783     <div class="col-md-6 patron-reg-example">
784       [% draw_example_text('aua', 'state') %]
785     </div>
786   </div>
787
788   <!-- COUNTRY -->
789
790   <div class="row reg-field-row" ng-show="show_field('aua.country')">
791     [% draw_field_label('aua', 'country') %]
792     [% draw_form_input('aua', 
793       'country', 'addresses[$index]', '', 'addr._linked_owner') %]
794     <div class="col-md-6 patron-reg-example">
795       [% draw_example_text('aua', 'country') %]
796     </div>
797   </div>
798
799   <!-- VALID -->
800
801   <div class="row reg-field-row" ng-show="show_field('aua.valid')">
802     [% draw_field_label('aua', 'valid') %]
803     <div class="col-md-3 reg-field-input">
804       <div class='checkbox'>
805         <input 
806           type='checkbox' 
807           ng-change="field_modified()" 
808           ng-disabled='addr._linked_owner'
809           ng-blur="handle_field_changed(patron.addresses[$index], 'valid')"
810           ng-model="patron.addresses[$index].valid"/>
811       </div>
812     </div>
813     <div class="col-md-6 patron-reg-example">
814       [% draw_example_text('aua', 'valid') %]
815     </div>
816   </div>
817
818   <!-- WITHIN_CITY_LIMITS -->
819
820   <div class="row reg-field-row" ng-show="show_field('aua.within_city_limits')">
821     [% draw_field_label('aua', 'within_city_limits') %]
822     <div class="col-md-3 reg-field-input">
823       <div class='checkbox'>
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], 'within_city_limits')"
829           ng-model="patron.addresses[$index].within_city_limits"/>
830       </div>
831     </div>
832     <div class="col-md-6 patron-reg-example">
833       [% draw_example_text('aua', 'within_city_limits') %]
834     </div>
835   </div>
836
837   <!-- pending address -->
838
839 </div> <!-- addresses -->
840
841 <div class="row">
842   <button type="button" ng-click="new_address()" 
843     class="btn btn-success">[% l('New Address') %]</button>
844 </div>
845
846 <div class="alert alert-success row" role="alert" 
847     ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-if="stat_cats.length > 0">
848     <div class="col-md-6">[% l('Statistical Categories') %]</div>
849 </div>
850
851 <div class="row reg-field-row"
852      ng-show="show_field('stat_cats') || hasRequiredStatCat" ng-repeat="cat in stat_cats">
853      <!-- Display this stat cat when displaying all stat cats
854        or when this stat cat is required.  Wrap the body of
855        stat cat display in a div for easy show/hide.  -->
856   <div ng-if="show_field('stat_cats') || cat.required() == 1">
857
858     <div class="col-md-3 reg-field-label">
859       <label>{{cat.name()}}</label>
860     </div>
861     <div class="col-md-3 reg-field-input">
862       <div ng-if="cat.entries().length != 0">
863         <div class="btn-group" uib-dropdown>
864           <button type="button" class="btn btn-default" uib-dropdown-toggle>
865             <span style="padding-right: 5px;">
866               {{stat_cat_entry_maps[cat.id()]}}</span>
867             <span class="caret"></span>
868           </button>
869           <ul uib-dropdown-menu>
870             <li ng-repeat="entry in cat.entries()">
871               <a href
872                 ng-click="field_modified();stat_cat_entry_maps[cat.id()]=entry.value()">
873                 {{entry.value()}}
874               </a>
875             </li>
876           </ul>
877         </div>
878       </div>
879     </div>
880
881     <!-- Stat cat retrieval API uses open-ils.storage under the covers
882         which represents DB bools at 1/0 instead of cstore-style t/f -->
883     <div class="col-md-3 reg-field-input"
884       ng-show="show_field('stat_cats') || hasRequiredStatCat"
885       ng-if="cat.allow_freetext() == '1'">
886       <input type="text" ng-model="stat_cat_entry_maps[cat.id()]"
887         class="form-control" ng-required="cat.required() == 1"/>
888     </div>
889
890   </div><!-- show/hide wrapper -->
891 </div>
892
893 <!-- surveys -->
894
895 <div class="alert alert-success row" role="alert" 
896     ng-show="show_field('surveys')" ng-if="surveys.length > 0">
897     <div class="col-md-6">[% l('Surveys') %]</div>
898 </div>
899
900 <div class="row reg-field-row" 
901     ng-show="show_field('surveys')" ng-repeat="survey in surveys">
902   <div class="col-md-3 reg-field-label">
903     <label>{{survey.name()}}</label>
904   </div>
905   <div class="col-md-6 reg-field-input">
906     <div class="row" ng-repeat="question in survey.questions()" 
907       style="margin-bottom: 10px;">
908       <div class="col-md-6">{{question.question()}}</div>
909       <div class="col-md-6">
910         <div class="btn-group" uib-dropdown>
911           <button type="button" class="btn btn-default" uib-dropdown-toggle>
912             <span style="padding-right: 5px;">
913               {{survey_responses[question.id()].answer()}}
914             </span>
915             <span class="caret"></span>
916           </button>
917           <ul uib-dropdown-menu>
918             <li ng-repeat="answer in question.answers()">
919               <a href 
920                 ng-click="field_modified();survey_responses[question.id()] = answer"> 
921                 {{answer.answer()}} 
922               </a>
923             </li>
924           </ul>
925         </div>
926       </div>
927     </div>
928   </div>
929 </div>
930
931 </div><!-- /form wrapper -->