From 9949f838cdae30d05e49d0c179510facb2baebc6 Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Tue, 11 Aug 2020 16:51:51 -0400 Subject: [PATCH] Quipu Self-Registration Form Edited both ecard.tt2 and register.tt2 to add quipu form javascript and add intro text. Signed-off-by: Terran McCanna --- Open-ILS/src/templates/opac/register.tt2 | 261 ++++------------------- 1 file changed, 46 insertions(+), 215 deletions(-) diff --git a/Open-ILS/src/templates/opac/register.tt2 b/Open-ILS/src/templates/opac/register.tt2 index 0f2ce52449..1c1baa9f25 100644 --- a/Open-ILS/src/templates/opac/register.tt2 +++ b/Open-ILS/src/templates/opac/register.tt2 @@ -3,230 +3,61 @@ WRAPPER "opac/parts/base.tt2"; INCLUDE "opac/parts/topnav.tt2"; ctx.page_title = l("Request Library Card"); - -# for privacy, reload the page after (default) 5 minutes -refresh_time = ctx.register.settings.refresh_timeout || 300; -ctx.refresh = refresh_time _ '; ' _ ctx.opac_root _ '/home'; - -# some useful variables and MACROs for display, -# field validation, and added info display - -ctx_org = ctx.physical_loc || ctx.search_ou || ctx.aou_tree.id; - -# 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')}, - {class => 'stgu', name = 'family_name', label => l('Last Name')}, - {class => 'stgu', name = 'pref_first_given_name', label => l('Preferred First Name')}, - {class => 'stgu', name = 'pref_second_given_name', label => l('Preferred Middle Name')}, - {class => 'stgu', name = 'pref_family_name', label => l('Preferred Last Name')}, - {class => 'stgma', name = 'street1', label => l('Street Address')}, - {class => 'stgma', name = 'street2', label => l('Street Address (2)')}, - {class => 'stgma', name = 'city', label => l('City')}, - {class => 'stgma', name = 'county', label => l('County')}, - {class => 'stgma', name = 'state', label => l('State')}, - {class => 'stgma', name = 'post_code', label => l('Zip Code')}, - {class => 'stgu', name = 'dob', label => l('Date of Birth')}, - {class => 'stgu', name = 'day_phone', label => l('Phone Number')}, - {class => 'stgu', name = 'email', label => l('Email Address')} - {class => 'stgu', name = 'usrname', label => l('Requested Username')} -]; - -# The dojo date widget in the patron edit UI only accepts default -# values in ISO8601 format. It will not accept locale-shaped dates. -IF !ctx.register.settings.stgu.dob.example; - ctx.register.settings.stgu.dob.example = l('YYYY-MM-DD or YYYY/MM/DD'); -END; - %]

[% l('Account Registration') %]

-

[% l('Request a Library Card')%]

-
- - [% IF ctx.register.success %] -

[% l('Registration successful!') %]

-

[% l('Please see library staff to complete your registration.') %]

- - [% IF ctx.register.username_taken %] -

- [% |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. - [% END %] -

- [% END %] +
-
-

- [% l('Return to the Catalog') %] -

+ - [% ELSIF ctx.register.error %] -

[% l('A registration error has occurred') %]

-

[% l('Please see library staff to complete your registration.') %]

+ -
-

- [% l('Return to the Catalog') %] -

+ - [% ELSE %] - - [% IF ctx.user %] - -

[% l('New account requested by [_1] [_2] [_3] [_4] [_5]', - ctx.user.prefix, ctx.user.first_given_name, - ctx.user.second_given_name, ctx.user.family_name, - ctx.user.suffix - ) | html %]

- [% END %] - - [% - #prepopulate org selector on refresh or error - cgi_org = CGI.param('stgu.home_ou') | html; - IF cgi_org && ctx.register.valid_orgs.grep("^$cgi_org$").size; - prepopulate_org = cgi_org; - END - %] - -
- - - - - -[% -# <=== shifting code left for readability - -# render the table row for each of the register fields -FOR field_def IN register_fields; - fclass = field_def.class; - fname = field_def.name; - orig_name = fname; - - field_path = fclass _ "." _ fname; - - IF fname.match('^pref_'); - # Preferred name fields adopt most visibility, etc. - # settings from the primary name counterparts. - fname = fname.remove('^pref_'); - END; - - show = ctx.register.settings.$fclass.$fname.show; - require = ctx.register.settings.$fclass.$fname.require; - example = ctx.register.settings.$fclass.$fname.example; - value = ctx.register.values.$fclass.$fname; - - invalid_require = ctx.register.invalid.$fclass.$fname.require; - invalid_regex = ctx.register.invalid.$fclass.$fname.regex; - - IF orig_name.match('^pref_'); - show = show || require; - require = 0; # pref name values never required - END; - - NEXT UNLESS require OR show; -%] - - - - - -[% END %] - - [% IF ctx.register.opt_in_settings.size > 0 %] - [% FOR optin IN ctx.register.opt_in_settings %] - - - - - - [% END %] - [% END %] - - - -
- - [% INCLUDE build_org_selector - name='stgu.home_ou' - value=value || prepopulate_org || ctx_org - can_have_users_only=1 - valid_org_list=ctx.register.valid_orgs - %]
-
- [% l("PINES Location Tip") %] -
-
- [% IF ctx.register.invalid.bad_home_ou %] - - [% l('Please select a valid library') %] - - [% END %] -
- - - - [% IF require %] - * - [% END %] - - - - - [% IF invalid_require %] - - [% l('This field is required') %] - - [% ELSIF invalid_regex %] - - [% l('The value entered does not have the correct format') %] - - [% END %] - [% IF example %] - - [% l('(Example: [_1])', example) %] - - [% END %] - -
- -
- [% l('Go Back') %] - -
-
- [% END %] -
-
+ + + + + + + + + + + + +
+ +
+

Welcome to PINES!

+

Please fill out the form below to register for a PINES e-card. An e-card provides immediate access to your library's online resources.

+ +

If you'd like to upgrade to a full PINES card in order to check out library books and other materials, please bring your e-card account number and your photo ID to the library's circulation desk to complete the registration process.

+
+ +
+

Welcome to PINES!

+

Please fill out the form below to register for a PINES e-card. An e-card provides immediate access to your library's online resources.

+ +

If you'd like to upgrade to a full PINES card in order to check out library books and other materials, please bring your e-card account number and your photo ID to any PINES library to complete the registration process. If you have any questions, please call your local library for assistance.

+
+ +
+ + + + + +
+ +
+ [%- END %] -- 2.43.2