1 <TR bgcolor="<%$rowbgcolor%>">
2 <TD bgcolor="<%$bgcolor%>"><A NAME="#<%$Transaction->Id%>"></A>  </TD>
4 <TD><font size=-2><% $transdate|n %></font> </TD>
5 <TD ALIGN="LEFT"><b><%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$Transaction->BriefDescription%>
8 <TD><%$TimeTaken%> </TD>
9 <TD ALIGN="RIGHT"><font size=-1><%$titlebar_commands|n%></font></TD>
14 $attachments->GotoFirstItem;
15 while (my $message=$attachments->Next) {
16 #we don't want to show any empty transactions, unless they have kids
17 next unless (length $message->Content || $message->Children->Count);
18 my ($headers, $content);
24 if ($message->Parent == 0) {
25 if ($ShowHeaders == $Ticket->Id) {
26 $headers = $message->Headers;
28 $headers = $message->NiceHeaders;
31 $headers .= "\n\n" if ($headers);
33 # 13456 is a random # of about the biggest size we want to see inline text
34 my $MAX_INLINE_BODY = 13456;
35 if ($message->ContentType =~ m{^(text/plain|message|text$)}i &&
36 length($message->Content)< $MAX_INLINE_BODY ) {
38 $content = $message->Content;
40 my $wrapper = new Text::Wrapper (columns=>85);
41 $content = $wrapper->wrap($content);
42 $content =~ s/&/&/g;
43 $content =~ s/</</g;
44 $content =~ s/>/>/g;
45 $content =~ s!((?:http|https|ftp|mailto):\S*?)([\s"']|>|\.[\n])!<A HREF=\"$1\" TARGET=new>$1</A>$2!g;
54 <TR BGCOLOR="<%$rowbgcolor%>">
55 <TD BGCOLOR="<%$bgcolor%>"> </TD>
57 <TD COLSPAN=3 VALIGN=TOP>
59 <%$headers%><%$content|n%>
62 <TD VALIGN=TOP ALIGN=RIGHT>
64 % if ($message->Parent == 0 ) {
68 my $size = length($message->Content());
72 $size = int($size/102.4)/10 . "k";
78 <font size=-1><A HREF="Attachment/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename%>">Download <%$message->Filename|| '(untitled)'%></a> <% $size %></font>
92 $ShowTitleBarCommands => 1
99 my ($TimeTaken, $TicketString, $bgcolor, $rowbgcolor);
101 my $transdate = $Transaction->CreatedAsString();
102 $transdate =~ s/\s/ /g;
105 $rowbgcolor="#cccccc";
107 $rowbgcolor="#ffffff";
110 if ($Transaction->Type =~ /^(Create|Correspond|Comment$)/) {
111 if ($Transaction->IsInbound) {
117 } elsif (($Transaction->Field =~ /^Owner$/) or
118 ($Transaction->Type =~ /^(AddWatcher|DelWatcher)$/)) {
121 } elsif ($Transaction->Type =~ /^(AddLink|DeleteLink)$/) {
123 } elsif ($Transaction->Type =~ /^(Status|Set|Keyword|Told)$/) {
124 if ($Transaction->Field =~ /^(Told|Starts|Started|Due)$/) {
135 if ($Ticket->Id != $Transaction->Ticket) {
136 $TicketString = "Ticket ".$Transaction->Ticket .": ";
139 if ($Transaction->TimeTaken > 0) {
140 $TimeTaken = $Transaction->TimeTaken." min"
142 my $attachments = $Transaction->Attachments;
144 my $titlebar_commands=' ';
146 # If the transaction has anything attached to it at all
147 if ($Transaction->Message->First && $ShowTitleBarCommands) {
148 if ($Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket')) {
149 $titlebar_commands .=
150 "[<a href=\"Update.html?id=".
151 $Transaction->Ticket . "&QuoteTransaction=".$Transaction->Id.
152 "&Action=Respond\">Reply</a>] ";
154 if ($Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket')) {
155 $titlebar_commands .=
156 "[<a href=\"Update.html?id=".$Transaction->Ticket.
157 "&QuoteTransaction=".$Transaction->Id.
158 "&Action=Comment\">Comment</a>]";