[rt-users] Re: CONTRIB: MyQueues

Jim Meyer purp at wildbrain.com
Thu Feb 7 15:33:34 EST 2002


Works better if I attach the file, doesn't it? ;]

--j

On Thu, 2002-02-07 at 12:29, Jim Meyer wrote:
> Howdy!
> 
> In line with the MyTickets and MyRequests portions of WebRT, here's a
> MyQueues module which displays the 25 highest priority unclaimed (e.g.
> owned by Nobody) tickets in all queues that the current user is a
> watcher on.
> 
> To use this module:
> 
> * Copy it into your RT dir under WebRT/html/Elements/MyQueues.pm
> * Add it to your WebRT/html/index.html:
> 
>   <TD WIDTH=70%>
>   <& /Elements/CustomHomepageHeader, %ARGS &>
>   <& /Elements/MyTickets &>
>   <BR>
> + <& /Elements/MyQueues &>
> + <BR>
>   <& /Elements/MyRequests &>
>   </TD>
>   <TD>
> 
> And it should just work. =]
> 
> Enjoy!
> 
> --j
> -- 
> Jim Meyer, Geek At Large                              purp at wildbrain.com
-- 
Jim Meyer, Geek At Large                              purp at wildbrain.com
-------------- next part --------------
<& /Elements/TitleBoxStart, title => "25 highest priority unclaimed tickets in queues I watch..." &>
<TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%>
<TR>
<TH ALIGN=RIGHT>#</TH>
<TH ALIGN=LEFT>Subject</TH>
<TH ALIGN=LEFT>Queue</TH>
<TH ALIGN=LEFT>Status</TH>
<TH ALIGN=LEFT> </TH>
</TR>
% while (my $Ticket = $Tickets->Next) {
<TR>
<TD ALIGN=RIGHT>
<%$Ticket->Id%>
</TD>
<TD>
<A HREF="<% $RT::WebPath %>/Ticket/Display.html?id=<%$Ticket->Id%>">
<%$Ticket->Subject || '[no subject]'%>
</A>
</TD>
<TD>
<%$Ticket->QueueObj->Name%>
</TD><TD>
<%$Ticket->Status%>
</TD>
<TD ALIGN=RIGHT>
[<A HREF="<% $RT::WebPath %>/Ticket/Display.html?id=<%$Ticket->Id%>&Action=Take&Status=open">Take</A>]
</TD>
<TD ALIGN=RIGHT>
[<A HREF="<% $RT::WebPath %>/Ticket/Update.html?Action=Respond&DefaultStatus=resolved&id=<%$Ticket->Id%>">Resolve</A>]
</TD>
</TR>
% }
</TABLE>
<& /Elements/TitleBoxEnd &>


<%INIT>
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) {
     next if ! $queue->IsWatcher($session{'CurrentUser'});
     $Tickets->LimitQueue(VALUE => $queue->id);            
}

$Tickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC');
$Tickets->RowsPerPage(25);
</%INIT>


More information about the rt-users mailing list