$user->$_($val);
}
+ # make sure the selected home org unit is in the list
+ # of valid orgs. This can happen if the selector
+ # defaults to CONS, for example.
+ $ctx->{register}{invalid}{bad_home_ou} = 1 unless
+ grep {$_ eq $user->home_ou} @{$ctx->{register}{valid_orgs}};
+
# address
+ my $has_addr = 0;
foreach (grep /^stgma\./, $cgi->param) {
my $val = $cgi->param($_);
$self->inspect_register_value($_, $val);
s/^stgma\.//g;
$addr->$_($val);
+ $has_addr = 1;
}
+ # if the form contains no address fields, do not
+ # attempt to create a pending address
+ $addr = undef unless $has_addr;
+
# At least one value was invalid. Exit early and re-render.
return Apache2::Const::OK if $ctx->{register}{invalid};
# list of the registration fields to (potentially)
# display in the order they should be shown
+# post_code is the only field below that is required in the database and
+# post_code is only required if an address is created.
+# To prevent any of these fields from showing locally, regardless org unit
+# settings, simply remove the fields from this list. In the case of
+# addresses, if all address fields are removed, no attempt at creating
+# an address will be made (and post_code will no longer be required).
+
register_fields = [
{class => 'stgu', name = 'first_given_name', label => l('First Name')},
{class => 'stgu', name = 'second_given_name', label => l('Middle Name')},
<hr/>
[% IF ctx.register.success %]
- <h3>[% |l %]
- Registration successful!
- Please see library staff to complete your registration.
- [% END %]</h3>
+ <h3>[% l('Registration successful!') %]<h3>
+ <h4>[% l('Please see library staff to complete your registration.') %]</h4>
[% IF ctx.register.username_taken %]
<p>
[% |l %]
- Note: The selected username may be in use by another
- patron. You may select another username when finalizing
- your registration or in the online catalog.
+ Note: The selected username may be in use by another patron.
+ You may select another username when finalizing your
+ registration or in the online catalog.
[% END %]
</p>
[% END %]
+ <br/>
+ <p>
+ <a href="[% ctx.opac_root %]/home"
+ class="opac-button">[% l('Return to the Catalog') %]</a>
+ </p>
+
[% ELSIF ctx.register.error %]
- <h3>[% |l %]
- An registration error has occurred. Please see library staff.
- [% END %]</h3>
+ <h3>[% l('An registration error has occurred') %]</h3>
+ <h4>[% l('Please see library staff to complete your registration.') %]</h4>
+
+ <br/>
+ <p>
+ <a href="[% ctx.opac_root %]/home"
+ class="opac-button">[% l('Return to the Catalog') %]</a>
+ </p>
[% ELSE %]
valid_org_list=ctx.register.valid_orgs
%]
</td>
+ <td>
+ [% IF ctx.register.invalid.bad_home_ou %]
+ <span class='patron-reg-invalid'>
+ [% l('Please select a valid library') %]
+ </span>
+ [% END %]
</tr>
[%
# <=== shifting code left for readability