[Rt-commit] r18730 - rt/3.8/trunk/lib/RT/Approval/Rule

clkao at bestpractical.com clkao at bestpractical.com
Fri Mar 6 11:12:42 EST 2009


Author: clkao
Date: Fri Mar  6 11:12:42 2009
New Revision: 18730

Modified:
   rt/3.8/trunk/lib/RT/Approval/Rule/Passed.pm

Log:
Make approval passed rule close other approvals in the same level.

Modified: rt/3.8/trunk/lib/RT/Approval/Rule/Passed.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Approval/Rule/Passed.pm	(original)
+++ rt/3.8/trunk/lib/RT/Approval/Rule/Passed.pm	Fri Mar  6 11:12:42 2009
@@ -69,14 +69,23 @@
         next unless $o->Type eq 'Correspond';
         $note .= $o->Content . "\n" if $o->ContentObj;
     }
+
     my ($top) = $self->TicketObj->AllDependedOnBy( Type => 'ticket' );
     my $links  = $self->TicketObj->DependedOnBy;
 
     while ( my $link = $links->Next ) {
         my $obj = $link->BaseObj;
         next unless $obj->Type eq 'approval';
-        next if $obj->HasUnresolvedDependencies( Type => 'approval' );
 
+        for my $other ($obj->AllDependsOn( Type => 'approval' )) {
+            if ( $other->QueueObj->IsActiveStatus( $other->Status ) ) {
+                $other->__Set(
+                    Field => 'Status',
+                    Value => 'deleted',
+                );
+            }
+
+        }
         $obj->SetStatus( Status => 'open', Force => 1 );
     }
 


More information about the Rt-commit mailing list