summaryrefslogtreecommitdiff
path: root/rt/html/Ticket/Elements/ShowAttachments
diff options
context:
space:
mode:
Diffstat (limited to 'rt/html/Ticket/Elements/ShowAttachments')
-rw-r--r--rt/html/Ticket/Elements/ShowAttachments12
1 files changed, 8 insertions, 4 deletions
diff --git a/rt/html/Ticket/Elements/ShowAttachments b/rt/html/Ticket/Elements/ShowAttachments
index 8a2a5cb3f..82028dd28 100644
--- a/rt/html/Ticket/Elements/ShowAttachments
+++ b/rt/html/Ticket/Elements/ShowAttachments
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
% if (keys %documents) {
<& /Elements/TitleBoxStart, title => loc('Attachments'),
title_class=> 'inverse',
@@ -82,8 +82,12 @@ if ($size) {
% }
<%INIT>
-my %documents;
+# If we haven't been passed in an Attachments object (through the precaching mechanism)
+# then we need to find one
+$Attachments ||= $m->comp('FindAttachments', Ticket => $Ticket);
+
+my %documents;
while ( my $attach = $Attachments->Next() ) {
next unless ($attach->Filename());
unshift( @{ $documents{ $attach->Filename } }, $attach );