From c1e15c765c5fa1b2b8e949f27ade5ce0ab5c8e7f Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Thu, 10 Mar 2016 21:13:57 -0500 Subject: [PATCH] LP 1507807: Add org unit settings for in-house-use copy alerts. Add circ.in_house_use.copy_alert and circ.in_house_use.checkin_alert org. unit setting types to seed data and upgrade script. No default values are provided for the new settings. They are not defined (i.e. off) by default. Add a PgTap test to verify that the org. unit setting types exist in the database. See the release notes for what these settings do. Signed-off-by: Jason Stephenson Conflicts: Open-ILS/src/sql/Pg/950.data.seed-values.sql --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 37 ++++++++++++++++++++++ .../src/sql/Pg/t/lp1507807_in-house-use_alerts.pg | 21 ++++++++++++ .../upgrade/XXXX.data.in-house-use_copy_alert.sql | 27 ++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/t/lp1507807_in-house-use_alerts.pg create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.in-house-use_copy_alert.sql diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index ee87ff59f5..b6ca49d619 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -14732,3 +14732,40 @@ INSERT INTO config.org_unit_setting_type 'coust', 'description'), 'bool'); +INSERT INTO config.org_unit_setting_type + (name, grp, label, description, datatype) + VALUES + ('org.restrict_opt_to_depth', + 'sec', + oils_i18n_gettext('org.restrict_opt_to_depth', + 'Restrict patron opt-in to home library and related orgs at specified depth', + 'coust', 'label'), + oils_i18n_gettext('org.restrict_opt_to_depth', + 'Patrons at this library can only be opted-in at org units which are within the '|| + 'library''s section of the org tree, at or below the depth specified by this setting. '|| + 'They cannot be opted in at any other libraries.', + 'coust', 'description'), + 'integer'); + +INSERT INTO config.org_unit_setting_type + (name, grp, label, description, datatype) + VALUES + ('circ.in_house_use.copy_alert', + 'circ', + oils_i18n_gettext('circ.in_house_use.copy_alert', + 'Display copy alert for in-house-use', + 'coust', 'label'), + oils_i18n_gettext('circ.in_house_use.copy_alert', + 'Display copy alert for in-house-use', + 'coust', 'description'), + 'bool'), + ('circ.in_house_use.checkin_alert', + 'circ', + oils_i18n_gettext('circ.in_house_use.checkin_alert', + 'Display copy location checkin alert for in-house-use', + 'coust', 'label'), + oils_i18n_gettext('circ.in_house_use.checkin_alert', + 'Display copy location checkin alert for in-house-use', + 'coust', 'description'), + 'bool'); + diff --git a/Open-ILS/src/sql/Pg/t/lp1507807_in-house-use_alerts.pg b/Open-ILS/src/sql/Pg/t/lp1507807_in-house-use_alerts.pg new file mode 100644 index 0000000000..8d6f35141c --- /dev/null +++ b/Open-ILS/src/sql/Pg/t/lp1507807_in-house-use_alerts.pg @@ -0,0 +1,21 @@ +-- Load the TAP functions. +BEGIN; + +-- Plan the tests. +SELECT plan(2); + +-- Run the tests. + +SELECT isnt_empty( + 'SELECT * FROM config.org_unit_setting_type WHERE name = $$circ.in_house_use.copy_alert$$', + 'circ.in_house_use.copy_alert exists' +); + +SELECT isnt_empty( + 'SELECT * FROM config.org_unit_setting_type WHERE name = $$circ.in_house_use.checkin_alert$$', + 'circ.in_house_use.checkin_alert exists' +); + +-- Finish the tests and clean up. +SELECT * FROM finish(); +ROLLBACK; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.in-house-use_copy_alert.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.in-house-use_copy_alert.sql new file mode 100644 index 0000000000..ea5364c7b9 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.in-house-use_copy_alert.sql @@ -0,0 +1,27 @@ +BEGIN; + +--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +INSERT INTO config.org_unit_setting_type + (name, grp, label, description, datatype) + VALUES + ('circ.in_house_use.copy_alert', + 'circ', + oils_i18n_gettext('circ.in_house_use.copy_alert', + 'Display copy alert for in-house-use', + 'coust', 'label'), + oils_i18n_gettext('circ.in_house_use.copy_alert', + 'Display copy alert for in-house-use', + 'coust', 'description'), + 'bool'), + ('circ.in_house_use.checkin_alert', + 'circ', + oils_i18n_gettext('circ.in_house_use.checkin_alert', + 'Display copy location checkin alert for in-house-use', + 'coust', 'label'), + oils_i18n_gettext('circ.in_house_use.checkin_alert', + 'Display copy location checkin alert for in-house-use', + 'coust', 'description'), + 'bool'); + +COMMIT; -- 2.11.0