X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fhtml%2FTicket%2FElements%2FShowAttachments;fp=rt%2Fhtml%2FTicket%2FElements%2FShowAttachments;h=82028dd282066833ba9b022ce5c942da7c8204db;hb=d4d0590bef31071e8809ec046717444b95b3f30a;hp=8a2a5cb3fb0108c50213ead4e6862dfd93d819b8;hpb=d39d52aac8f38ea9115628039f0df5aa3ac826de;p=freeside.git 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 %# %# %# (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 );