[rt-users] Adding a Spam Ticket Tab

berndlosert at aim.com berndlosert at aim.com
Wed Nov 8 16:41:09 EST 2006


> Did you stop & restart apache after making the change?                

                                                                         

Yes I did but nothing happened.                                         

                                                                         

> 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.                                                            

                                                                         

Interesting. I never knew that.                                         

                                                                         

> 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.                                          

                                                                         

Thanks for the help Steve. That worked perfectly. I will continue       

to investigate this callback mechanism. It's pretty cool.               

                                                                         

--                                                                      

Bernd
________________________________________________________________________
Check Out the new free AIM(R) Mail -- 2 GB of storage and 
industry-leading spam and email virus protection.




More information about the rt-users mailing list