summaryrefslogtreecommitdiff
path: root/rt/html/Ticket/Elements/ShowHistory
diff options
context:
space:
mode:
authorivan <ivan>2004-11-11 12:13:50 +0000
committerivan <ivan>2004-11-11 12:13:50 +0000
commitc582e92888b4a5553e1b4e5214cf35217e4a0cf0 (patch)
tree3fe7cd7bf22bd356b478f0de0dd8f0b140fcee23 /rt/html/Ticket/Elements/ShowHistory
parent289340780927b5bac2c7604d7317c3063c6dd8cc (diff)
import rt 3.0.12
Diffstat (limited to 'rt/html/Ticket/Elements/ShowHistory')
-rw-r--r--rt/html/Ticket/Elements/ShowHistory66
1 files changed, 55 insertions, 11 deletions
diff --git a/rt/html/Ticket/Elements/ShowHistory b/rt/html/Ticket/Elements/ShowHistory
index 194be9b37..c4fe41747 100644
--- a/rt/html/Ticket/Elements/ShowHistory
+++ b/rt/html/Ticket/Elements/ShowHistory
@@ -54,16 +54,50 @@ else {
% }
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0>
-% while (my $Transaction = $Transactions->Next) {
-% my $skip = 0;
-% $m->comp('/Elements/Callback', _CallbackName => 'SkipTransaction', Transaction => $Transaction, skip => \$skip, %ARGS);
-% next if $skip;
-% $i++;
-% if ($Transactions->IsLast) {
- <a name="lasttrans"></a>
-% }
- <& ShowTransaction, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, Collapsed => $Collapsed, RowNum => $i, ShowTitleBarCommands => $ShowTitleBarCommands, %ARGS &>
-% }
+<%perl>
+my @attachments = @{$Attachments->ItemsArrayRef()};
+my @attachment_content = @{$AttachmentContent->ItemsArrayRef()};
+
+
+
+
+
+while ( my $Transaction = $Transactions->Next ) {
+ my $skip = 0;
+ $m->comp( '/Elements/Callback',
+ _CallbackName => 'SkipTransaction',
+ Transaction => $Transaction,
+ skip => \$skip,
+ %ARGS );
+ next if $skip;
+ $i++;
+
+ $m->out('<a name="lasttrans"></a>') if ( $Transactions->IsLast );
+
+ my @trans_attachments = grep { $_->TransactionId == $Transaction->Id } @attachments;
+
+ my $trans_content = {};
+ grep { ($_->TransactionId == $Transaction->Id ) && ($trans_content->{$_->Id} = $_) } @attachment_content;
+
+
+ #Args is first because we're clobbering the "Attachments" parameter
+ $m->comp( 'ShowTransaction',
+ %ARGS,
+
+ AttachPath => $AttachPath,
+ UpdatePath => $UpdatePath,
+ Ticket => $Ticket,
+ Transaction => $Transaction,
+ ShowHeaders => $ShowHeaders,
+ Collapsed => $Collapsed,
+ RowNum => $i,
+ ShowTitleBarCommands => $ShowTitleBarCommands,
+ Attachments => \@trans_attachments,
+ AttachmentContent => $trans_content
+ );
+}
+
+</%perl>
</TABLE>
% if ($ShowDisplayModes or $ShowTitle) {
<& /Elements/TitleBoxEnd &>
@@ -74,13 +108,23 @@ my $Transactions = $Ticket->Transactions;
my $i;
+$Attachments ||= $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket);
+$AttachmentContent ||= $m->comp('/Ticket/Elements/LoadTextAttachments', Ticket => $Ticket);
+
+
+
</%INIT>
<%ARGS>
-$URIFile => 'Display.html'
+$URIFile => $RT::WebPath."/Ticket/Display.html"
$Ticket => undef
+$Attachments => undef
+$AttachmentContent => undef
$ShowHeaders => undef
$Collapsed => undef
$ShowTitle => 1
$ShowDisplayModes => 1
$ShowTitleBarCommands => 1
+$AttachPath => $RT::WebPath."/Ticket/Attachment"
+$UpdatePath => $RT::WebPath."/Ticket/Update.html"
+
</%ARGS>