add settings group table, shared between org and usr settings, for labeling groups...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 24 May 2010 20:08:20 +0000 (20:08 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 24 May 2010 20:08:20 +0000 (20:08 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16490 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0275.schema.settings_groups.sql [new file with mode: 0644]

index 9501ad9..2992e75 100644 (file)
@@ -1964,6 +1964,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                </links>
        </class>
 
+       <class id="csg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::settings_group" oils_persist:tablename="config.settings_group" reporter:label="Settings Group">
+               <fields oils_persist:primary="name">
+                       <field name="name" reporter:datatype="text"/>
+                       <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
+               </fields>
+               <links/>
+               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+                       <actions>
+                               <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
+                               <retrieve/>
+                               <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
+                               <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
+                       </actions>
+               </permacrud>
+       </class>
        <class id="cust" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::usr_setting_type" oils_persist:tablename="config.usr_setting_type" reporter:label="User Setting Type">
                <fields oils_persist:primary="name">
                        <field name="name" reporter:datatype="text"/>
@@ -1971,9 +1986,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field name="description" reporter:datatype="text"/>
                        <field name="datatype" reporter:datatype="text"/>
                        <field name="fm_class" reporter:datatype="text"/>
+                       <field name="grp" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="name" reltype="has_many" key="name" map="" class="aus"/>
+                       <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
                </links>
                <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
                        <actions>
@@ -1993,11 +2010,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field name="view_perm" reporter:datatype="link"/>
                        <field name="update_perm" reporter:datatype="link"/>
                        <field name="fm_class" reporter:datatype="text"/>
+                       <field name="grp" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="name" reltype="has_many" key="name" map="" class="aous"/>
                        <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
                        <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
+                       <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
                </links>
                <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
                        <actions>
index 10dfe7b..0b38ed8 100644 (file)
@@ -65,7 +65,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0274'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0275'); -- miker
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
@@ -652,9 +652,15 @@ CREATE TABLE config.billing_type (
     CONSTRAINT billing_type_once_per_lib UNIQUE (name, owner)
 );
 
+CREATE TABLE config.settings_group (
+    name    TEXT PRIMARY KEY,
+    label   TEXT UNIQUE NOT NULL -- I18N
+);
+
 CREATE TABLE config.org_unit_setting_type (
     name            TEXT    PRIMARY KEY,
     label           TEXT    UNIQUE NOT NULL,
+    grp             TEXT    REFERENCES config.settings_group (name),
     description     TEXT,
     datatype        TEXT    NOT NULL DEFAULT 'string',
     fm_class        TEXT,
@@ -680,6 +686,7 @@ CREATE TABLE config.usr_setting_type (
     opac_visible BOOL NOT NULL DEFAULT FALSE,
     label TEXT UNIQUE NOT NULL,
     description TEXT,
+    grp             TEXT    REFERENCES config.settings_group (name),
     datatype TEXT NOT NULL DEFAULT 'string',
     fm_class TEXT,
 
diff --git a/Open-ILS/src/sql/Pg/upgrade/0275.schema.settings_groups.sql b/Open-ILS/src/sql/Pg/upgrade/0275.schema.settings_groups.sql
new file mode 100644 (file)
index 0000000..4244deb
--- /dev/null
@@ -0,0 +1,17 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0275'); -- miker
+
+CREATE TABLE config.settings_group (
+  name     text primary key,
+  label    text not null unique
+);
+ALTER TABLE config.org_unit_setting_type
+  ADD COLUMN grp TEXT REFERENCES config.settings_group (name);
+ALTER TABLE config.usr_setting_type
+  ADD COLUMN grp TEXT REFERENCES config.settings_group (name);
+
+COMMIT;
+