Hi Torben, you should move your callback from /usr/local/share/request-tracker3.8/html/Callbacks/Ticket/Elements/Tabs/Default to /usr/local/share/request-tracker3.8/html/Callbacks/MyCallbacks/Ticket/Elements/Tabs/Default and replace MyCallbacks with a name of your choice. Restart the webserver and everything should be fine.
You should take a look at: http://wiki.bestpractical.com/view/CustomizingWithCallbacks Chris Am 21.07.2010 09:50, schrieb Nehmer Torben: > Good morning, > > > > I am currently trying to customize RTs Action Listing in the top of the > Ticket Display (Comment, Correspond, Forward, Resolve). I am using > callbacks, but they do not invoke as expected. As a basic idea I have > been using the example of Dirk Pape, specifically > http://page.mi.fu-berlin.de/dirkpape/rt3/Callbacks/MI/Ticket/Elements/Tabs/Default > > > > The code I am actually using looks like this: > > > > <%INIT> > > if ($Ticket) { > > # overwrite the default Action for Resolve to Correspond > > if ( $Ticket->CurrentUserHasRight('ModifyTicket') && ( > $Ticket->Status ne 'resolved' ) ) { > > $actions->{'G'}->{'path'} = > "Ticket/Update.html?Action=Respond&DefaultStatus=resolved&id=".$Ticket->id; > > } > > > > # Set To Test > > if ( $Ticket->CurrentUserHasRight('ModifyTicket') && ( > $Ticket->Status ne 'test' ) ) { > > $actions->{'T'} = { > > title => 'Test', > > path => > "Ticket/Update.html?Action=Respond&DefaultStatus=test&id=" > > . $Ticket->id }; > > } > > > > # Add as Watcher > > if ( $Ticket->CurrentUserHasRight('Watch') ) { > > $actions->{'W'} = { > > title => loc('Watch'), > > path => > 'Ticket/ModifyPeople.html?Ticket-AddWatcher-Principal-' > > . $Ticket->CurrentUser->id > > . '=Cc&id='.$Ticket->id }; > > } > > > > } > > # $actions->{'ZZ2'} = { title => 'test2', path => 'test2' }; > > </%INIT> > > <%ARGS> > > $Ticket => undef > > $actions => undef > > </%ARGS> > > > > The callback actually gets called, if I uncomment the “ZZ2” entry, it > gets shown as expected. Unfortunately, the $Ticket object is undefined > and thus breaks the entire idea. > > > > I am using RT 3.8.8 installed from Debian packages, the callback has > been placed into > /usr/local/share/request-tracker3.8/html/Callbacks/Ticket/Elements/Tabs/Default. > > > > I would appreciate any hints, why this does not work. > > > > Best regards, > Torben Nehmer > Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
