[open-ils-commits] [GIT] Evergreen ILS branch rel_2_0 updated. 415ebd8a051f9dd40cfb27c677d951803d872a31

Evergreen Git git at git.evergreen-ils.org
Tue May 24 23:24:12 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_0 has been updated
       via  415ebd8a051f9dd40cfb27c677d951803d872a31 (commit)
       via  4c69d35d3a6681abaaf4c68ffc25ee876ffccd47 (commit)
       via  baa93a8b3c0b3f6a9148ca0b2533d808667f57ae (commit)
      from  36a6e7a9930af4e5830b8f34d28dd75294b78da8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 415ebd8a051f9dd40cfb27c677d951803d872a31
Author: Dan Scott <dan at coffeecode.net>
Date:   Tue May 24 23:20:40 2011 -0400

    Use the right upgrade log format for 2.0 upgrade
    
    Signed-off-by: Dan Scott <dan at coffeecode.net>

diff --git a/Open-ILS/src/sql/Pg/upgrade/0541.schema.call_number_honor_default_class.sql b/Open-ILS/src/sql/Pg/upgrade/0541.schema.call_number_honor_default_class.sql
index 9b6f5c9..47afb5d 100644
--- a/Open-ILS/src/sql/Pg/upgrade/0541.schema.call_number_honor_default_class.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0541.schema.call_number_honor_default_class.sql
@@ -1,6 +1,6 @@
 BEGIN;
 
-SELECT evergreen.upgrade_deps_block_check('0541', :eg_version); -- dbwells
+INSERT INTO config.upgrade_log (version) VALUES ('0541'); -- dbwells
 
 ALTER TABLE asset.call_number ALTER COLUMN label_class DROP DEFAULT;
 

commit 4c69d35d3a6681abaaf4c68ffc25ee876ffccd47
Author: Dan Scott <dan at coffeecode.net>
Date:   Tue May 24 21:56:13 2011 -0400

    Trivial line-wrapping patch for call number class defaults
    
    Signed-off-by: Dan Scott <dan at coffeecode.net>

diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql
index 6f76ee3..acfa065 100644
--- a/Open-ILS/src/sql/Pg/040.schema.asset.sql
+++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql
@@ -191,7 +191,14 @@ BEGIN
     sortkey := NEW.label_sortkey;
 
     IF NEW.label_class IS NULL THEN
-        NEW.label_class := COALESCE( (SELECT substring(value from E'\\d+')::integer from actor.org_unit_setting WHERE name = 'cat.default_classification_scheme' AND org_unit = NEW.owning_lib), 1 );
+            NEW.label_class := COALESCE(
+            (
+                SELECT substring(value from E'\\d+')::integer
+                FROM actor.org_unit_setting
+                WHERE name = 'cat.default_classification_scheme'
+                AND org_unit = NEW.owning_lib
+            ), 1
+        );
     END IF;
 
     EXECUTE 'SELECT ' || acnc.normalizer || '(' || 
diff --git a/Open-ILS/src/sql/Pg/upgrade/0541.schema.call_number_honor_default_class.sql b/Open-ILS/src/sql/Pg/upgrade/0541.schema.call_number_honor_default_class.sql
index 32be6a3..9b6f5c9 100644
--- a/Open-ILS/src/sql/Pg/upgrade/0541.schema.call_number_honor_default_class.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0541.schema.call_number_honor_default_class.sql
@@ -11,7 +11,14 @@ BEGIN
     sortkey := NEW.label_sortkey;
 
     IF NEW.label_class IS NULL THEN
-        NEW.label_class := COALESCE( (SELECT substring(value from E'\\d+')::integer from actor.org_unit_setting WHERE name = 'cat.default_classification_scheme' AND org_unit = NEW.owning_lib), 1);
+        NEW.label_class := COALESCE(
+            (
+                SELECT substring(value from E'\\d+')::integer
+                FROM actor.org_unit_setting
+                WHERE name = 'cat.default_classification_scheme'
+                AND org_unit = NEW.owning_lib
+            ), 1
+        );
     END IF;
 
     EXECUTE 'SELECT ' || acnc.normalizer || '(' ||

commit baa93a8b3c0b3f6a9148ca0b2533d808667f57ae
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Tue May 24 10:53:09 2011 -0400

    Make label_class on any new call numbers default to org_unit setting
    
    Evergreen 2.0 added a label_class column to the call number table with
    one major purpose being the generation of correct sort keys. You can
    also specify a default label class as an org unit setting. However:
    
    1) There are no interface elements for setting the label class of an
    individual call number.
    
    2) The default setting from the actor.org_unit_setting
    'cat.default_classification_scheme' value, if set, is not consulted
    (that is, not set in the call number table) when new call numbers are
    created.
    
    These two facts together greatly reduce the utility of this very
    valuable feature, as all new call numbers end up in the 'Generic' class.
    
    While #1 has been addressed in 2.1+, there is still work to be done in
    setting this class on import. Also, which interface parts (if any) make
    it back to 2.0 is subject to debate.
    
    This commit addresses #2.
    
    See lp #787150.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Dan Scott <dan at coffeecode.net>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 316c23d..a3e0738 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -57,7 +57,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0540'); -- dbwells
+INSERT INTO config.upgrade_log (version) VALUES ('0541'); -- dbwells
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql
index 4d4f0d9..6f76ee3 100644
--- a/Open-ILS/src/sql/Pg/040.schema.asset.sql
+++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql
@@ -190,14 +190,16 @@ DECLARE
 BEGIN
     sortkey := NEW.label_sortkey;
 
+    IF NEW.label_class IS NULL THEN
+        NEW.label_class := COALESCE( (SELECT substring(value from E'\\d+')::integer from actor.org_unit_setting WHERE name = 'cat.default_classification_scheme' AND org_unit = NEW.owning_lib), 1 );
+    END IF;
+
     EXECUTE 'SELECT ' || acnc.normalizer || '(' || 
        quote_literal( NEW.label ) || ')'
        FROM asset.call_number_class acnc
        WHERE acnc.id = NEW.label_class
        INTO sortkey;
-
     NEW.label_sortkey = sortkey;
-
     RETURN NEW;
 END;
 $func$ LANGUAGE PLPGSQL;
@@ -289,7 +291,7 @@ CREATE TABLE asset.call_number (
 	owning_lib	INT				NOT NULL,
 	label		TEXT				NOT NULL,
 	deleted		BOOL				NOT NULL DEFAULT FALSE,
-	label_class	BIGINT				DEFAULT 1 NOT NULL
+	label_class	BIGINT				NOT NULL
 							REFERENCES asset.call_number_class(id)
 							DEFERRABLE INITIALLY DEFERRED,
 	label_sortkey	TEXT
diff --git a/Open-ILS/src/sql/Pg/upgrade/0541.schema.call_number_honor_default_class.sql b/Open-ILS/src/sql/Pg/upgrade/0541.schema.call_number_honor_default_class.sql
new file mode 100644
index 0000000..32be6a3
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0541.schema.call_number_honor_default_class.sql
@@ -0,0 +1,27 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0541', :eg_version); -- dbwells
+
+ALTER TABLE asset.call_number ALTER COLUMN label_class DROP DEFAULT;
+
+CREATE OR REPLACE FUNCTION asset.label_normalizer() RETURNS TRIGGER AS $func$
+DECLARE
+    sortkey        TEXT := '';
+BEGIN
+    sortkey := NEW.label_sortkey;
+
+    IF NEW.label_class IS NULL THEN
+        NEW.label_class := COALESCE( (SELECT substring(value from E'\\d+')::integer from actor.org_unit_setting WHERE name = 'cat.default_classification_scheme' AND org_unit = NEW.owning_lib), 1);
+    END IF;
+
+    EXECUTE 'SELECT ' || acnc.normalizer || '(' ||
+       quote_literal( NEW.label ) || ')'
+       FROM asset.call_number_class acnc
+       WHERE acnc.id = NEW.label_class
+       INTO sortkey;
+    NEW.label_sortkey = sortkey;
+    RETURN NEW;
+END;
+$func$ LANGUAGE PLPGSQL;
+
+COMMIT;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/040.schema.asset.sql           |   15 +++++++--
 ...0541.schema.call_number_honor_default_class.sql |   34 ++++++++++++++++++++
 3 files changed, 47 insertions(+), 4 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0541.schema.call_number_honor_default_class.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list