[open-ils-commits] [GIT] Evergreen ILS branch master updated. b67ebdb624479fdce8196465b451df14b9ac4f4d
Evergreen Git
git at git.evergreen-ils.org
Tue May 24 22:34:23 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, master has been updated
via b67ebdb624479fdce8196465b451df14b9ac4f4d (commit)
via 62e75063ded3061c9c1ad49c346ed13a8ae3d12b (commit)
via 047e3586f757038e8e0c29b9d78f8191ae9d1683 (commit)
from c58587837f40948650c71823818b60c5239ef5d9 (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 b67ebdb624479fdce8196465b451df14b9ac4f4d
Merge: 62e7506 c585878
Author: Dan Scott <dan at coffeecode.net>
Date: Tue May 24 22:33:44 2011 -0400
Merge branch 'master' of git.evergreen-ils.org:Evergreen into user/dbs/lp-787150-ws
commit 62e75063ded3061c9c1ad49c346ed13a8ae3d12b
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 f335713..735cc64 100644
--- a/Open-ILS/src/sql/Pg/040.schema.asset.sql
+++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql
@@ -201,7 +201,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 047e3586f757038e8e0c29b9d78f8191ae9d1683
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 1b9890e..ebb1cf1 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,7 @@ CREATE TRIGGER no_overlapping_deps
BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0540', :eg_version); -- dbwells
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0541', :eg_version); -- 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 3e46a19..f335713 100644
--- a/Open-ILS/src/sql/Pg/040.schema.asset.sql
+++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql
@@ -200,14 +200,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;
@@ -337,7 +339,7 @@ CREATE TABLE asset.call_number (
deleted BOOL NOT NULL DEFAULT FALSE,
prefix INT NOT NULL DEFAULT -1 REFERENCES asset.call_number_prefix(id) DEFERRABLE INITIALLY DEFERRED,
suffix INT NOT NULL DEFAULT -1 REFERENCES asset.call_number_suffix(id) DEFERRABLE INITIALLY DEFERRED,
- 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