[Rt-commit] r4794 - in rtir/branches/1.9-EXPERIMENTAL: html/RTIR/Elements

ruz at bestpractical.com ruz at bestpractical.com
Wed Mar 22 09:59:12 EST 2006


Author: ruz
Date: Wed Mar 22 09:59:11 2006
New Revision: 4794

Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueTabs

Log:
 r985 at cubic-pc:  cubic | 2006-03-22 17:23:53 +0300
 * add resolve tabs to the Invs' actions


Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueTabs
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueTabs	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueTabs	Wed Mar 22 09:59:11 2006
@@ -169,52 +169,47 @@
     }
 
     if ( $can{'ModifyTicket'} ) {
-        if ( $Type eq 'Report' ) {
-            if ( $Ticket->QueueObj->IsActiveStatus( $Ticket->Status ) ) {
-                my $state = RT::IR::Ticket::FirstCustomFieldValue( $Ticket,
-                    '_RTIR_State' );
-                if ( $state ne 'new' ) {
-                    $actions->{'Ac'} = {
-                        path =>
-                            "RTIR/Update.html?Action=Comment&DefaultStatus=resolved&id=$id",
-                        title => loc('Resolve'),
-                    };
-                    $actions->{'Acc'} = {
-                        path  => "RTIR/Display.html?Status=resolved&id=$id",
-                        title => loc('Quick Resolve'),
-                    };
-                }
-                $actions->{'B'} = {
-                    path  => "RTIR/Display.html?Status=rejected&id=$id",
-                    title => loc('Quick Reject'),
+        my $state = RT::IR::Ticket::FirstCustomFieldValue( $Ticket, '_RTIR_State' );
+        if ( $state eq 'open') {
+            if ( $Type =~ /^(Report|Investigation)$/ ) {
+                $actions->{'Ac'} = {
+                    path  => "RTIR/Update.html?Action=Comment&DefaultStatus=resolved&id=$id",
+                    title => loc('Resolve'),
                 };
-                $actions->{'Bb'} = {
-                    path =>
-                        "RTIR/Update.html?Action=Comment&DefaultStatus=rejected&id=$id",
-                    title => loc('Reject'),
+                $actions->{'Acc'} = {
+                    path  => "RTIR/Display.html?Status=resolved&id=$id",
+                    title => loc('Quick Resolve'),
                 };
-            }
-        } elsif ( $Type eq 'Incident' ) {
-            if ( $Ticket->QueueObj->IsActiveStatus( $Ticket->Status ) ) {
+            } elsif ( $Type eq 'Incident' ) {
                 $actions->{'Ac'} = {
-                    path =>
-                        "RTIR/Incident/Reply.html?Action=Comment&DefaultStatus=resolved&id=$id&All=1",
+                    path  => "RTIR/Incident/Reply.html?Action=Comment&All=1&DefaultStatus=resolved&id=$id",
                     title => loc('Resolve'),
                 };
                 $actions->{'Acc'} = {
                     path  => "RTIR/Display.html?Status=resolved&id=$id",
                     title => loc('Quick Resolve'),
                 };
+            }
+        }
+        if ( $Ticket->QueueObj->IsActiveStatus( $Ticket->Status ) ) {
+            if ( $Type eq 'Report' ) {
+                $actions->{'B'} = {
+                    path =>
+                        "RTIR/Update.html?Action=Comment&DefaultStatus=rejected&id=$id",
+                    title => loc('Reject'),
+                };
+                $actions->{'Bb'} = {
+                    path  => "RTIR/Display.html?Status=rejected&id=$id",
+                    title => loc('Quick Reject'),
+                };
+            } elsif ( $Type eq 'Incident' ) {
                 $actions->{'B'} = {
                     path =>
                         "RTIR/Incident/Reply.html?Action=Comment&DefaultStatus=rejected&id=$id&All=1",
                     title => loc('Abandon'),
                 };
             }
-        }
-
-        ### Open ###
-        if ( $Ticket->QueueObj->IsInactiveStatus( $Ticket->Status ) ) {
+        } else {
             $actions->{'C'} = {
                 path  => "RTIR/Display.html?Status=open&id=$id",
                 title => loc('Open')


More information about the Rt-commit mailing list