[Rt-commit] r5070 - in rtir/branches/1.9-EXPERIMENTAL: lib/RT/Action

ruz at bestpractical.com ruz at bestpractical.com
Mon Apr 24 22:14:02 EDT 2006


Author: ruz
Date: Mon Apr 24 22:14:01 2006
New Revision: 5070

Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_SetBlockState.pm

Log:
 r1327 at cubic-pc:  cubic | 2006-04-25 04:55:00 +0400
 * correct check for new -> open changes in the blocks workflow


Modified: rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_SetBlockState.pm
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_SetBlockState.pm	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/lib/RT/Action/RTIR_SetBlockState.pm	Mon Apr 24 22:14:01 2006
@@ -76,12 +76,13 @@
     return 'active' if $old_state eq 'removed';
 
     my $txn = $self->TransactionObj;
-    if ( $txn->Creator != $RT::System ) {
-        # if a duty team member changes Status directly then we want to do it
-        my $group = RT::Group->new( $self->CurrentUser );
-        $group->LoadUserDefinedGroup('DutyTeam');
-        $RT::Logger->error("Couldn't load 'DutyTeam' group") unless $group->id;
-        if ( $group->HasMember( $txn->CreatorObj->PrincipalObj ) ) {
+    if ( $txn->Creator != $RT::SystemUser->id ) {
+        # if a duty team member changes Status directly then we want to activate
+        if ( ($txn->Type eq 'Status' || ($txn->Type eq 'Set' && $txn->Field eq 'Status')) &&
+                $self->CreatorCurrentUser->PrincipalObj->HasRight(
+                    Right => 'ModifyTicket', Object => $t
+                )
+        ) {
             return 'active';
         }
     }


More information about the Rt-commit mailing list