[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch master updated. 75817fabba07f84ca7f12f282b328f02a1f7be10

Evergreen Git git at git.evergreen-ils.org
Thu Sep 12 13:59:45 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  75817fabba07f84ca7f12f282b328f02a1f7be10 (commit)
       via  085fb6c9d84d3d114e004d860f75cf08f32a3e5d (commit)
       via  86db7176873b007313f25879779a7ff853e51298 (commit)
      from  5d546cc4f21c9ea9431f4530af28fa5e6ad631c6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 75817fabba07f84ca7f12f282b328f02a1f7be10
Author: Mike Rylander <mrylander at gmail.com>
Date:   Thu Sep 12 13:58:14 2013 -0400

    Stamping upgrade script for repeatable events
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 7649f6a..1654fb2 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -91,7 +91,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0826', :eg_version); -- phasefx/miker
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0827', :eg_version); -- rsteed/miker
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.action_trigger.event_definition.repeat_delay.sql b/Open-ILS/src/sql/Pg/upgrade/0827.schema.action_trigger.event_definition.repeat_delay.sql
similarity index 58%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.action_trigger.event_definition.repeat_delay.sql
rename to Open-ILS/src/sql/Pg/upgrade/0827.schema.action_trigger.event_definition.repeat_delay.sql
index f07a4dc..d3c9a53 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.action_trigger.event_definition.repeat_delay.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0827.schema.action_trigger.event_definition.repeat_delay.sql
@@ -1,6 +1,6 @@
 BEGIN;
 
---- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0827', :eg_version);
 
 ALTER TABLE action_trigger.event_definition ADD COLUMN repeat_delay INTERVAL;
 

commit 085fb6c9d84d3d114e004d860f75cf08f32a3e5d
Author: Remington Steed <rjs7 at calvin.edu>
Date:   Thu Sep 5 16:48:38 2013 -0400

    Release notes for Action Trigger Event Repeatability
    
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/docs/RELEASE_NOTES_NEXT/Administration/trigger_event_repeatability.txt b/docs/RELEASE_NOTES_NEXT/Administration/trigger_event_repeatability.txt
new file mode 100644
index 0000000..cbbcd8c
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Administration/trigger_event_repeatability.txt
@@ -0,0 +1,12 @@
+Action Trigger Event Repeatability
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Action Trigger Event Definitions have a new field, "Event Repeatability
+Delay". This feature allows events to be repeated after the designated
+delay interval. An example of this is sending a notification email when a
+patron's library card expires. If the library extends the expiration date
+on that card, we then need a way to send another notification email when
+that same card expires again. Before, the Action Trigger processor only
+created a new event if the event definition for that target had never
+been run before. But now it allows repeating of the event after the delay
+interval, if present.

commit 86db7176873b007313f25879779a7ff853e51298
Author: Remington Steed <rjs7 at calvin.edu>
Date:   Mon Aug 5 09:57:04 2013 -0400

    Allow action trigger events to be repeated
    
    Currently, there is no way to repeat an event (action/trigger) when a
    real-world event occurs more than once for the same target. This only
    matters for targets that are persistent (such as a library card)
    combined with events that can reoccur (such as expiration, if the
    expiration can be removed). To address this, we add a new field to the
    action_trigger.event_definition table that sets the amount of time
    after which the event is allowed to repeat.
    
    This commit adds the new field to the IDL, database schema and template
    files and also provides the simple db upgrade script. It is worth noting
    that we chose to base the repeatability on the start_time of the previous
    event, which is more predictable than complete_time (which could be null
    if the event fails).
    
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index ba8efaa..861d107 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -1138,6 +1138,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 			<field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
 			<field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
 			<field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
+			<field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
 			<field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
 			<field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
 		</fields>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm
index 24488e8..ed83cba 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm
@@ -470,6 +470,11 @@ sub create_batch_events {
                 filter => { event_def => $def->id }
             }
         }};
+        if ($def->repeat_delay) {
+            $join->{'join'}{atev}{filter} = { start_time => {
+                '>' => DateTime->now->subtract( seconds => interval_to_seconds($def->repeat_delay) )->strftime( '%F %T%z' )
+            } };
+        }
 
         push @{ $filter->{'-and'} }, { '+atev' => { id => undef } };
 
diff --git a/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql b/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql
index bf5e61b..396cd7d 100644
--- a/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql
+++ b/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql
@@ -183,6 +183,7 @@ CREATE TABLE action_trigger.event_definition (
     cleanup_failure TEXT        REFERENCES action_trigger.cleanup (module) DEFERRABLE INITIALLY DEFERRED,
     delay           INTERVAL    NOT NULL DEFAULT '5 minutes',
     max_delay       INTERVAL,
+    repeat_delay    INTERVAL,
     usr_field       TEXT,
     opt_in_setting  TEXT        REFERENCES config.usr_setting_type (name) DEFERRABLE INITIALLY DEFERRED,
     delay_field     TEXT,                 -- for instance, xact_start on a circ hook ... look for fields on hook.core_type where datatype=timestamp? If not set, delay from now()
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.action_trigger.event_definition.repeat_delay.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.action_trigger.event_definition.repeat_delay.sql
new file mode 100644
index 0000000..f07a4dc
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.action_trigger.event_definition.repeat_delay.sql
@@ -0,0 +1,8 @@
+BEGIN;
+
+--- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+ALTER TABLE action_trigger.event_definition ADD COLUMN repeat_delay INTERVAL;
+
+COMMIT;
+
diff --git a/Open-ILS/src/templates/conify/global/action_trigger/event_definition.tt2 b/Open-ILS/src/templates/conify/global/action_trigger/event_definition.tt2
index 069a716..5908cc9 100644
--- a/Open-ILS/src/templates/conify/global/action_trigger/event_definition.tt2
+++ b/Open-ILS/src/templates/conify/global/action_trigger/event_definition.tt2
@@ -29,7 +29,7 @@
             <table  jsId="edGrid" 
                     autoHeight='true'
                     dojoType="openils.widget.AutoGrid" 
-                    fieldOrder="['owner', 'name', 'hook', 'active', 'delay', 'delay_field', 'group_field', 'reactor', 'validator']"
+                    fieldOrder="['owner', 'name', 'hook', 'active', 'delay', 'delay_field', 'group_field', 'reactor', 'validator', 'repeat_delay']"
                     suppressFields="['usr_field', 'opt_in_setting', 'max_delay', 'template', 'cleanup_failure', 'cleanup_success']"
                     query="{id: '*'}" 
                     fmClass='atevdef'

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/fm_IDL.xml                       |    1 +
 .../perlmods/lib/OpenILS/Application/Trigger.pm    |    5 +++++
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/400.schema.action_trigger.sql  |    1 +
 ...ction_trigger.event_definition.repeat_delay.sql |    8 ++++++++
 .../global/action_trigger/event_definition.tt2     |    2 +-
 .../Administration/trigger_event_repeatability.txt |   12 ++++++++++++
 7 files changed, 29 insertions(+), 2 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0827.schema.action_trigger.event_definition.repeat_delay.sql
 create mode 100644 docs/RELEASE_NOTES_NEXT/Administration/trigger_event_repeatability.txt


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list