<div dir="ltr"><div>Callbacks I get now, at least I'm pretty sure I do. I've been reading the docs for RT objects, and if I can use any of the properties and methods I've found, I can see how plugins are so powerful.<br><br></div>My sticking point now is modifying what's already there. I can remove items from a menu with deleteKey, but I haven't found a way to remove items from other areas of RT and replace them with my own. My ultimate goal, as I've said, is to redo the ticket history section on ticket summary and history pages, to make it easier to read and follow. I have an idea of how I'd make the display I want to see, but how do I also get rid of the default one? Callbacks let you insert your own functionality at certain points, but--understandably--they don't seem as willing to let you get at the existing structure. If I wanted to get rid of history and put in my own, or hide the time worked/estimated section entirely, could I do so? If I can, where is a good place to start reading about how? Thanks!<br><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 11, 2016 at 4:38 PM, Matt Zagrabelny <span dir="ltr"><<a href="mailto:mzagrabe@d.umn.edu" target="_blank">mzagrabe@d.umn.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey Alex,<br>
<span class=""><br>
On Tue, Oct 11, 2016 at 3:27 PM, Alex Hall <<a href="mailto:ahall@autodist.com">ahall@autodist.com</a>> wrote:<br>
> Hello list,<br>
> I'm considering trying out a callback. Ken suggested it as a way to add a<br>
> link to pages that will let users toggle between self-service and standard<br>
> interfaces, and I'm very much hoping I can use it to customize the way<br>
> history displays on ticket summary pages.<br>
><br>
> From what I've read so far, it seems like a callback is analogous to a<br>
> subclass. If I have a 'renderer' class that can make pretty text from raw<br>
> HTML, I might then subclass it and override the function that parses text to<br>
> make it work on XML. Yes, it's a very terrible example, but hopefully the<br>
> idea is correct.<br>
><br>
> Anyway, a callback in RT seems a lot like that. I want the ticket page to<br>
> display how it already does, but I don't like the history part. Thus, I copy<br>
> the file to the proper callback directory, then modify it. RT will, when it<br>
> knows it has to use Display.html, look in callbacks first and use my<br>
> version. Only if I don't provide one will it use the default one in<br>
> share/html/Tickets.<br>
><br>
> Do I have this right--copy the existing file to callbacks and modify it? Or<br>
> do I make a blank file, override only the bits I want to in there, and not<br>
> copy the whole thing? Am I thinking about callbacks all wrong?<br>
<br>
</span>You are thinking about Callbacks wrong. :)<br>
<br>
They are hook points in the HTML (Mason) of RT.<br>
<br>
Many (most?) RT extension will have some callbacks in them. Here is a<br>
nice easy one to get your feet wet:<br>
<br>
<a href="https://github.com/bestpractical/rt-extension-commentoncreate" rel="noreferrer" target="_blank">https://github.com/<wbr>bestpractical/rt-extension-<wbr>commentoncreate</a><br>
<br>
Take a look at the source for this extension and note the<br>
html/Callbacks directory. Then look in your RT share/html directory<br>
for where those callbacks would appear.<br>
<br>
In this particular instance, rt-extension-commentoncreate adds a<br>
"comment" box just below the "create" content box on the<br>
Ticket/Create.html page.<br>
<br>
So you can see from the source of the extension, it will add something<br>
to the AfterMessageBox callback in the Create.html Mason component.<br>
<br>
I'll let you dig a little bit more with this extension or another one<br>
to get more familiar with callbacks.<br>
<br>
Also, read the documentation:<br>
<br>
<a href="https://docs.bestpractical.com/rt/4.4.1/writing_extensions.html#Callbacks" rel="noreferrer" target="_blank">https://docs.bestpractical.<wbr>com/rt/4.4.1/writing_<wbr>extensions.html#Callbacks</a><br>
<span class="HOEnZb"><font color="#888888"><br>
-m<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div>Alex Hall<br></div>Automatic Distributors, IT department<br></div><a href="mailto:ahall@autodist.com" target="_blank">ahall@autodist.com</a><br></div></div>
</div></div></div></div>