when creating events, filter the defs on granularity if the user requested that;...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Nov 2009 00:05:35 +0000 (00:05 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Nov 2009 00:05:35 +0000 (00:05 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14862 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm

index 367fd04..702d7ff 100644 (file)
@@ -367,6 +367,7 @@ sub create_batch_events {
     }
 
     for my $def ( @$defs ) {
+        next if ($granularity && $def->granularity ne $granularity );
 
         my $date = DateTime->now->subtract( seconds => interval_to_seconds($def->delay) );
 
@@ -433,7 +434,6 @@ sub create_batch_events {
             $event->target( $o_id );
             $event->event_def( $def->id );
             $event->run_time( $run_time );
-            $event->granularity($granularity) if (defined $granularity);
 
             $editor->create_action_trigger_event( $event );