[rt-commit] [svn] r544 - in rt/trunk/html/Ticket: . Elements

jesse at fsck.com jesse at fsck.com
Wed Mar 10 23:56:00 EST 2004


Author: jesse
Date: Wed Mar 10 23:56:00 2004
New Revision: 544

Modified:
   rt/trunk/html/Ticket/Display.html
   rt/trunk/html/Ticket/Elements/ShowHistory
Log:
Better caching of ticket attachment content


Modified: rt/trunk/html/Ticket/Display.html
==============================================================================
--- rt/trunk/html/Ticket/Display.html	(original)
+++ rt/trunk/html/Ticket/Display.html	Wed Mar 10 23:56:00 2004
@@ -38,7 +38,8 @@
       Ticket => $TicketObj, 
       Collapsed => $ARGS{'Collapsed'}, 
       ShowHeaders => $ARGS{'ShowHeaders'},
-      Attachments => $attachments 
+      Attachments => $attachments,
+      AttachmentContent => $attachment_content
       
       &> 
 
@@ -116,6 +117,7 @@
 }
 
 my $attachments = $m->comp('Elements/FindAttachments', Ticket => $TicketObj);
+my $attachment_content = $m->comp('Elements/LoadTextAttachments', Ticket => $TicketObj);
 
 
 </%INIT>

Modified: rt/trunk/html/Ticket/Elements/ShowHistory
==============================================================================
--- rt/trunk/html/Ticket/Elements/ShowHistory	(original)
+++ rt/trunk/html/Ticket/Elements/ShowHistory	Wed Mar 10 23:56:00 2004
@@ -56,6 +56,7 @@
 <TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0>
 <%perl>
 my @attachments = @{$Attachments->ItemsArrayRef()};
+my @attachment_content = @{$AttachmentContent->ItemsArrayRef()};
 
 
 
@@ -75,6 +76,9 @@
 
     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',
@@ -87,6 +91,7 @@
               RowNum               => $i,
               ShowTitleBarCommands => $ShowTitleBarCommands,
               Attachments          => \@trans_attachments,
+              AttachmentContent    => $trans_content
  );
 }
 
@@ -108,6 +113,7 @@
 $URIFile => 'Display.html'
 $Ticket => undef
 $Attachments => undef
+$AttachmentContent => undef
 $ShowHeaders => undef
 $Collapsed => undef
 $ShowTitle => 1



More information about the Rt-commit mailing list