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')}
39 <div id="content-wrapper">
40 <div id="main-content-register">
41 <div class="common-full-pad"></div>
42 <h1>[% l('Request a Library Card')%]</h1>
45 [% IF ctx.register.success %]
46 <h3>[% l('Registration successful!') %]<h3>
47 <h4>[% l('Please see library staff to complete your registration.') %]</h4>
49 [% IF ctx.register.username_taken %]
52 Note: The selected username may be in use by another patron.
53 You may select another username when finalizing your
54 registration or in the online catalog.
61 <a href="[% ctx.opac_root %]/home"
62 class="opac-button">[% l('Return to the Catalog') %]</a>
65 [% ELSIF ctx.register.error %]
66 <h3>[% l('A registration error has occurred') %]</h3>
67 <h4>[% l('Please see library staff to complete your registration.') %]</h4>
71 <a href="[% ctx.opac_root %]/home"
72 class="opac-button">[% l('Return to the Catalog') %]</a>
78 <!-- if the user is logged in, make it
79 clear we are tracking the requestor -->
80 <h4>[% l('New account requested by [_1] [_2] [_3] [_4] [_5]',
81 ctx.user.prefix, ctx.user.first_given_name,
82 ctx.user.second_given_name, ctx.user.family_name,
91 <label for='stgu.home_ou'>[% l('Home Library') %]</label>
93 <td>[% INCLUDE build_org_selector
95 value=value || ctx_org
97 valid_org_list=ctx.register.valid_orgs
101 [% IF ctx.register.invalid.bad_home_ou %]
102 <span class='patron-reg-invalid'>
103 [% l('Please select a valid library') %]
108 # <=== shifting code left for readability
110 # render the table row for each of the register fields
111 FOR field_def IN register_fields;
112 fclass = field_def.class;
113 fname = field_def.name;
114 field_path = fclass _ "." _ fname;
116 show = ctx.register.settings.$fclass.$fname.show;
117 require = ctx.register.settings.$fclass.$fname.require;
118 example = ctx.register.settings.$fclass.$fname.example;
119 value = ctx.register.values.$fclass.$fname;
121 invalid_require = ctx.register.invalid.$fclass.$fname.require;
122 invalid_regex = ctx.register.invalid.$fclass.$fname.regex;
124 NEXT UNLESS require OR show;
128 <label for='[% field_path %]'>[% field_def.label | html %]</label>
133 name='[% field_path %]'
134 value='[% value || CGI.param(field_path) | html %]'/>
136 <span class='patron-reg-invalid'>*</span>
141 <!-- display errors and example text -->
143 [% IF invalid_require %]
144 <span class='patron-reg-invalid'>
145 [% l('This field is required') %]
147 [% ELSIF invalid_regex %]
148 <span class='patron-reg-invalid'>
149 [% l('The value entered does not have the correct format') %]
153 <span class='patron-reg-extra'>
154 [% l('(Example: [_1])', example) %]
161 <!-- ====> shifting the code back to the right for context -->
164 <a href="[% ctx.opac_root %]/home"
165 class="opac-button">[% l('Go Back') %]</a>
167 value="[% l('Submit Registration') %]"
168 class="opac-button" />
174 <div class="common-full-pad"></div>