From aef36e2832027ba8db694259b58dd189c5336a9d Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 21 Sep 2010 16:19:04 +0000 Subject: [PATCH] HoldIsCancelled action_trigger validator git-svn-id: svn://svn.open-ils.org/ILS/trunk@17867 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Trigger/Validator.pm | 9 +++++++++ Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql | 10 ++++++++++ Open-ILS/src/sql/Pg/950.data.seed-values.sql | 13 +++++++++++++ .../0412.data.trigger.validator.HoldIsCancelled.sql | 16 ++++++++++++++++ 5 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0412.data.trigger.validator.HoldIsCancelled.sql diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm index 206ac102a..260af53de 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm @@ -82,4 +82,13 @@ sub HoldIsAvailable { return 0; } +sub HoldIsCancelled { + my $self = shift; + my $env = shift; + + my $hold = $env->{target}; + + return ($hold->cancel_time) ? 1 : 0; +} + 1; diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index bfb4fb781..fca4b6ba4 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -70,7 +70,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0411'); -- gmc +INSERT INTO config.upgrade_log (version) VALUES ('0412'); -- phasefx CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql b/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql index 637c58b2b..35c8cc402 100644 --- a/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql +++ b/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql @@ -4619,6 +4619,16 @@ INSERT INTO action_trigger.environment ( (35, 'pickup_lib') ; +INSERT INTO action_trigger.validator (module, description) VALUES ( + 'HoldIsCancelled', + oils_i18n_gettext( + 'HoldIsCancelled', + 'Check whether a hold request is cancelled.', + 'atval', + 'description' + ) +); + -- Create the query schema, and the tables and views therein DROP SCHEMA IF EXISTS sql CASCADE; 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 f9458d1d8..ff139a221 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -6998,3 +6998,16 @@ INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) 'bool' ); +-- 0412.data.trigger.validator.HoldIsCancelled.sql + +INSERT INTO action_trigger.validator (module, description) VALUES ( + 'HoldIsCancelled', + oils_i18n_gettext( + 'HoldIsCancelled', + 'Check whether a hold request is cancelled.', + 'atval', + 'description' + ) +); + + diff --git a/Open-ILS/src/sql/Pg/upgrade/0412.data.trigger.validator.HoldIsCancelled.sql b/Open-ILS/src/sql/Pg/upgrade/0412.data.trigger.validator.HoldIsCancelled.sql new file mode 100644 index 000000000..0054e3314 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0412.data.trigger.validator.HoldIsCancelled.sql @@ -0,0 +1,16 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0412'); -- phasefx + +INSERT INTO action_trigger.validator (module, description) VALUES ( + 'HoldIsCancelled', + oils_i18n_gettext( + 'HoldIsCancelled', + 'Check whether a hold request is cancelled.', + 'atval', + 'description' + ) +); + +COMMIT; + -- 2.11.0