[Rt-commit] rt branch, 4.0/same-query-in-both-queue-summary-by, created. rt-4.0.6-167-g5229aee

Ruslan Zakirov ruz at bestpractical.com
Mon Jun 11 13:19:47 EDT 2012


The branch, 4.0/same-query-in-both-queue-summary-by has been created
        at  5229aeee60ed34b00c775e7f82c632ff8f9e7a3c (commit)

- Log -----------------------------------------------------------------
commit 5229aeee60ed34b00c775e7f82c632ff8f9e7a3c
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Mon Jun 11 21:10:39 2012 +0400

    sync queries in QueueSummaryBy*
    
    put statuses into query, it's already this way in
    QueueSummaryByLifecylcle. People rarely limit number of queues
    to display, but status is often limited to initial and active.
    Intances usually have small fractive of active tickets, so
    status condition can be very selective.
    
    Good to go into 4.0 as it just syncs code with QueueSummaryByLifecylcle

diff --git a/share/html/Elements/QueueSummaryByStatus b/share/html/Elements/QueueSummaryByStatus
index 09f274f..f649d28 100644
--- a/share/html/Elements/QueueSummaryByStatus
+++ b/share/html/Elements/QueueSummaryByStatus
@@ -122,9 +122,13 @@ my $statuses = {};
 
 use RT::Report::Tickets;
 my $report = RT::Report::Tickets->new( RT->SystemUser );
-my $query = @queues
-    ? join(' OR ', map "Queue = ".$_->{id}, @queues)
-    : 'id < 0';
+my $query =
+    "(".
+    join(" OR ", map {s{(['\\])}{\\$1}g; "Status = '$_'"} @statuses) #'
+    .") AND (".
+    join(' OR ', map "Queue = ".$_->{id}, @queues)
+    .")";
+$query = 'id < 0' unless @queues;
 $report->SetupGroupings( Query => $query, GroupBy => [qw(Status Queue)] );
 
 while ( my $entry = $report->Next ) {

-----------------------------------------------------------------------


More information about the Rt-commit mailing list