[Rt-commit] [rtir] 01/24: Further queue->lookup type conversions

Jesse Vincent jesse at bestpractical.com
Mon Feb 9 00:25: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 eed20a11bacff31fce72b5d4ca3675b95e9b6078
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Thu Feb 5 21:15:41 2015 -0800

    Further queue->lookup type conversions
---
 html/RTIR/Search/Elements/ShowResults         |  2 --
 html/RTIR/Tools/Elements/LookupRelatedTickets |  8 ++---
 html/RTIR/Tools/Elements/LookupSummary        | 43 ++++++++++++++-------------
 3 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/html/RTIR/Search/Elements/ShowResults b/html/RTIR/Search/Elements/ShowResults
index 8eedcd0..5fc5c67 100644
--- a/html/RTIR/Search/Elements/ShowResults
+++ b/html/RTIR/Search/Elements/ShowResults
@@ -96,8 +96,6 @@ else {
 return $found;
 </%INIT>
 <%ARGS>
-$Queue           => ''
-
 $BaseQuery       => ''
 $Query           => ''
 $Format          => ''
diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
index fef8015..820f071 100644
--- a/html/RTIR/Tools/Elements/LookupRelatedTickets
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -48,20 +48,20 @@
 <table width="100%" border="0" cellpadding="2" cellspacing="0">
 <tr><td valign="top" width="50%">
 
-<& LookupSummary, %ARGS, Queue => 'Incidents', Query => $query &>
+<& LookupSummary, %ARGS, Lifecycle => 'incidents', Query => $query &>
 
 </td><td valign="top" width="50%">
 
-<& LookupSummary, %ARGS, Queue => 'Investigations', Query => $query &>
+<& LookupSummary, %ARGS, Lifecycle => 'investigations', Query => $query &>
 
 </td></tr><tr><td valign="top" width="50%">
 
-<& LookupSummary, %ARGS, Queue => 'Incident Reports', Query => $query &>
+<& LookupSummary, %ARGS, Lifecycle => 'incident_reports', Query => $query &>
 
 </td><td width="50%" valign="top">
 
 % unless ( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
-<& LookupSummary, %ARGS, Queue => 'Blocks', Query => $query &>
+<& LookupSummary, %ARGS, Lifecycle => 'blocks', Query => $query &>
 % }
 
 </td></tr>
diff --git a/html/RTIR/Tools/Elements/LookupSummary b/html/RTIR/Tools/Elements/LookupSummary
index c7a1fe3..3577c85 100644
--- a/html/RTIR/Tools/Elements/LookupSummary
+++ b/html/RTIR/Tools/Elements/LookupSummary
@@ -46,8 +46,8 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 <&| /Widgets/TitleBox,
-    title => loc($Queue) .': '. $q,
-    class => 'tickets-list-'. lc RT::IR::TicketType( Queue => $Queue ),
+    title => loc($display_lifecycle) .': '. $q,
+    class => 'tickets-list-'. $Lifecycle,
     titleright_raw => $box_actions,
     title_class => 'inverse',
 &>
@@ -55,19 +55,22 @@
 <i><% loc("Custom field '[_1]' doesn't applies to this queue", loc($LookupType) ) %></i>
 % } else {
 <& /RTIR/Search/Elements/ShowResults,
-    Queue         => $Queue,
-    BaseQuery     => RT::IR->Query( Lifecycle => $Queue->Lifecycle ),
+    BaseQuery     => RT::IR->Query( Lifecycle => $Lifecycle ),
     Query         => $Query,
     Format        => $Format,
     AllowSorting  => 0,
-    EmptyLabel    => loc("(no $Queue)"),
+    EmptyLabel    => loc("(no $display_lifecycle)"),
 &>
 % }
 </&>
 <%INIT>
+
+my $display_lifecycle = $Lifecycle;
+$display_lifecycle =~ s/_/ /; # TODO replace with a function in RT::IR
+
 my $lookup_cf_not_applies = 0;
 if ( $LookupType && RT::IR->CustomFields( Field => $LookupType )
-    && !RT::IR->CustomFields( Field => $LookupType, Queue => $Queue )
+    && !RT::IR->CustomFields( Field => $LookupType, Lifecycle => $Lifecycle )
 ) {
     $lookup_cf_not_applies = 1;
 }
@@ -77,11 +80,11 @@ if ( $TicketObj ) {
     my $type = RT::IR::TicketType( Ticket => $TicketObj );
 
     my @show;
-    push @show, 'link' if ($Queue eq 'Incidents' && $type ne 'Incident')
-        || ($Queue ne 'Incidents' && $type eq 'Incident');
-    push @show, 'merge' if $Queue eq $TicketObj->QueueObj->Name;
+    push @show, 'link' if ($Lifecycle eq 'incidents' && $type ne 'Incident')
+        || ($Lifecycle ne 'incidents' && $type eq 'Incident');
+    push @show, 'merge' if $Lifecycle eq $TicketObj->QueueObj->Lifecycle;
 
-    my $column = $Queue eq 'Incidents'? 'Incident' : 'Children';
+    my $column = $Lifecycle eq 'incidents' ? 'Incident' : 'Children';
     $Format .= ", '__LookupTool${column}Actions.{". join(',', $TicketObj->id, @show ) ."}__'";
 }
 
@@ -89,49 +92,49 @@ my @box_actions;
 push @box_actions, {
     title => loc('Search'),
     path => "/RTIR/Search/Refine.html?". $m->comp('/Elements/QueryString', 
-        Queue => $Queue,
+        Lifecycle => $Lifecycle,
         Query => $Query,
     ),
 };
 if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident'
-    && $Queue ne 'Incidents'
+    && $Lifecycle ne 'incidents'
 ) {
     push @box_actions, {
         title => loc('Link'),
         path => "/RTIR/Link/ToIncident/?". $m->comp('/Elements/QueryString', 
             id => $TicketObj->id,
-            Queue => $Queue,
+            Lifecycle => $Lifecycle,
             Query => $Query,
         ),
     };
-    if ($Queue eq 'Investigations' && $LookupType eq 'email') {
+    if ($Lifecycle eq 'investigations' && $LookupType eq 'email') {
         push @box_actions, {
             title => loc('Launch'),
             path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
                 Incident => $TicketObj->id,
-                Queue => $Queue,
+                Lifecycle => $Lifecycle,
                 Requestors => $q,
             ),
         };
-    } elsif ( $Queue eq 'Blocks' && $LookupType eq 'ip' && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
+    } elsif ( $Lifecycle eq 'blocks' && $LookupType eq 'ip' && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
         push @box_actions, {
             title => loc('Create'),
             path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
                 Incident => $TicketObj->id,
-                Queue => $Queue,
+                Lifecycle => $Lifecycle,
                 'IP-Value' => $q,
             ),
         };
     }
 }
 elsif ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) ne 'Incident'
-    && $Queue eq 'Incidents'
+    && $Lifecycle eq 'incidents'
 ) {
     push @box_actions, {
         title => loc('Create'),
         path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
             Child => $TicketObj->id,
-            Queue => $Queue,
+            Lifecycle => $Lifecycle
         ),
     };
 }
@@ -144,7 +147,7 @@ my $box_actions = join ' 'x3,
 
 <%ARGS>
 $Query => undef
-$Queue => undef
+$Lifecycle => undef
 $TicketObj => undef
 
 $q => undef

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


More information about the rt-commit mailing list