From 97b3335282973d0577a521d1415b079ec88671ff Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 1 Aug 2013 13:30:52 -0400 Subject: [PATCH] LP1207396 DB / IDL for patron self-reg Updating pending addr tables to track requesting user and address county. Adding org settings: * opac.allow_pending_user -- allow self-registration * opac.pending_user_expire_interval - delete pending user interval * ui.patron.edit.aua.county.require - indicate if county is required Signed-off-by: Bill Erickson Signed-off-by: Dan Wells --- Open-ILS/examples/fm_IDL.xml | 6 ++ Open-ILS/src/sql/Pg/015.schema.staging.sql | 10 ++- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 54 +++++++++++++ .../upgrade/XXXX.schema.patron-self-reg.sql | 75 +++++++++++++++++++ 4 files changed, 141 insertions(+), 4 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.patron-self-reg.sql diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index d2703414eb..656f1d1c52 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -8956,7 +8956,11 @@ SELECT usr, + + + + @@ -8977,6 +8981,7 @@ SELECT usr, + @@ -8992,6 +8997,7 @@ SELECT usr, + diff --git a/Open-ILS/src/sql/Pg/015.schema.staging.sql b/Open-ILS/src/sql/Pg/015.schema.staging.sql index 893650d10a..83bc697255 100644 --- a/Open-ILS/src/sql/Pg/015.schema.staging.sql +++ b/Open-ILS/src/sql/Pg/015.schema.staging.sql @@ -6,7 +6,7 @@ CREATE SCHEMA staging; CREATE TABLE staging.user_stage ( row_id BIGSERIAL PRIMARY KEY, - row_date TIMESTAMP WITH TIME ZONE DEFAULT NOW(), + row_date TIMESTAMP WITH TIME ZONE DEFAULT NOW(), usrname TEXT NOT NULL, profile TEXT, email TEXT, @@ -19,7 +19,8 @@ CREATE TABLE staging.user_stage ( evening_phone TEXT, home_ou INT DEFAULT 2, dob TEXT, - complete BOOL DEFAULT FALSE + complete BOOL DEFAULT FALSE, + requesting_usr INT REFERENCES actor.usr(id) ON DELETE SET NULL ); CREATE TABLE staging.card_stage ( -- for new library barcodes @@ -32,12 +33,13 @@ CREATE TABLE staging.card_stage ( -- for new library barcodes CREATE TABLE staging.mailing_address_stage ( row_id BIGSERIAL PRIMARY KEY, - row_date TIMESTAMP WITH TIME ZONE DEFAULT NOW(), + row_date TIMESTAMP WITH TIME ZONE DEFAULT NOW(), usrname TEXT NOT NULL, -- user's SIS barcode, for linking street1 TEXT, street2 TEXT, city TEXT NOT NULL DEFAULT '', - state TEXT NOT NULL DEFAULT 'OK', + county TEXT, + state TEXT, country TEXT NOT NULL DEFAULT 'US', post_code TEXT NOT NULL, complete BOOL DEFAULT FALSE diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 1f046df25d..ae8a119b89 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -13186,3 +13186,57 @@ INSERT INTO action_trigger.environment (event_def, path) VALUES (50, 'circ_lib.billing_address'), (50, 'target_copy.location'); +-- OUS's for patron self-reg +INSERT INTO config.org_unit_setting_type + (name, grp, datatype, label, description) +VALUES ( + 'opac.allow_pending_user', + 'opac', + 'bool', + oils_i18n_gettext( + 'opac.allow_pending_user', + 'Allow Patron Self-Registration', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'opac.allow_pending_user', + 'Allow patrons to self-register, creating pending user accounts', + 'coust', + 'description' + ) +), ( + 'opac.pending_user_expire_interval', + 'opac', + 'interval', + oils_i18n_gettext( + 'opac.pending_user_expire_interval', + 'Patron Self-Reg. Expire Interval', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'opac.pending_user_expire_interval', + 'If set, this is the amount of time a pending user account will ' || + 'be allowed to sit in the database. After this time, the pending ' || + 'user information will be purged', + 'coust', + 'description' + ) +), ( + 'ui.patron.edit.aua.county.show', + 'gui', + 'bool', + oils_i18n_gettext( + 'ui.patron.edit.aua.county.require', + 'Show count field on patron registration', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'ui.patron.edit.aua.county.require', + 'The county field will be shown on the patron registration screen', + 'coust', + 'description' + ) +); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.patron-self-reg.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.patron-self-reg.sql new file mode 100644 index 0000000000..9f6a574991 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.patron-self-reg.sql @@ -0,0 +1,75 @@ + +BEGIN; + +-- Track the requesting user +ALTER TABLE staging.user_stage + ADD COLUMN requesting_usr INTEGER + REFERENCES actor.usr(id) ON DELETE SET NULL; + +-- add county column to staged address tables and +-- drop state requirement to match actor.usr_address +ALTER TABLE staging.mailing_address_stage + ADD COLUMN county TEXT, + ALTER COLUMN state DROP DEFAULT, + ALTER COLUMN state DROP NOT NULL; + +ALTER TABLE staging.billing_address_stage + ADD COLUMN county TEXT, + ALTER COLUMN state DROP DEFAULT, + ALTER COLUMN state DROP NOT NULL; + +INSERT INTO config.org_unit_setting_type + (name, grp, datatype, label, description) +VALUES ( + 'opac.allow_pending_user', + 'opac', + 'bool', + oils_i18n_gettext( + 'opac.allow_pending_user', + 'Allow Patron Self-Registration', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'opac.allow_pending_user', + 'Allow patrons to self-register, creating pending user accounts', + 'coust', + 'description' + ) +), ( + 'opac.pending_user_expire_interval', + 'opac', + 'interval', + oils_i18n_gettext( + 'opac.pending_user_expire_interval', + 'Patron Self-Reg. Expire Interval', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'opac.pending_user_expire_interval', + 'If set, this is the amount of time a pending user account will ' || + 'be allowed to sit in the database. After this time, the pending ' || + 'user information will be purged', + 'coust', + 'description' + ) +), ( + 'ui.patron.edit.aua.county.show', + 'gui', + 'bool', + oils_i18n_gettext( + 'ui.patron.edit.aua.county.require', + 'Show count field on patron registration', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'ui.patron.edit.aua.county.require', + 'The county field will be shown on the patron registration screen', + 'coust', + 'description' + ) +); + +COMMIT; -- 2.43.2