From ae0e26ed0862b3694415806ce2dc05e128868c24 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 10 Apr 2012 15:41:51 -0400 Subject: [PATCH] DB seed data for CAPTURE and FULFILL penalty blocks All occurrences of HOLD in the block list for any existing penalties are updated to HOLD|CAPTURE|FULFILL for backwards compatibility, minus the handful of STAFF_* penalties whose codes match their respective block_lists. To use these new block types, simply update existing penalties as desired or add new local pentalty types for staff-managed patron blocking messages. Signed-off-by: Bill Erickson Signed-off-by: Jason Stephenson Signed-off-by: Mike Rylander --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 6 +++--- .../sql/Pg/upgrade/XXXX.data.hold_cap_fill_penalty_blocks.sql | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.hold_cap_fill_penalty_blocks.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 312a425a1e..0c0744c879 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -20,13 +20,13 @@ INSERT INTO config.standing (id, value) VALUES (2, oils_i18n_gettext(2, 'Barred' SELECT SETVAL('config.standing_id_seq'::TEXT, 100); INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert) - VALUES (1,'PATRON_EXCEEDS_FINES',oils_i18n_gettext(1, 'Patron exceeds fine threshold', 'csp', 'label'),'CIRC|HOLD|RENEW', TRUE); + VALUES (1,'PATRON_EXCEEDS_FINES',oils_i18n_gettext(1, 'Patron exceeds fine threshold', 'csp', 'label'),'CIRC|HOLD|CAPTURE|FULFILL|RENEW', TRUE); INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert) - VALUES (2,'PATRON_EXCEEDS_OVERDUE_COUNT',oils_i18n_gettext(2, 'Patron exceeds max overdue item threshold', 'csp', 'label'),'CIRC|HOLD|RENEW', TRUE); + VALUES (2,'PATRON_EXCEEDS_OVERDUE_COUNT',oils_i18n_gettext(2, 'Patron exceeds max overdue item threshold', 'csp', 'label'),'CIRC|HOLD|CAPTURE|FULFILL|RENEW', TRUE); INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert) VALUES (3,'PATRON_EXCEEDS_CHECKOUT_COUNT',oils_i18n_gettext(3, 'Patron exceeds max checked out item threshold', 'csp', 'label'),'CIRC', TRUE); INSERT INTO config.standing_penalty (id,name,label,block_list,staff_alert) - VALUES (4,'PATRON_EXCEEDS_COLLECTIONS_WARNING',oils_i18n_gettext(4, 'Patron exceeds pre-collections warning fine threshold', 'csp', 'label'),'CIRC|HOLD|RENEW', TRUE); + VALUES (4,'PATRON_EXCEEDS_COLLECTIONS_WARNING',oils_i18n_gettext(4, 'Patron exceeds pre-collections warning fine threshold', 'csp', 'label'),'CIRC|HOLD|CAPTURE|FULFILL|RENEW', TRUE); INSERT INTO config.standing_penalty (id,name,label,staff_alert) VALUES (20,'ALERT_NOTE',oils_i18n_gettext(20, 'Alerting Note, no blocks', 'csp', 'label'),TRUE); INSERT INTO config.standing_penalty (id,name,label) VALUES (21,'SILENT_NOTE',oils_i18n_gettext(21, 'Note, no blocks', 'csp', 'label')); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.hold_cap_fill_penalty_blocks.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.hold_cap_fill_penalty_blocks.sql new file mode 100644 index 0000000000..b2c25c3c73 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.hold_cap_fill_penalty_blocks.sql @@ -0,0 +1,11 @@ + + +UPDATE config.standing_penalty + SET block_list = REPLACE(block_list, 'HOLD', 'HOLD|CAPTURE|FULFILL') + WHERE + -- STAFF_ penalties have names that match their block list + name NOT LIKE 'STAFF_%' + -- belt & suspenders, also good for testing + AND block_list NOT LIKE '%CAPTURE%' + AND block_list NOT LIKE '%FULFILL%'; + -- 2.11.0