X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fhtml%2FTicket%2FElements%2FShowHistory;fp=rt%2Fhtml%2FTicket%2FElements%2FShowHistory;h=c4fe41747c14a31fe99e2b93f5ac44b9c7a412d0;hb=c582e92888b4a5553e1b4e5214cf35217e4a0cf0;hp=194be9b37b31f482f60fb8ed957b719cef8d10d8;hpb=289340780927b5bac2c7604d7317c3063c6dd8cc;p=freeside.git
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 {
% }
-% 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) {
-
-% }
- <& 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('') 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>
% 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>