[rt-users] Query problem(tickets req by grp members), RT just hangs

Weqaar Janjua weqaar at yahoo.com
Wed Oct 19 13:22:01 EDT 2005


I have the following lines of code in
/Elements/Grprequests the purpose of which is to
display tickets requested by user's group members(user
can be a member of more than one group), when the page
is loaded RT just hangs(does not die), as if its
trying to run the query:


<%init>
my $Groups = RT::Groups->new($session{'CurrentUser'});
$Groups->LimitToUserDefinedGroups();
$Groups->WithMember(PrincipalId =>
$session{'CurrentUser'}->Id);

my $rows = 10;

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

my $QueuesListing = '';

my @ids;
my $Group;

while ( $Group = $Groups->Next ) {
                push @ids, $Group->Id;
}

while (my $queue = $Queues->Next) {
   next unless
($queue->CurrentUserHasRight('ShowTicket'));
   if ($QueuesListing ne '') {
     $QueuesListing .= " OR Queue = ";
   } else {
     $QueuesListing = "Queue = ";
   }
   $QueuesListing .= "'".$queue->Name."'";
}


my $Query = "
   Requestor != '".$session{'CurrentUser'}->Id."'
   AND ( Status = 'new' OR Status = 'open' OR Status =
'stalled' )
   AND ( RequestorGroup = '$ids[0]' OR RequestorGroup
= '$ids[1]' )
   AND ( " . $QueuesListing . " )
   ";

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

</%init>



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com



More information about the rt-users mailing list