[rt-users] Few things in RT that annoy me and my support.

Scott Frisbie scottf at eacceleration.com
Wed Sep 28 13:31:05 EDT 2005


Thanks! This bit of code works perfectly! We've been trying to have
multiple departments use the same instance of RT so we could all use the
same RTFM, but when the other departments would get a rush of tickets,
all the unowned tickets for our department would disappear. Popeye, you
may not be a 'perl master', but you are way ahead of me! Thanks again,
this list is one of the best on the net.
Scott


===============
Thanx alot to Ruslan Zakirov.
Its some fixes for epty list in search and on first page  in "newest
unowned 
tickets". 
Problem was: If user don't have right for queue then he not see tickets
from 
this queue but RT reserve row for it in result, so we have small tickets
on 
first page and in search result.. 

How to fix: 
We need search in database by queues which user have granted to see, not
by 
all queues, so RT wouldn't reserve row for unnecessary queues.
It must speed up your first page too.

This code i put in share/html/Elements/MyRequests
Code is my (i'm not perl master) so maybe you could make it "cleaner"

1) find <%init> ... </%init> section.
2) replace all to following code:

<%init>
my $rows = $RT::MyRequestsLength;

my $Query = "Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')";

my $Qadd = "";

my $CheckQueueRight = 'SeeQueue;

my $q=new RT::Queues($session{'CurrentUser'});
$q->UnLimit;

while (my $queue=$q->Next) {
 if ($queue->CurrentUserHasRight($CheckQueueRight)) {
    $Qadd .= " OR Queue= '".$queue->Id."'";
 }
}
$Qadd =~ s/^\s*OR//;
$Query .= " AND (".$Qadd.")";


my $QueryString = "";
$QueryString = '?' . $m->comp('/Elements/QueryString',
                              Query => $Query,
                              Order => 'DESC',
                              OrderBy => 'Priority') if ($Query);

</%init>

so we have full list of requests now. Seems exactly like
MyRequestsLength 
value...
I think this code we can put to searches too, but i didn't test it.






-- 
Thanks!
Scott Frisbie (Friz) 8^)
scottf at scottfrisbie.com

--
You may dispense with the pleasantries, Commander.
I'm here to put you back on schedule.
            Darth Vader, Return of the Jedi
--





More information about the rt-users mailing list