1 [%- PROCESS "opac/parts/header.tt2";
2 PROCESS "opac/parts/org_selector.tt2";
3 WRAPPER "opac/parts/base.tt2";
4 INCLUDE "opac/parts/topnav.tt2";
5 ctx.page_title = l("Request Library Card");
7 # some useful variables and MACROs for display,
8 # field validation, and added info display
10 ctx_org = ctx.physical_loc || ctx.search_ou || ctx.aou_tree.id;
12 # list of the registration fields to (potentially)
13 # display in the order they should be shown
15 # post_code is the only field below that is required in the database and
16 # post_code is only required if an address is created.
17 # To prevent any of these fields from showing locally, regardless org unit
18 # settings, simply remove the fields from this list. In the case of
19 # addresses, if all address fields are removed, no attempt at creating
20 # an address will be made (and post_code will no longer be required).
23 {class => 'stgu', name = 'first_given_name', label => l('First Name')},
24 {class => 'stgu', name = 'second_given_name', label => l('Middle Name')},
25 {class => 'stgu', name = 'family_name', label => l('Last Name')},
26 {class => 'stgma', name = 'street1', label => l('Street Address')},
27 {class => 'stgma', name = 'street2', label => l('Street Address (2)')},
28 {class => 'stgma', name = 'city', label => l('City')},
29 {class => 'stgma', name = 'county', label => l('County')},
30 {class => 'stgma', name = 'state', label => l('State')},
31 {class => 'stgma', name = 'post_code', label => l('Zip Code')},
32 {class => 'stgu', name = 'dob', label => l('Date of Birth')},
33 {class => 'stgu', name = 'day_phone', label => l('Phone Number')},
34 {class => 'stgu', name = 'email', label => l('Email Address')}
35 {class => 'stgu', name = 'usrname', label => l('Requested Username')}
38 # The dojo date widget in the patron edit UI only accepts default
39 # values in ISO8601 format. It will not accept locale-shaped dates.
40 IF !ctx.register.settings.stgu.dob.example;
41 ctx.register.settings.stgu.dob.example = l('YYYY-MM-DD');
46 <div id="content-wrapper">
47 <div id="main-content-register">
48 <div class="common-full-pad"></div>
49 <h1>[% l('Request a Library Card')%]</h1>
52 [% IF ctx.register.success %]
53 <h3>[% l('Registration successful!') %]<h3>
54 <h4>[% l('Please see library staff to complete your registration.') %]</h4>
56 [% IF ctx.register.username_taken %]
59 Note: The selected username may be in use by another patron.
60 You may select another username when finalizing your
61 registration or in the online catalog.
68 <a href="[% ctx.opac_root %]/home"
69 class="opac-button">[% l('Return to the Catalog') %]</a>
72 [% ELSIF ctx.register.error %]
73 <h3>[% l('A registration error has occurred') %]</h3>
74 <h4>[% l('Please see library staff to complete your registration.') %]</h4>
78 <a href="[% ctx.opac_root %]/home"
79 class="opac-button">[% l('Return to the Catalog') %]</a>
85 <!-- if the user is logged in, make it
86 clear we are tracking the requestor -->
87 <h4>[% l('New account requested by [_1] [_2] [_3] [_4] [_5]',
88 ctx.user.prefix, ctx.user.first_given_name,
89 ctx.user.second_given_name, ctx.user.family_name,
98 <label for='stgu.home_ou'>[% l('Home Library') %]</label>
100 <td>[% INCLUDE build_org_selector
102 value=value || ctx_org
103 can_have_users_only=1
104 valid_org_list=ctx.register.valid_orgs
108 [% IF ctx.register.invalid.bad_home_ou %]
109 <span class='patron-reg-invalid'>
110 [% l('Please select a valid library') %]
115 # <=== shifting code left for readability
117 # render the table row for each of the register fields
118 FOR field_def IN register_fields;
119 fclass = field_def.class;
120 fname = field_def.name;
121 field_path = fclass _ "." _ fname;
123 show = ctx.register.settings.$fclass.$fname.show;
124 require = ctx.register.settings.$fclass.$fname.require;
125 example = ctx.register.settings.$fclass.$fname.example;
126 value = ctx.register.values.$fclass.$fname;
128 invalid_require = ctx.register.invalid.$fclass.$fname.require;
129 invalid_regex = ctx.register.invalid.$fclass.$fname.regex;
131 NEXT UNLESS require OR show;
135 <label for='[% field_path %]'>[% field_def.label | html %]</label>
140 name='[% field_path %]'
141 value='[% value || CGI.param(field_path) | html %]'/>
143 <span class='patron-reg-invalid'>*</span>
148 <!-- display errors and example text -->
150 [% IF invalid_require %]
151 <span class='patron-reg-invalid'>
152 [% l('This field is required') %]
154 [% ELSIF invalid_regex %]
155 <span class='patron-reg-invalid'>
156 [% l('The value entered does not have the correct format') %]
160 <span class='patron-reg-extra'>
161 [% l('(Example: [_1])', example) %]
168 <!-- ====> shifting the code back to the right for context -->
171 <a href="[% ctx.opac_root %]/home"
172 class="opac-button">[% l('Go Back') %]</a>
174 value="[% l('Submit Registration') %]"
175 class="opac-button" />
181 <div class="common-full-pad"></div>