[Rt-commit] rtir branch, rt-3.9, updated. 453382ff7ad1d48999ab0cc121bcb78d01f1914c

Ruslan Zakirov ruz at bestpractical.com
Thu Oct 14 18:25:25 EDT 2010


The branch, rt-3.9 has been updated
       via  453382ff7ad1d48999ab0cc121bcb78d01f1914c (commit)
      from  74beebf75742691aed9364ad7e1adeb77bde7d4c (commit)

Summary of changes:
 lib/RT/Condition/RTIR_BlockActivation.pm |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

- Log -----------------------------------------------------------------
commit 453382ff7ad1d48999ab0cc121bcb78d01f1914c
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Oct 15 01:21:40 2010 +0400

    fix RTIR_BlockActivation condition

diff --git a/lib/RT/Condition/RTIR_BlockActivation.pm b/lib/RT/Condition/RTIR_BlockActivation.pm
index f413d0f..118414f 100644
--- a/lib/RT/Condition/RTIR_BlockActivation.pm
+++ b/lib/RT/Condition/RTIR_BlockActivation.pm
@@ -16,20 +16,11 @@ sub IsApplicable {
     my $self = shift;
 
     my $txn = $self->TransactionObj;
-
-    my $type = $txn->Type;
-    return 1 if $type eq 'Create' && $self->TicketObj->Status eq 'active';
-    if (
-        (
-            $txn->Type eq 'Status'
-            || ( $txn->Type eq 'Set' && $txn->Field eq 'Status' )
-        )
-        && $self->TicketObj->OldStatus eq 'pending activation'
-        && $self->TicketObj->NewStatus eq 'active'
-      )
-    {
-        return 1;
-    }
+    return 1 if $txn->Type eq 'Create' && $self->TicketObj->Status eq 'active';
+    return 1 if
+        $self->IsStatusChange
+        && $txn->OldValue eq 'pending activation'
+        && $txn->NewValue eq 'active';
 
     return 0;
 }

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


More information about the Rt-commit mailing list