3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 %# (Except where explictly superceded by other copyright notices)
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 %# General Public License for more details.
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
24 <TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>" >
25 <TD bgcolor="<%$bgcolor%>"><A NAME="txn-<%$Transaction->Id%>" href="#txn-<%$Transaction->Id%>">#</A> </TD>
27 <TD><font size=-2><% $transdate|n %></font> </TD>
28 % my $desc = $Transaction->BriefDescription;
29 % $m->comp('/Elements/Callback', _CallbackName => 'ModifyDisplay', text => \$desc, Transaction => $Transaction, %ARGS);
30 <TD ALIGN="LEFT"><b><%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$desc%>
33 <TD><%$TimeTaken%> </TD>
34 <TD ALIGN="RIGHT"><font size=-1><%$titlebar_commands|n%></font></TD>
39 $attachments->GotoFirstItem;
40 while (my $message=$attachments->Next) {
41 #we don't want to show any empty transactions, unless they have kids
42 next unless ($message->ContentLength || $message->Children->Count);
44 my ($headers, $quoted);
45 if ($ShowHeaders && ($ShowHeaders == $Ticket->Id)) {
46 $headers = $message->Headers;
48 $headers = $message->NiceHeaders;
52 # localize the common headers (like 'Subject:'), too.
53 eval {$headers =~ s/^([^:]+)(?=:)/loc($1)/em; } # we eval here to catch errors when 5.6 panics
55 # 13456 is a random # of about the biggest size we want to see inline text
56 my $MAX_INLINE_BODY = 13456;
57 if ($message->ContentType =~ m{^(text/plain|message|text$)}i &&
58 $message->ContentLength < $MAX_INLINE_BODY ) {
60 $quoted = Text::Quoted::extract($message->Content);
64 <TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>" >
65 <TD BGCOLOR="<%$bgcolor%>"> </TD>
67 <TD COLSPAN=3 VALIGN=TOP>
68 <span class="message">
70 <& ShowMessageHeaders, Headers => $headers, Transaction => $Transaction &>
72 <& ShowMessageStanza, Depth => 0, Message => $quoted, Transaction => $Transaction &>
75 <TD VALIGN=TOP ALIGN=RIGHT>
77 % if ($message->Parent == 0 ) {
81 my $size = $message->ContentLength;
85 $size = loc("[_1]k", int($size/102.4)/10);
88 $size = loc("[_1]b", $size);
91 <font size=-1><A HREF="<%$RT::WebPath%>/Ticket/Attachment/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename%>"><&|/l&>Download</&> <% $message->Filename|| loc('(untitled)') %></a> <% $size %></font>
102 $Transaction => undef
105 $ShowTitleBarCommands => 1
112 my ($TimeTaken, $TicketString, $bgcolor);
114 my $transdate = $Transaction->CreatedAsString();
115 $transdate =~ s/\s/ /g;
117 if ($Transaction->Type =~ /^(Create|Correspond|Comment$)/) {
118 if ($Transaction->IsInbound) {
124 } elsif (($Transaction->Field =~ /^Owner$/) or
125 ($Transaction->Type =~ /^(AddWatcher|DelWatcher)$/)) {
128 } elsif ($Transaction->Type =~ /^(AddLink|DeleteLink)$/) {
130 } elsif ($Transaction->Type =~ /^(Status|Set|Told)$/) {
131 if ($Transaction->Field =~ /^(Told|Starts|Started|Due)$/) {
142 if ($Ticket->Id != $Transaction->Ticket) {
143 $TicketString = "Ticket ".$Transaction->Ticket .": ";
146 if ($Transaction->TimeTaken > 0) {
147 $TimeTaken = $Transaction->TimeTaken." min"
149 my $attachments = $Transaction->Attachments;
151 my $titlebar_commands=' ';
153 # If the transaction has anything attached to it at all
154 if ($Transaction->Attachments->First && $ShowTitleBarCommands) {
155 if ($Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket')) {
156 $titlebar_commands .=
157 "[<a href=\"Update.html?id=".
158 $Transaction->Ticket . "&QuoteTransaction=".$Transaction->Id.
159 "&Action=Respond\">". loc('Reply') ."</a>] ";
161 if ($Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket')) {
162 $titlebar_commands .=
163 "[<a href=\"Update.html?id=".$Transaction->Ticket.
164 "&QuoteTransaction=".$Transaction->Id.
165 "&Action=Comment\">". loc('Comment') ."</a>]";