LP 1507807: Add org unit settings for in-house-use copy alerts.
authorJason Stephenson <jason@sigio.com>
Fri, 11 Mar 2016 02:13:57 +0000 (21:13 -0500)
committerKathy Lussier <klussier@masslnc.org>
Tue, 14 Feb 2017 05:05:52 +0000 (00:05 -0500)
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 <jason@sigio.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>

Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/t/lp1507807_in-house-use_alerts.pg [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.data.in-house-use_copy_alert.sql [new file with mode: 0644]

index 52ac033..56408b2 100644 (file)
@@ -16476,3 +16476,25 @@ INSERT INTO action_trigger.environment (
     currval('action_trigger.event_definition_id_seq'),
     'circ_lib'
 );
+
+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 (file)
index 0000000..8d6f351
--- /dev/null
@@ -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 (file)
index 0000000..ea5364c
--- /dev/null
@@ -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;