[rt-users] Limit on queues display

Emmanuel Lacour elacour at easter-eggs.com
Fri May 28 10:44:50 EDT 2004


Hi,

I've got a QuickSearch wich show me only queues with respective
new,open,reolved,stalled and rejected tickets count.

I've got a lot of queues... and I would like to print only queues with
at least 1 ticket new or open or stalled.

I did a quick hack on Quicksearch to do this:

     $Tickets->ClearRestrictions;
     $Tickets->LimitStatus(VALUE => "open");
     $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '=');
     my $open = $Tickets->Count();

     $Tickets->ClearRestrictions;
     $Tickets->LimitStatus(VALUE => "new");
     $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '=');
     my $new = $Tickets->Count();

     $Tickets->ClearRestrictions;
     $Tickets->LimitStatus(VALUE => "stalled");
     $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '=');
     my $stalled = $Tickets->Count();

     next if ($new == 0 && $open == 0 && $stalled == 0);



But this way is slow because the limit occur in perl, not in sql I think...

Is there a way to do this directly with somethink like a $Queue ->Limit??? statement.
(I think it could be better because SearchBuilder will do a more efficient job)

Thanks for any help.

-- 
Emmanuel Lacour ------------------------------------ Easter-eggs
44-46 rue de l'Ouest  -  75014 Paris   -   France -  Métro Gaité
Phone: +33 (0) 1 43 35 00 37    -     Fax: +33 (0) 1 41 35 00 76
mailto:elacour at easter-eggs.com   -    http://www.easter-eggs.com



More information about the rt-users mailing list