[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rt-users
Subject:    Re: [rt-users] Few things in RT that annoy me and my support.
From:       Scott Frisbie <scottf () eacceleration ! com>
Date:       2005-09-28 17:31:05
Message-ID: 1127928665.19707.6.camel () scottf ! site
[Download RAW message or body]

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@scottfrisbie.com

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


_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Buy your copy of our new book, RT Essentials, today! 

Download a free sample chapter from http://rtbook.bestpractical.com
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic