Changing the "titlebar_commands" (reply/comment...)

Hi,

[RT 3.6.3 on FreeBSD 6.2 perl 5.8.8]

I had what seemed to me a simple problem to solve in RT. We regularly
receive spam and sometimes well, some gets through. I need to followup
on those spam and make sure those guys get beaten on the head properly.

For this I need the original email.

I figured the best way to get that was through the
Ticket/ShowEmailRecord.html link. Indeed, i could guess the proper
attachment and find the original message in those. But the link just
wasn’t there.

So I hacked it in. This required patching the
ShowTransaction/ModifyDisplay callback so that it allows modification of
the titlebar:

— ShowTransaction.orig Thu Jan 10 02:38:41 2008
+++ ShowTransaction Thu Jan 10 02:39:02 2008
@@ -52,7 +52,7 @@

<% $transdate|n %>
% my $desc = $Transaction->BriefDescription;
-% $m->comp(’/Elements/Callback’, _CallbackName => ‘ModifyDisplay’, text => $desc, Transaction => $Transaction, %ARGS);
+% $m->comp(’/Elements/Callback’, _CallbackName => ‘ModifyDisplay’, text => $desc, titlebar_commands => $titlebar_commands, Transaction => $Transaction, %ARGS);

<%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$desc%>

I then added the following callback in Callbacks/Koumbit/Ticket/Elements/ShowTransaction/ModifyDisplay:

<%init>
if ( $Transaction->Type =~ /Create$/ ) {
$$titlebar_commands .=
" [<a target="_blank" href="$EmailRecordPath?id="
. $Transaction->Ticket
. “&Transaction=”
. $Transaction->Id
. “&Attachment=”
. ( $Transaction->Attachments->First
&& $Transaction->Attachments->First->Id )
. ‘">’ . loc(‘Show’) . “] “;
}
</%init>
<%args>
$text => undef;
$Transaction => undef;
$titlebar_commands => undef;
$EmailRecordPath => $RT::WebPath.”/Ticket/ShowEmailRecord.html”
</%args>

Now, my question is:

  1. is this the proper way?

  2. Why doesn’t the “show” link give me the complete email on multipart
    messages?

  3. is my main point here of course, since the first one is mostly
    academic. Basically, my problem remains. As soon as the ticket was
    created from a multipart message, I still can’t get the full picture.

Any ideas?

Thanks,

Antoine Beaupré
Réseau Koumbit Networks
+1.514.387.6262

signature.asc (189 Bytes)