[rt-users] [Hack] Tickets owned by other users

Rick Measham rickm at 3d3.com
Tue Oct 12 00:27:36 EDT 2004


Attached is a hack I've written to include a list of tickets that are
owned by other users. The hack displays this on the front page
underneath the 'Quick Search', but to move it is just a case of changing
the diff file.

As this is my first hack, please comment on it. (If you're reading this
in an archive, please check for replies)

A few assuptions are made in the file:
1. The 'nobody' user is id 10 (AFAIK, this is always true ... if not,
what's the best way of getting the Nobody user?)
2. The number of tickets displayed is the same number of unowned tickets
that are displayed. You could hard code a different value or hack a new
preference for changing it, but that's for you to do)

The file 'OthersTickets' should be saved into /Elements/OthersTickets
and the OthersTickets should be patched onto /html/index.html (if you
don't have a patch utility, just add the lines that start with '+' to
your index.html in the place shown (without the '+' of course))

Cheers!
Rick Measham


-------------- next part --------------
%# BEGIN LICENSE BLOCK
%# 
%# Copyright (c) 2004 Rick Measham <rickm at cpan.org>
%# 
%# This file extends RT to allow listing of other user's tickets
%# on the front page.
%#
%# The work is based entirely on the file MyTickets which is
%# distributed with the official release however this does not.
%# imply any guarantee of any kind. This file is not an authorised
%# patch of the RT system and should be treated as a separate work
%# for any purpose other than any stated in the GPL licence under
%# which this work is released.
%#
%# This work is distributed in the hope that it will be useful, but
%# WITHOUT ANY WARRANTY; without even the implied warranty of
%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%# General Public License for more details.
%#
$#
$# THE FOLLOWING COPYRIGHT NOTICE ACCOMPANIES THE ORIGINAL FILE
$#
%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
%# 
%# (Except where explictly superceded by other copyright notices)
%# 
%# END LICENSE BLOCK
<&|/Elements/TitleBox, title => loc('[_1] highest priority tickets others own', $rows) &>
<& /Elements/TicketList,
        Title => loc("[_1] highest priority tickets I requested...", $rows),
        Format => "'<a href=\"$RT::WebPath/Ticket/Display.html?id=__id__\">__id__</a>/TITLE:#', '<a href=\"$RT::WebPath/Ticket/Display.html?id=__id__\">__Subject__</a>/TITLE:Subject', OwnerName",
                                                                                                 
        Query => " Owner != '".$session{'CurrentUser'}->Id."' AND Owner != 10 AND ( Status = 'new' OR Status = 'open')",
        OrderBy => 'Priority',
        Order => 'DESC',
        Rows => $rows,
        ShowNavigation => 0
        &>
</&>


<%INIT>
my $rows = $RT::MyRequestsLength;
</%INIT>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OthersTickets.diff
Type: text/x-patch
Size: 504 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20041012/d7eb2d17/attachment.bin>


More information about the rt-users mailing list