wallet_cards = ['12man', 'blank', 'books', 'mirror'];
keychain_cards = ['keychain'];
-MACRO input_field(fclass, fname, label, type, css_class) BLOCK;
+MACRO input_field(fclass, fname, label, type, css_class, value) BLOCK;
field_path = fclass _ "." _ fname;
- value = ctx.register.values.$fclass.$fname;
+ value = ctx.register.values.$fclass.$fname || value;
type = type || 'text';
css_class = css_class || '';
%]
<div><img class="card-img" src="[% card_url _ ctype _ '.jpg' %]"/></div>
<div class="card-style-option">
<input [% IF loop.first %]id='first-wallet-card'[% END %]
- type="radio" name="stgu.card_style" value="[% ctype %]"/>
+ type="radio" name="stgsc.10" value="[% ctype %]"/>
</div>
</div>
[% END %]
<div><img class="card-img" src="[% card_url _ ctype _ '.jpg' %]"/></div>
<div class="card-style-option">
<input [% IF loop.first %]id='first-keychain-card'[% END %]
- type="radio" name="stgu.card_style" value="[% ctype %]"/>
+ type="radio" name="stgsc.10" value="[% ctype %]"/>
</div>
</div>
[% END %]
<div class="grid-clear"></div>
</li>
+ <li>
+ <label>Choose delivery method of your new library card:</label>
+ <div>
+ <ul>
+ <li>
+ <input type='radio' name='stgu.delivery_method'
+ value='Mail' checked='checked'/>
+ <label>Mail to me.</label>
+ </li>
+ <li>
+ <input type='radio' name='stgu.delivery_method'
+ value='Pick up'/>
+ <label>I will pick up at my home library</label>
+ </li>
+ </ul>
+ </div>
+ </li>
+
<li><h2>Your Information</h2></li>
<hr/>
-- parent/guardian
ALTER TABLE staging.user_stage
ADD COLUMN ident_value2 TEXT,
- ADD COLUMN card_style TEXT;
-
-INSERT INTO config.org_unit_setting_type
- (grp, name, datatype, fm_class, label, description)
-VALUES (
- 'circ',
- 'opac.self_register.profile',
- 'link', 'pgt',
- 'Patron Self-Reg. Default Profile',
- 'Permission group/profile used for self-register patrons'
-);
+ ADD COLUMN delivery_method TEXT;
-- Insert data if needed
DO $$
BEGIN
IF evergreen.insert_on_deploy() THEN
+ INSERT INTO config.org_unit_setting_type
+ (grp, name, datatype, fm_class, label, description)
+ VALUES (
+ 'circ',
+ 'opac.self_register.profile',
+ 'link', 'pgt',
+ 'Patron Self-Reg. Default Profile',
+ 'Permission group/profile used for self-register patrons'
+ );
+
-- Online Registration
INSERT INTO actor.org_unit_setting (org_unit, name, value)
VALUES (1, 'opac.self_register.profile', '26');
INSERT INTO actor.org_unit_setting (org_unit, name, value)
VALUES (1, 'ui.patron.edit.au.ident_value2.show', 'true');
+
+ INSERT INTO actor.stat_cat (id, owner, name)
+ VALUES (10, 1, 'Card Design (online)');
+
+ -- need to retain the ID since it's referenced in the code.
+ PERFORM SETVAL('biblio.peer_type_id_seq'::TEXT, 11);
+
END IF;
END $$;
BEGIN;
+DELETE FROM actor.stat_cat_entry_usr_map WHERE stat_cat = 10;
+DELETE FROM actor.stat_cat WHERE id = 10;
+
+-- need to retain the ID since it's referenced in the code.
+SELECT SETVAL('biblio.peer_type_id_seq'::TEXT, 10);
+
DELETE FROM actor.org_unit_setting
WHERE name = 'opac.self_register.profile';
ALTER TABLE staging.user_stage
DROP COLUMN ident_value2,
- DROP COLUMN card_style;
+ DROP COLUMN delivery_method;
COMMIT;
<field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
<field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text"/>
<field reporter:label="Parent/Guardian" name="ident_value2" reporter:datatype="text"/>
- <field reporter:label="Card Style" name="card_style" reporter:datatype="text"/>
+ <field reporter:label="Delivery" name="delivery_method" reporter:datatype="text"/>
</fields>
<links>
<link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
push(@$stat_cats, $stat_cat);
}
+ if (my $card_style = $cgi->param('stgsc.10')) {
+ my $stat_cat = Fieldmapper::staging::statcat_stage->new;
+ $stat_cat->statcat(10);
+ $stat_cat->value($card_style);
+ push(@$stat_cats, $stat_cat);
+ }
+
# Events mailing
$stat_cat = Fieldmapper::staging::statcat_stage->new;
$stat_cat->statcat(3);
var invalid_fields = {};
var is_juvenile = false;
var required_fields = [
- 'stgu.card_style',
+ 'stgsc.10',
'stgu.first_given_name',
'stgu.family_name',
'stgu.dob',
'stgba.street1',
'stgba.city',
'stgba.state',
- 'stgba.post_code',
+ 'stgba.post_code'
];
var last_activity = new Date();
break;
- case 'stgu.card_style':
- // be sure the user has selected a card style.
- // In this case dom_id is really a radio selector name.
- var styles = document.getElementsByName(dom_id);
- var checked = false;
- for (var i = 0; i < styles.length; i++) {
- if (styles[i].checked) {
- checked = true;
- break;
- }
- }
-
- if (checked) {
- valid = false;
- delete invalid_fields[dom_id];
- } else {
- invalid_fields[dom_id] = "Please select a card style."
- }
- break;
-
case 'stgba.street1':
if (value) {
delete invalid_fields[dom_id];
invalid_fields[dom_id] = "Please enter an address zip/post code";
}
break;
+
+ case 'stgsc.10':
+ // stgsc.10 == card type stat cat. Its values are represented
+ // across multiple values. Make sure at least one is selected.
+ var found = false;
+ var inputs = document.getElementsByTagName('input');
+ for (var i = 0; i < inputs.length; i++) {
+ var ipt = inputs[i];
+ var name = ipt.getAttribute('name');
+ if (name == 'stgsc.10' && ipt.checked) {
+ found = true;
+ break;
+ }
+ }
+
+ if (found) {
+ delete invalid_fields[dom_id];
+ } else {
+ invalid_fields[dom_id] = "Please select a card style."
+ }
+ break;
}
if (element) {