1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
6 %# <sales@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%> <% $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';
146 CallbackName => 'MassageTypeClass',
147 Transaction => $Transaction,
148 TypeClassRef => \$type_class,
152 my $TicketString = '';
153 if ( $Ticket->Id != $Transaction->Ticket ) {
154 $TicketString = loc("Ticket #[_1]:", $Transaction->Ticket) .' ';
158 $TimeTaken = $Transaction->TimeTaken . " min"
159 if $Transaction->TimeTaken;
161 unless ($Attachments) {
162 my $attachments = $Transaction->Attachments;
163 $attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) );
164 $ARGS{'Attachments'} = $Attachments = $attachments->ItemsArrayRef();
166 my $titlebar_commands = '';
169 CallbackName => 'MassageAttachments',
170 Transaction => $Transaction,
171 AttachmentsRef => \$Attachments,
175 if ( $type =~ /EmailRecord$/ ) {
177 $titlebar_commands .=
178 "[<a target=\"_blank\" href=\"$EmailRecordPath?id="
179 . $Transaction->Ticket
183 . ( $Attachments->[0] && $Attachments->[0]->id )
184 . '">' . loc('Show') . "</a>] ";
189 # If the transaction has anything attached to it at all
192 if ( $Attachments->[0] && $ShowTitleBarCommands ) {
193 my $ticket = $Transaction->TicketObj;
194 my $can_modify = $ticket->CurrentUserHasRight('ModifyTicket');
195 if ( $can_modify || $ticket->CurrentUserHasRight('ReplyToTicket') ) {
196 $titlebar_commands .=
197 "[<a href=\"".$UpdatePath
198 . "?id=" . $Transaction->Ticket
199 . "&QuoteTransaction=" . $Transaction->Id
200 . "&Action=Respond\">"
204 if ( $can_modify || $ticket->CurrentUserHasRight('CommentOnTicket') ) {
205 $titlebar_commands .=
206 "[<a href=\"".$UpdatePath."?id="
207 . $Transaction->Ticket
208 . "&QuoteTransaction="
210 . "&Action=Comment\">"
211 . loc('Comment') . "</a>]";
213 if ( $ticket->CurrentUserHasRight('ForwardMessage') ) {
214 $titlebar_commands .=
215 "[<a href=\"". $ForwardPath
216 . "?id=". $Transaction->Ticket
217 . "&QuoteTransaction=". $Transaction->Id
218 . "\">". loc('Forward') . "</a>]";
221 && RT->Config->Get('GnuPG')->{'Enable'}
222 && RT->Config->Get('GnuPG')->{'AllowEncryptDataInDB'}
223 && $ticket->CurrentUserHasRight('ForwardMessage')
225 $titlebar_commands .=
226 "[<a href=\"". $EncryptionPath
227 . "?id=". $Transaction->Id
228 . "\">". loc('Encrypt/Decrypt') . "</a>]";