1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
6 %# <jesse@bestpractical.com>
8 %# (Except where explicitly superseded by other copyright notices)
13 %# This work is made available to you under the terms of Version 2 of
14 %# the GNU General Public License. A copy of that license should have
15 %# been provided with this software, but in any event can be snarfed
18 %# This work is distributed in the hope that it will be useful, but
19 %# WITHOUT ANY WARRANTY; without even the implied warranty of
20 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 %# General Public License for more details.
23 %# You should have received a copy of the GNU General Public License
24 %# along with this program; if not, write to the Free Software
25 %# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 %# 02110-1301 or visit their web page on the internet at
27 %# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
30 %# CONTRIBUTION SUBMISSION POLICY:
32 %# (The following paragraph is not intended to limit the rights granted
33 %# to you to modify and distribute this software under the terms of
34 %# the GNU General Public License and is only of importance to you if
35 %# you choose to contribute your changes and enhancements to the
36 %# community by submitting them to Best Practical Solutions, LLC.)
38 %# By intentionally submitting any modifications, corrections or
39 %# derivatives to this work, or any other work intended for use with
40 %# Request Tracker, to Best Practical Solutions, LLC, you confirm that
41 %# you are the copyright holder for those contributions and you grant
42 %# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
43 %# royalty-free, perpetual, license to use, copy, create derivative
44 %# works based on those contributions, and sublicense and distribute
45 %# those contributions and any derivatives thereof.
47 %# END BPS TAGGED BLOCK }}}
48 <div class="ticket-transaction<% $type_class && " $type_class" %><% $RowNum % 2 ? ' odd' : ' even' %>">
49 % $m->comp('/Elements/Callback', _CallbackName => 'ModifyDisplay', titlebar_cmd => \$titlebar_commands, Transaction => $Transaction, %ARGS);
51 <table width="100%" cellspacing="0" cellpadding="2" border="0">
53 <td rowspan="2" valign="top" class="type">
54 <a name="txn-<%$Transaction->Id%>" href="<% $DisplayPath %>#txn-<%$Transaction->Id%>">#</a>
55 <% $LastTransaction ? '<a name="lasttrans"> </a>' : ' ' |n %>
57 <td class="date"><% $transdate|n %></td>
58 % my $desc = $Transaction->BriefDescription;
59 % $m->comp('/Elements/Callback', _CallbackName => 'ModifyDisplay', text => \$desc, Transaction => $Transaction, %ARGS);
60 <td class="description">
61 <%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$desc%>
63 <td class="time-taken"><%$TimeTaken%></td>
64 <td class="actions"><%$titlebar_commands|n%></td>
68 <td colspan="4" class="content">
69 % if ($Transaction->CustomFieldValues->Count) {
70 <& /Elements/ShowCustomFields, Object => $Transaction &>
72 % $m->comp('ShowTransactionAttachments', %ARGS, Parent => 0) unless ($Collapsed ||!$ShowBody);
84 $ShowTitleBarCommands => 1
86 $DisplayPath => $RT::WebPath."/Ticket/Display.html?id=".$Ticket->id
87 $AttachPath => $RT::WebPath."/Ticket/Attachment"
88 $UpdatePath => $RT::WebPath."/Ticket/Update.html"
89 $EmailRecordPath => $RT::WebPath."/Ticket/ShowEmailRecord.html"
91 $AttachmentContent => undef
98 my ( $TimeTaken, $TicketString, $type_class );
100 my $transdate = $Transaction->CreatedAsString();
101 $transdate =~ s/\s/ /g;
103 if ( $Transaction->Type =~ /^(Create|Correspond|Comment$)/ ) {
104 if ( $Transaction->IsInbound ) {
105 $type_class = 'message';
108 $type_class = 'message';
111 elsif ( ( $Transaction->Field =~ /^Owner$/ )
112 or ( $Transaction->Type =~ /^(AddWatcher|DelWatcher)$/ ) ) {
113 $type_class = 'people';
116 elsif ( $Transaction->Type =~ /^(AddLink|DeleteLink)$/ ) {
117 $type_class = 'links';
119 elsif ( $Transaction->Type =~ /^(Status|Set|Told)$/ ) {
120 if ( $Transaction->Field =~ /^(Told|Starts|Started|Due)$/ ) {
121 $type_class = 'dates';
124 $type_class = 'basics';
128 $type_class = 'other';
131 if ( $Ticket->Id != $Transaction->Ticket ) {
132 $TicketString = "Ticket " . $Transaction->Ticket . ": ";
134 $TicketString ||= '';
136 if ( $Transaction->TimeTaken != 0 ) {
137 $TimeTaken = $Transaction->TimeTaken . " min";
142 unless ($Attachments) {
143 my $attachments = $Transaction->Attachments;
144 $attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) );
145 $Attachments = $attachments->ItemsArrayRef();
147 my $titlebar_commands = ' ';
149 my @DisplayHeaders=qw ( _all);
151 if ( $Transaction->Type =~ /EmailRecord$/ ) {
152 @DisplayHeaders = qw(To Cc Bcc);
154 $titlebar_commands .=
155 "[<a target=\"_blank\" href=\"$EmailRecordPath?id="
156 . $Transaction->Ticket
160 . ( $Attachments->[0] && $Attachments->[0]->id )
161 . '">' . loc('Show') . "</a>] ";
166 # If the transaction has anything attached to it at all
169 unless ( $ShowHeaders ) {
170 @DisplayHeaders = qw(To From RT-Send-Cc Cc Bcc Date Subject);
173 if ( $Attachments->[0] && $ShowTitleBarCommands ) {
174 if ( $Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket')
175 or $Transaction->TicketObj->CurrentUserHasRight('ModifyTicket')) {
176 $titlebar_commands .=
177 "[<a href=\"".$UpdatePath."?id="
178 . $Transaction->Ticket
179 . "&QuoteTransaction="
181 . "&Action=Respond\">"
185 if ( $Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket')
186 or $Transaction->TicketObj->CurrentUserHasRight('ModifyTicket')) {
187 $titlebar_commands .=
188 "[<a href=\"".$UpdatePath."?id="
189 . $Transaction->Ticket
190 . "&QuoteTransaction="
192 . "&Action=Comment\">"
193 . loc('Comment') . "</a>]";