LP#1672824 A/T complete_time set on grouped events
authorBill Erickson <berickxx@gmail.com>
Tue, 14 Mar 2017 17:57:12 +0000 (13:57 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 16 May 2017 14:57:36 +0000 (10:57 -0400)
Set the complete_time value on grouped Action/Trigger events when an
event's state reaches "complete", consisten with non-grouped events.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/EventGroup.pm

index e5968bc..ec1c3e7 100644 (file)
@@ -256,6 +256,9 @@ sub update_state {
 
         $e->clear_start_time() if ($e->state eq 'pending');
 
+        $e->complete_time('now')
+            if ($e->state eq 'complete' && !$e->complete_time);
+
         if ($fields && ref($fields)) {
             $e->$_($$fields{$_}) for (keys %$fields);
         }