[Rt-commit] [rtir] 02/14: Convert LookupSummary to use the new lifecycle name helpers

Jesse Vincent jesse at bestpractical.com
Wed Feb 18 20:55:03 EST 2015


This is an automated email from the git hooks/post-receive script.

jesse pushed a commit to branch 3.4/remove_old_constituencies
in repository rtir.

commit ed536525ccf9de7ec3c9ea2e0f21a9c72478e8b4
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Feb 18 14:47:07 2015 -0800

    Convert LookupSummary to use the new lifecycle name helpers
---
 html/RTIR/Tools/Elements/LookupSummary | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/html/RTIR/Tools/Elements/LookupSummary b/html/RTIR/Tools/Elements/LookupSummary
index 3577c85..ad42d74 100644
--- a/html/RTIR/Tools/Elements/LookupSummary
+++ b/html/RTIR/Tools/Elements/LookupSummary
@@ -77,14 +77,13 @@ if ( $LookupType && RT::IR->CustomFields( Field => $LookupType )
 
 my $Format = RT->Config->Get('RTIRSearchResultFormats')->{'LookupTool'};
 if ( $TicketObj ) {
-    my $type = RT::IR::TicketType( Ticket => $TicketObj );
 
     my @show;
-    push @show, 'link' if ($Lifecycle eq 'incidents' && $type ne 'Incident')
-        || ($Lifecycle ne 'incidents' && $type eq 'Incident');
+    push @show, 'link' if ($Lifecycle eq RT::IR->lifecycle_incident && $TicketObj->QueueObj->Lifecycle ne RT::IR->lifecycle_incident)
+        || ($Lifecycle ne RT::IR->lifecycle_incident && $TicketObj->QueueObj->Lifecycle eq RT::IR->lifecycle_incident);
     push @show, 'merge' if $Lifecycle eq $TicketObj->QueueObj->Lifecycle;
 
-    my $column = $Lifecycle eq 'incidents' ? 'Incident' : 'Children';
+    my $column = $Lifecycle eq RT::IR->lifecycle_incident ? 'Incident' : 'Children';
     $Format .= ", '__LookupTool${column}Actions.{". join(',', $TicketObj->id, @show ) ."}__'";
 }
 
@@ -96,8 +95,8 @@ push @box_actions, {
         Query => $Query,
     ),
 };
-if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident'
-    && $Lifecycle ne 'incidents'
+if ( $TicketObj && $TicketObj->QueueObj->Lifecycle eq RT::IR->lifecycle_incident 
+    && $Lifecycle ne RT::IR->lifecycle_incident
 ) {
     push @box_actions, {
         title => loc('Link'),
@@ -107,7 +106,7 @@ if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident'
             Query => $Query,
         ),
     };
-    if ($Lifecycle eq 'investigations' && $LookupType eq 'email') {
+    if ($Lifecycle eq RT::IR->lifecycle_investigation && $LookupType eq 'email') {
         push @box_actions, {
             title => loc('Launch'),
             path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
@@ -116,7 +115,7 @@ if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident'
                 Requestors => $q,
             ),
         };
-    } elsif ( $Lifecycle eq 'blocks' && $LookupType eq 'ip' && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
+    } elsif ( $Lifecycle eq RT::IR->lifecycle_countermeasure && $LookupType eq 'ip' && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
         push @box_actions, {
             title => loc('Create'),
             path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
@@ -127,8 +126,8 @@ if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident'
         };
     }
 }
-elsif ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) ne 'Incident'
-    && $Lifecycle eq 'incidents'
+elsif ( $TicketObj && $TicketObj->QueueObj->Lifecycle ne RT::IR->lifecycle_incident 
+    && $Lifecycle eq RT::IR->lifecycle_incident
 ) {
     push @box_actions, {
         title => loc('Create'),

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list