[Rt-devel] Re: [rt-users] Modification: Showing tickets in queues
you watch on the front page
Andy Moran
andy at wildbrain.com
Mon Oct 3 20:44:42 EDT 2005
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
>
More information about the Rt-devel
mailing list