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 %> <% $RowNum % 2 ? 'odd' : 'even' %>">
49 % $m->callback( titlebar_cmd => \$titlebar_commands, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyDisplay' );
51 <div class="ticket-transaction">
52 % $m->callback( titlebar_cmd => \$titlebar_commands, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyCommand' );
53 <div class="metadata">
55 <a name="txn-<% $Transaction->Id %>" href="<% $DisplayPath %>#txn-<% $Transaction->Id %>">#</a>
56 <% $LastTransaction ? '<a id="lasttrans" name="lasttrans"></a>' : ''|n %>
58 % $m->callback( Transaction => $Transaction, %ARGS, CallbackName => 'AfterAnchor' );
59 <span class="date"><% $transdate|n %></span>
60 % my $desc = $Transaction->BriefDescription;
61 % $m->callback( text => \$desc, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyDisplay' );
62 <span class="description">
63 <& /Elements/ShowUser, User => $Transaction->CreatorObj &> - <% $TicketString %> <% $desc %>
64 % $m->callback( Transaction => $Transaction, %ARGS, CallbackName => 'AfterDescription' );
66 % $m->callback( TimeTaken => \$TimeTaken, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyTimeTaken' );
67 <span class="time-taken"><% $TimeTaken %></span>
68 <span class="actions<% $titlebar_commands ? '': ' hidden'%>"><% $titlebar_commands |n %></span>
72 % if ( $Transaction->CustomFieldValues->Count ) {
73 <& /Elements/ShowCustomFields, Object => $Transaction &>
75 % $m->comp('ShowTransactionAttachments', %ARGS, Parent => 0) unless ($Collapsed ||!$ShowBody);
86 $ShowTitleBarCommands => 1
88 $DisplayPath => RT->Config->Get('WebPath')."/Ticket/Display.html?id=".$Ticket->id
89 $AttachPath => RT->Config->Get('WebPath')."/Ticket/Attachment"
90 $UpdatePath => RT->Config->Get('WebPath')."/Ticket/Update.html"
91 $ForwardPath => RT->Config->Get('WebPath')."/Ticket/Forward.html"
92 $EncryptionPath => RT->Config->Get('WebPath')."/Ticket/GnuPG.html"
93 $EmailRecordPath => RT->Config->Get('WebPath')."/Ticket/ShowEmailRecord.html"
95 $AttachmentContent => undef
98 $WarnUnsigned => undef
104 Correspond => 'message',
105 Comment => 'message',
107 AddWatcher => 'people',
108 DelWatcher => 'people',
116 DeleteLink => 'links',
122 my $transdate = $Transaction->CreatedAsString();
123 $transdate =~ s/\s/ /g;
125 my ($type, $field) = ($Transaction->Type, $Transaction->Field || '');
126 my $type_class = $class{ $type };
128 unless ( $type_class ) {
129 if ( $field eq 'Owner' ) {
130 $type_class = 'people';
132 elsif ( $type =~ /^(Status|Set|Told)$/ ) {
133 if ( $field =~ /^(Told|Starts|Started|Due)$/ ) {
134 $type_class = 'dates';
137 $type_class = 'basics';
141 $type_class = 'other';
145 my $TicketString = '';
146 if ( $Ticket->Id != $Transaction->Ticket ) {
147 $TicketString = loc("Ticket #[_1]:", $Transaction->Ticket) .' ';
151 $TimeTaken = $Transaction->TimeTaken . " min"
152 if $Transaction->TimeTaken;
154 unless ($Attachments) {
155 my $attachments = $Transaction->Attachments;
156 $attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) );
157 $ARGS{'Attachments'} = $Attachments = $attachments->ItemsArrayRef();
159 my $titlebar_commands = '';
161 if ( $type =~ /EmailRecord$/ ) {
163 $titlebar_commands .=
164 "[<a target=\"_blank\" href=\"$EmailRecordPath?id="
165 . $Transaction->Ticket
169 . ( $Attachments->[0] && $Attachments->[0]->id )
170 . '">' . loc('Show') . "</a>] ";
175 # If the transaction has anything attached to it at all
178 if ( $Attachments->[0] && $ShowTitleBarCommands ) {
179 my $ticket = $Transaction->TicketObj;
180 my $can_modify = $ticket->CurrentUserHasRight('ModifyTicket');
181 if ( $can_modify || $ticket->CurrentUserHasRight('ReplyToTicket') ) {
182 $titlebar_commands .=
183 "[<a href=\"".$UpdatePath
184 . "?id=" . $Transaction->Ticket
185 . "&QuoteTransaction=" . $Transaction->Id
186 . "&Action=Respond\">"
190 if ( $can_modify || $ticket->CurrentUserHasRight('CommentOnTicket') ) {
191 $titlebar_commands .=
192 "[<a href=\"".$UpdatePath."?id="
193 . $Transaction->Ticket
194 . "&QuoteTransaction="
196 . "&Action=Comment\">"
197 . loc('Comment') . "</a>]";
199 if ( $ticket->CurrentUserHasRight('ForwardMessage') ) {
200 $titlebar_commands .=
201 "[<a href=\"". $ForwardPath
202 . "?id=". $Transaction->Ticket
203 . "&QuoteTransaction=". $Transaction->Id
204 . "\">". loc('Forward') . "</a>]";
207 && RT->Config->Get('GnuPG')->{'Enable'}
208 && RT->Config->Get('GnuPG')->{'AllowEncryptDataInDB'}
209 && $ticket->CurrentUserHasRight('ForwardMessage')
211 $titlebar_commands .=
212 "[<a href=\"". $EncryptionPath
213 . "?id=". $Transaction->Id
214 . "\">". loc('Encrypt/Decrypt') . "</a>]";