[open-ils-commits] r16490 - in trunk/Open-ILS: examples src/sql/Pg src/sql/Pg/upgrade (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon May 24 16:08:25 EDT 2010
Author: miker
Date: 2010-05-24 16:08:20 -0400 (Mon, 24 May 2010)
New Revision: 16490
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0275.schema.settings_groups.sql
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
Log:
add settings group table, shared between org and usr settings, for labeling groups of settings
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2010-05-24 18:52:02 UTC (rev 16489)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-05-24 20:08:20 UTC (rev 16490)
@@ -1964,6 +1964,21 @@
</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 @@
<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 @@
<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>
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-05-24 18:52:02 UTC (rev 16489)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-05-24 20:08:20 UTC (rev 16490)
@@ -65,7 +65,7 @@
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 @@
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 @@
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,
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0275.schema.settings_groups.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0275.schema.settings_groups.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0275.schema.settings_groups.sql 2010-05-24 20:08:20 UTC (rev 16490)
@@ -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;
+
More information about the open-ils-commits
mailing list