[Rt-commit] [rtir] 06/10: Partial porting of Tabs to lifecycle helpers

Jesse Vincent jesse at bestpractical.com
Sat Feb 21 16:15:17 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 fc7c1966925d19ff6913683e1fe6ccae1b81fd7d
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sat Feb 21 11:55:44 2015 -0800

    Partial porting of Tabs to lifecycle helpers
---
 html/Callbacks/RTIR/Elements/Tabs/Privileged | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 5a82187..05104a1 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -330,8 +330,7 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
         path => "/RTIR/Display.html?id=$id",
     );
 } elsif ( $request_path =~ m{^/RTIR/Incident/Children/} ) {
-    my $lifecycle = $args->{'Lifecycle'} || 'incident_reports';
-    my $type = RT::IR::TicketType( Lifecycle => $lifecycle );
+    my $lifecycle = $args->{'Lifecycle'} ||  RT::IR->lifecycle_report;
 
     my $ticket = RT::Ticket->new( $session{'CurrentUser'} );
     $ticket->Load( $args->{'id'} );
@@ -404,17 +403,16 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
     my $lifecycle = $args->{'Lifecycle'} || '';
     unless ( $lifecycle ) {
         if ( $request_path =~ /Incident/ ) {
-            $lifecycle = 'incidents';
+            $lifecycle =  RT::IR->lifecycle_incident;
         }
         elsif ( $request_path =~ /Report/ ) {
-            $lifecycle = 'incident_reports';
+            $lifecycle =  RT::IR->lifecycle_report;
         }
     }
     unless ( $lifecycle ) {
         my (undef, @lifecycles) = RT::IR->OurQuery( $args{'Query'} );
         $lifecycle = $lifecycles[0] if @lifecycles == 1;
     }
-    my $type = RT::IR::TicketType( Lifecycle => $lifecycle ) || '';
 
     $args{'Lifecycle'} = $lifecycle if $lifecycle;
 
@@ -442,7 +440,7 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
         );
     }
 
-    if ( $type eq 'Incident' ) {
+    if ( $lifecycle eq RT::IR->lifecycle_incident ) {
         PageMenu()->child(
             report => title => loc('Report'),
             path => "/RTIR/Reporting/",
@@ -453,7 +451,7 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
             path => "/RTIR/Incident/BulkAbandon.html?". $query_string->( %args ),
         );
     }
-    elsif ( $type eq 'Report' ) {
+    elsif ( $lifecycle eq RT::IR->lifecycle_report) {
         PageMenu()->child(
             reject => title => loc('Bulk Reject'),
             path => "/RTIR/Report/BulkReject.html?". $query_string->( %args ),

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


More information about the rt-commit mailing list