[rt-users] Adding a Spam Ticket Tab

Stephen Turner sturner at MIT.EDU
Wed Nov 8 15:20:03 EST 2006


> -----Original Message-----
> Hello all,
> 
> I found that someone has done this already and I have 
> implemented it in
> our RT setup:
> 
> but it is not working and I just don't understand why. Here is what I
> added to /opt/rt3/share/html/Ticket/Elements/Tabs
> 
> if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) {
>     if ( $Ticket->Status ne 'resolved' ) {
>         $actions->{'B'} = {
> 
>              path => 
> "Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=" . $id,
>             title => loc('Resolve') };
>     }
>     if ( $Ticket->Status ne 'open' ) {
>          $actions->{'C'} = { path => 
> "Ticket/Display.html?Status=open&id=" . $id,
>                             title => loc('Open it') };
>     }
>     # Spam stuff.
>     if ( $Ticket->CurrentUserHasRight('DeleteTicket') ) {
>         $actions->{'G'} = {
>                    title => loc('Spam'),
>                     path  => 
> "Ticket/Modify.html?id=$id&Status=deleted&Queue=16" };
>     }
> }
> 
> However, I don't see any change at all. What else do I have to do to 
> get this working. Note that I'm
> using RT 3.4.4.
> 
> --
> Bernd
> 

Bernd,

Did you stop & restart apache after making the change?

Generally, it's the best practice to make changes to "local" copies of the
RT files rather than editing them directly (see
http://wiki.bestpractical.com/index.cgi?CleanlyCustomizeRT). In your setup,
you'd copy the Tabs file to /opt/rt3/local/html/Ticket/Elements and edit
that file.

Actually, in this case there's a callback for extending the Tabs - you
shouldn't even need to edit the Tabs file. If you create
/opt/rt3/local/html/Callbacks/xxxxx/Ticket/Elements/Tabs/Default and make it
look like this, you should be all set:

%# BEGIN CODE
<%args>
$Ticket => undef
$actions => undef
$tabs => undef
$display_page => 'Display'
</%args>

<%init>
if ( defined $Ticket && $Ticket->CurrentUserHasRight('DeleteTicket') ) {
   $actions->{'G'} = {
              title => loc('Spam'),
              path  =>
'Ticket/Modify.html?id='.$Ticket->id.'&Status=deleted' };
}
</%init>
%# END CODE


Make sure the key you choose for the actions hash ('G' in this case) is not
used in the stock Tabs file.

Steve

----------------------------------------
Stephen Turner
Senior Programmer/Analyst - Client Support Services
MIT Information Services and Technology (IS&T)
  




More information about the rt-users mailing list