[Rt-devel] Re: [rt-users] Modification: Showing tickets in queues you watch on the front page
Andy Moran
andy at wildbrain.com
Wed Oct 5 17:19:27 EDT 2005
Okay I figured this out myself after looking through some other RT code
and brushing up my perl syntax.
I have attached the code to list all unowned unresolved tickets in all
the queues that the current logged in user is a watcher of. Drop this
"MyQueues" into /usr/local/rt3/local/html/Elements/MyQueues and copy
/usr/local/rt3/share/html/index.html to
/usr/local/rt3/local/html/index.html and add:
<& /Elements/MyQueues &>
<BR>
where appropriate.
Andy Moran wrote:
> Okay I didn't get any response on this so I'm gonna include rt-devel and
> see if I get any bites.
>
> I found code to do it for RT2, but it breaks under Rt3:
>
> my $userEmail = $session{'CurrentUser'}->EmailAddress;
> my $queueCount = 0;
> my $Queues = new RT::Queues($session{'CurrentUser'});
> $Queues->UnLimit();
>
> my $Tickets = new RT::Tickets ($session{'CurrentUser'});
> $Tickets->ClearRestrictions;
> $Tickets->LimitOwner(VALUE => "Nobody");
> $Tickets->LimitStatus(VALUE => "resolved", OPERATOR => '!=');
> $Tickets->LimitStatus(VALUE => "dead", OPERATOR => '!=');
>
> while (my $queue = $Queues->Next) {
> my $watcherEmails = $queue->Watchers()->EmailsAsString();
> next if $watcherEmails !~ /\b$userEmail/;
> $queueCount++;
> $Tickets->LimitQueue(VALUE => $queue->id);
> }
>
> $Tickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC');
> $Tickets->RowsPerPage(25);
>
>
> The Rt3 way seems to be about using query strings.. but I'm missing the
> part where I'm searching all queues that the current user is a watcher on.
>
> Any help would be awesome.. thanks!
>
> --Andy
>
>
>
> Andy Moran wrote:
>
>>Hi guys,
>>
>>I'm setting up an Rt3 instance. I'd like to change the front page for
>>privileged users so instead of showing "X newest onowned tickets", it
>>only shows "X newest unowned tickets in the queues I watch.."
>>
>>I know I need to copy share/html/Elements/MyRequests to
>>local/html/Elements/MyRequests and modify it somehow to only show queues
>>that the person logged in is a watcher on. But I don't wanna learn the
>>entire RT API to just change this one bit.. If anyone could tell me the
>>code I need, I'd be grateful.. thanks!
>>
>>
>>
>>
>>
>>_______________________________________________
>>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
>>
>
>
> _______________________________________________
> Rt-devel mailing list
> Rt-devel at lists.bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: MyQueues
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20051005/5541586b/attachment.ksh>
More information about the rt-users
mailing list