JBAS-1132 Self-register SQL / IDL
authorBill Erickson <berickxx@gmail.com>
Mon, 14 Mar 2016 14:32:30 +0000 (10:32 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
* Adds card_style and ident_value2 columns
* Creates org setting opac.self_register.profile
* Sets values for org settings opac.self_register.profile,
  opac.allow_pending_user, and ui.patron.edit.au.ident_value2.show
* Modifies address IDL labels

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/sql/schema/deploy/patron-self-reg-mods.sql [new file with mode: 0644]
KCLS/sql/schema/revert/patron-self-reg-mods.sql [new file with mode: 0644]
KCLS/sql/schema/sqitch.plan
KCLS/sql/schema/verify/patron-self-reg-mods.sql [new file with mode: 0644]
Open-ILS/examples/fm_IDL.xml

diff --git a/KCLS/sql/schema/deploy/patron-self-reg-mods.sql b/KCLS/sql/schema/deploy/patron-self-reg-mods.sql
new file mode 100644 (file)
index 0000000..ecb4415
--- /dev/null
@@ -0,0 +1,42 @@
+-- Deploy kcls-evergreen:patron-self-reg-mods to pg
+-- requires: blanket-po-print-template
+
+BEGIN;
+
+-- 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'
+);
+
+-- Insert data if needed
+DO $$
+BEGIN
+    IF evergreen.insert_on_deploy() THEN
+
+        -- Online Registration
+        INSERT INTO actor.org_unit_setting (org_unit, name, value) 
+            VALUES (1, 'opac.self_register.profile', '26');
+
+        -- Enable self-registration
+        INSERT INTO actor.org_unit_setting (org_unit, name, value) 
+            VALUES (1, 'opac.allow_pending_user', 'true');
+
+        INSERT INTO actor.org_unit_setting (org_unit, name, value) 
+            VALUES (1, 'ui.patron.edit.au.ident_value2.show', 'true');
+    END IF;
+
+END $$;
+
+
+COMMIT;
+
diff --git a/KCLS/sql/schema/revert/patron-self-reg-mods.sql b/KCLS/sql/schema/revert/patron-self-reg-mods.sql
new file mode 100644 (file)
index 0000000..086c895
--- /dev/null
@@ -0,0 +1,30 @@
+-- Revert kcls-evergreen:patron-self-reg-mods from pg
+
+BEGIN;
+
+DELETE FROM actor.org_unit_setting 
+    WHERE name = 'opac.self_register.profile';
+
+DELETE FROM config.org_unit_setting_type_log
+    WHERE field_name = 'opac.self_register.profile';
+
+DELETE FROM actor.org_unit_setting 
+    WHERE name = 'opac.allow_pending_user';
+
+DELETE FROM config.org_unit_setting_type_log
+    WHERE field_name = 'opac.allow_pending_user';
+
+DELETE FROM actor.org_unit_setting 
+    WHERE name = 'ui.patron.edit.au.ident_value2.show';
+
+DELETE FROM config.org_unit_setting_type_log
+    WHERE field_name = 'ui.patron.edit.au.ident_value2.show';
+
+DELETE FROM config.org_unit_setting_type 
+    WHERE name = 'opac.self_register.profile'; 
+
+ALTER TABLE staging.user_stage 
+    DROP COLUMN ident_value2,
+    DROP COLUMN card_style;
+
+COMMIT;
index efabe8e..20eeff7 100644 (file)
@@ -19,3 +19,4 @@ dob-as-date [student-groups] 2015-10-05T14:17:54Z Bill Erickson <berickxx@gmail.
 2.5-to-2.7-upgrade [student-groups] 2015-10-15T20:40:14Z Bill Erickson <berickxx@gmail.com> # 2.5 to 2.7 Upgrade
 subject-browse-entry-dashes [2.5-to-2.7-upgrade] 2016-02-11T20:12:05Z Bill Erickson <berickxx@gmail.com> # Clean up subject browse dashes
 2.7-auth-reingest [2.5-to-2.7-upgrade] 2015-12-30T16:25:38Z Bill Erickson <berickxx@gmail.com> # Reingest authority records after 2.7 update
+patron-self-reg-mods [blanket-po-print-template] 2016-01-13T20:14:00Z Bill Erickson <berickxx@gmail.com> # Patron self-reg customizations
diff --git a/KCLS/sql/schema/verify/patron-self-reg-mods.sql b/KCLS/sql/schema/verify/patron-self-reg-mods.sql
new file mode 100644 (file)
index 0000000..9924852
--- /dev/null
@@ -0,0 +1,28 @@
+-- Verify kcls-evergreen:patron-self-reg-mods on pg
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+SELECT 1 / COUNT(*) FROM config.org_unit_setting_type 
+    WHERE name = 'opac.self_register.profile'; 
+
+SELECT ident_value2 FROM staging.user_stage LIMIT 1;
+
+-- Test inserted data if needed
+DO $$
+BEGIN
+    IF evergreen.insert_on_deploy() THEN
+        PERFORM 1 / COUNT(*) FROM actor.org_unit_setting
+            WHERE name = 'opac.self_register.profile';
+
+        PERFORM 1 / COUNT(*) FROM actor.org_unit_setting
+            WHERE name = 'opac.allow_pending_user';
+
+        PERFORM 1 / COUNT(*) FROM actor.org_unit_setting
+            WHERE name = 'ui.patron.edit.au.ident_value2.show';
+    END IF;
+
+END $$;
+
+ROLLBACK;
index 231a244..5680003 100644 (file)
@@ -10712,6 +10712,8 @@ SELECT  usr,
                                                <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
                                                <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"/>
         </fields>
         <links>
             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
@@ -10728,7 +10730,7 @@ SELECT  usr,
         </fields>
     </class>
 
-    <class id="stgma" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::mailing_address_stage" oils_persist:tablename="staging.mailing_address_stage" reporter:label="Mailing Address Stage">
+    <class id="stgma" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::mailing_address_stage" oils_persist:tablename="staging.mailing_address_stage" reporter:label="Mailing Addr">
         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
@@ -10744,7 +10746,7 @@ SELECT  usr,
         </fields>
     </class>
 
-    <class id="stgba" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::billing_address_stage" oils_persist:tablename="staging.billing_address_stage" reporter:label="Billing Address Stage">
+    <class id="stgba" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::billing_address_stage" oils_persist:tablename="staging.billing_address_stage" reporter:label="Residential Addr">
         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>