Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Users

Extending the RT UI

 

 

Request Tracker users RSS feed   Index | Next | Previous | View Threaded


drasar at ics

Aug 13, 2012, 5:39 AM

Post #1 of 3 (267 views)
Permalink
Extending the RT UI

Hi,

with the move from RT 3.8.7 to 4.0.6, I have decided (or was forced to
by changes in RT html code) to ditch onload scripts that extended RT
Ticket UI with some functionality (getting abuse contacts by clicking on
ip, etc.). I would, however, still like to have that functionality, but
this time in a saner manner as a server side perl script.

I have browsed the RT source and it seems to me, that the final
processing of ticket attachments to display is done in the
Ticket/Element/ShowMessageStanza component. There is a callback called
that passes a reference to an attachment content, so it seems to me that
providing my callback to alter it would be the best way to do it.

My questions are following:
- Is this the right approach to extend the UI?
- If not, what would you suggest?
- If so, how can I create/hook/use the callback?
According to the documentation of lib/RT/Interface/Web/Request.pm that
defines the callback function, all callbacks are in
/Callbacks/<any_dir>/CallbackPage/CallbackName. Should the /Callbacks
dir be in main RT directory or could it be somewhere in the
/rt_dir/local? Also what is the true purpose of <any_dir>? The
documentation uses MyExtension as an example, but the name 'MyExtension'
is apparently not used as a discriminator or anything...

Thank you,
Martin


falcone at bestpractical

Aug 13, 2012, 7:48 AM

Post #2 of 3 (246 views)
Permalink
Re: Extending the RT UI [In reply to]

On Mon, Aug 13, 2012 at 02:39:19PM +0200, Martin Drasar wrote:
> I have browsed the RT source and it seems to me, that the final
> processing of ticket attachments to display is done in the
> Ticket/Element/ShowMessageStanza component. There is a callback called
> that passes a reference to an attachment content, so it seems to me that
> providing my callback to alter it would be the best way to do it.
>
> My questions are following:
> - Is this the right approach to extend the UI?
> - If not, what would you suggest?
> - If so, how can I create/hook/use the callback?
> According to the documentation of lib/RT/Interface/Web/Request.pm that
> defines the callback function, all callbacks are in
> /Callbacks/<any_dir>/CallbackPage/CallbackName. Should the /Callbacks
> dir be in main RT directory or could it be somewhere in the
> /rt_dir/local? Also what is the true purpose of <any_dir>? The
> documentation uses MyExtension as an example, but the name 'MyExtension'
> is apparently not used as a discriminator or anything...

You're on the right track, you may find this useful:
http://requesttracker.wikia.com/wiki/CustomizingWithCallbacks

In general, if you're not writing an extension, your callbacks go in
/opt/rt4/local/html/Callbacks/YourUniqueCallbackName/path/to/callback

As you've noted, YourUniqueCallbackName isn't tied to anything, it's
just there because two extensions can use the same callback, but they
need to be in distinct paths for mason to find them.

-kevin


drasar at ics

Aug 13, 2012, 7:58 AM

Post #3 of 3 (247 views)
Permalink
Re: Extending the RT UI [In reply to]

On 13.8.2012 16:48, Kevin Falcone wrote:
> You're on the right track, you may find this useful:
> http://requesttracker.wikia.com/wiki/CustomizingWithCallbacks
>
> In general, if you're not writing an extension, your callbacks go in
> /opt/rt4/local/html/Callbacks/YourUniqueCallbackName/path/to/callback
>
> As you've noted, YourUniqueCallbackName isn't tied to anything, it's
> just there because two extensions can use the same callback, but they
> need to be in distinct paths for mason to find them.
>
> -kevin

Hi Kevin,

thanks a lot. This is definitely what I was looking for.

Martin

Request Tracker users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.