LP 1694058: Add org. unit setting for multiple hold placement.
authorJason Stephenson <jason@sigio.com>
Sun, 30 Jul 2017 19:52:25 +0000 (15:52 -0400)
committerKathy Lussier <klussier@masslnc.org>
Wed, 21 Feb 2018 21:56:11 +0000 (16:56 -0500)
Add config.org_unit_setting_type circ.hold.max_duplicate_holds to set
the maximum duplicate title or metarecord holds allowed per patron.

Add pgtap test to make sure the new setting exists.

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/lp1694058_multiple_hold_placement.pg [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.data.max_duplicate_holds_coust.sql [new file with mode: 0644]

index 03f992f..e4379df 100644 (file)
@@ -5243,6 +5243,16 @@ INSERT into config.org_unit_setting_type
       'In the Patron Bills interface, a payment attempt will warn if the amount exceeds the value of this setting.',
       'coust', 'description'),
     'currency', null)
+,( 'circ.holds.max_duplicate_holds', 'holds',
+   oils_i18n_gettext(
+     'circ.holds.max_duplicate_holds',
+     'Maximum number of duplicate holds allowed.',
+     'coust', 'label'),
+   oils_i18n_gettext(
+     'circ.holds.max_duplicate_holds',
+     'Maximum number of duplicate title or metarecord holds allowed per patron.',
+     'coust', 'description'),
+   'integer', null)
 ;
 
 UPDATE config.org_unit_setting_type
diff --git a/Open-ILS/src/sql/Pg/t/lp1694058_multiple_hold_placement.pg b/Open-ILS/src/sql/Pg/t/lp1694058_multiple_hold_placement.pg
new file mode 100644 (file)
index 0000000..6a65862
--- /dev/null
@@ -0,0 +1,13 @@
+BEGIN;
+
+SELECT plan(1);
+
+-- Check that config.org_unit_setting_type of circ.holds.max_duplicate_holds exists.
+SELECT isnt_empty(
+    'SELECT * FROM config.org_unit_setting_type WHERE name = $$circ.holds.max_duplicate_holds$$',
+    'config.org_unit_setting_type circ.holds.max_duplicate_holds exists'
+);
+
+SELECT * FROM finish();
+
+ROLLBACK;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.max_duplicate_holds_coust.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.max_duplicate_holds_coust.sql
new file mode 100644 (file)
index 0000000..93e4a4f
--- /dev/null
@@ -0,0 +1,20 @@
+BEGIN;
+
+-- INSERT INTO config.upgrade_log (version, applied_to) VALUES ('XXXX', :eg_version);
+
+-- Add the circ.holds.max_duplicate_holds org. unit setting type.
+INSERT into config.org_unit_setting_type
+( name, grp, label, description, datatype, fm_class )
+VALUES
+( 'circ.holds.max_duplicate_holds', 'holds',
+   oils_i18n_gettext(
+     'circ.holds.max_duplicate_holds',
+     'Maximum number of duplicate holds allowed.',
+     'coust', 'label'),
+   oils_i18n_gettext(
+     'circ.holds.max_duplicate_holds',
+     'Maximum number of duplicate title or metarecord holds allowed per patron.',
+     'coust', 'description'),
+   'integer', null );
+
+COMMIT;