1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2014 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' );
50 <div class="ticket-transaction">
51 % $m->callback( titlebar_cmd => \$titlebar_commands, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyCommand' );
52 <div class="metadata">
54 <a name="txn-<% $Transaction->Id %>" href="<% $DisplayPath %>#txn-<% $Transaction->Id %>">#</a>\
55 <% $LastTransaction ? '<a id="lasttrans" name="lasttrans"></a>' : ''|n %>
57 % $m->callback( Transaction => $Transaction, %ARGS, CallbackName => 'AfterAnchor' );
58 <span class="date"><% $transdate|n %></span>
59 % my $desc = $Transaction->BriefDescription;
60 % $m->callback( text => \$desc, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyDisplay' );
61 <span class="description">\
62 <& /Elements/ShowUser, User => $Transaction->CreatorObj &> - <% $TicketString %> <% $desc %>\
63 % $m->callback( Transaction => $Transaction, %ARGS, CallbackName => 'AfterDescription' );
65 % $m->callback( TimeTaken => \$TimeTaken, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyTimeTaken' );
66 <span class="time-taken"><% $TimeTaken %></span>\
67 <span class="actions<% $titlebar_commands ? '': ' hidden'%>"><% $titlebar_commands |n %></span>
70 % if ( $type_class eq 'message' ) {
71 <& /Elements/ShowCustomFields, Object => $Transaction &>
73 % $m->comp('ShowTransactionAttachments', %ARGS, Parent => 0) unless ($Collapsed ||!$ShowBody);
82 $ShowTitleBarCommands => 1
84 $DisplayPath => RT->Config->Get('WebPath')."/Ticket/Display.html?id=".$Ticket->id
85 $AttachPath => RT->Config->Get('WebPath')."/Ticket/Attachment"
86 $UpdatePath => RT->Config->Get('WebPath')."/Ticket/Update.html"
87 $ForwardPath => RT->Config->Get('WebPath')."/Ticket/Forward.html"
88 $EncryptionPath => RT->Config->Get('WebPath')."/Ticket/GnuPG.html"
89 $EmailRecordPath => RT->Config->Get('WebPath')."/Ticket/ShowEmailRecord.html"
91 $AttachmentContent => undef
94 $WarnUnsigned => undef
99 Correspond => 'message',
100 Comment => 'message',
102 AddWatcher => 'people',
103 DelWatcher => 'people',
111 DeleteLink => 'links',
117 my $transdate = $Transaction->CreatedAsString();
118 $transdate =~ s/\s/ /g;
120 my ($type, $field) = ($Transaction->Type, $Transaction->Field || '');
121 my $type_class = $class{ $type };
122 if ( $type eq 'Create' && $Transaction->ObjectType eq 'RT::Ticket' ) {
123 $type_class = 'message';
126 unless ( $type_class ) {
127 if ( $field eq 'Owner' ) {
128 $type_class = 'people';
130 elsif ( $type =~ /^(Status|Set|Told)$/ ) {
131 if ( $field =~ /^(Told|Starts|Started|Due)$/ ) {
132 $type_class = 'dates';
135 $type_class = 'basics';
139 $type_class = 'other';
144 CallbackName => 'MassageTypeClass',
145 Transaction => $Transaction,
146 TypeClassRef => \$type_class,
150 my $TicketString = '';
151 if ( $Ticket->Id != $Transaction->Ticket ) {
152 $TicketString = loc("Ticket #[_1]:", $Transaction->Ticket) .' ';
156 $TimeTaken = $Transaction->TimeTaken . " min"
157 if $Transaction->TimeTaken;
159 unless ($Attachments) {
160 my $attachments = $Transaction->Attachments;
161 $attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) );
162 $ARGS{'Attachments'} = $Attachments = $attachments->ItemsArrayRef();
164 my $titlebar_commands = '';
167 CallbackName => 'MassageAttachments',
168 Transaction => $Transaction,
169 AttachmentsRef => \$Attachments,
173 if ( $type =~ /EmailRecord$/ ) {
175 $titlebar_commands .=
176 "[<a target=\"_blank\" href=\"$EmailRecordPath?id="
177 . $Transaction->Ticket
181 . ( $Attachments->[0] && $Attachments->[0]->id )
182 . '">' . loc('Show') . "</a>] ";
187 # If the transaction has anything attached to it at all
190 if ( $Attachments->[0] && $ShowTitleBarCommands ) {
191 my $ticket = $Transaction->TicketObj;
192 my $can_modify = $ticket->CurrentUserHasRight('ModifyTicket');
193 if ( $can_modify || $ticket->CurrentUserHasRight('ReplyToTicket') ) {
194 $titlebar_commands .=
195 "[<a href=\"" . $UpdatePath
196 . "?id=" . $Transaction->Ticket
197 . "&QuoteTransaction=" . $Transaction->Id
198 . "&Action=Respond\" "
199 . "class=\"reply-link\""
204 if ( $can_modify || $ticket->CurrentUserHasRight('CommentOnTicket') ) {
205 $titlebar_commands .=
206 "[<a href=\"" . $UpdatePath
207 . "?id=" . $Transaction->Ticket
208 . "&QuoteTransaction=" . $Transaction->Id
209 . "&Action=Comment\" "
210 . "class=\"comment-link\""
215 if ( $ticket->CurrentUserHasRight('ForwardMessage') ) {
216 $titlebar_commands .=
217 "[<a href=\"" . $ForwardPath
218 . "?id=" . $Transaction->Ticket
219 . "&QuoteTransaction=" . $Transaction->Id ."\" "
220 . "class=\"forward-link\""
226 && RT->Config->Get('GnuPG')->{'Enable'}
227 && RT->Config->Get('GnuPG')->{'AllowEncryptDataInDB'}
228 && $ticket->CurrentUserHasRight('ForwardMessage')
230 $titlebar_commands .=
231 "[<a href=\"" . $EncryptionPath
232 . "?id=" . $Transaction->Id ."\" "
233 . "class=\"gpg-link\""
235 . loc('Encrypt/Decrypt')