diff options
Diffstat (limited to 'rt/html/Ticket/Elements/ShowTransactionAttachments')
-rw-r--r-- | rt/html/Ticket/Elements/ShowTransactionAttachments | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/rt/html/Ticket/Elements/ShowTransactionAttachments b/rt/html/Ticket/Elements/ShowTransactionAttachments index 8dabff421..b01586deb 100644 --- a/rt/html/Ticket/Elements/ShowTransactionAttachments +++ b/rt/html/Ticket/Elements/ShowTransactionAttachments @@ -1,8 +1,8 @@ -%# BEGIN BPS TAGGED BLOCK {{{ +%# {{{ BEGIN BPS TAGGED BLOCK %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2004 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 <%perl> # Find all the attachments which have parent $Parent # For each of these attachments @@ -79,24 +79,21 @@ foreach my $message ( grep { $_->Parent == $Parent } @$Attachments ) { } </%PERL> -<A HREF="<%$AttachPath%>/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename | u%>"><&|/l&>Download</&> <%$message->Filename || loc('(untitled)') %></a> +<A HREF="<%$AttachPath%>/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename | u%>"><&|/l&>Download</&><%$message->Filename || loc('(untitled)') %></a> <div class="downloadcontenttype"> <%$message->ContentType%> <% $size %> </div> </div> -% } +%} + % # }}} <div class="messagebody"> <%perl> -# {{{ if it has a content-disposition: attachment, don't show inline -unless ( $message->GetHeader('Content-Disposition') =~ /attachment/i ) { - +# {{{ if it's got content-disposition inline, show it inline my $content; # If it's text - if ( $message->ContentType =~ m{^(text|message)}i - && $size <= $RT::MaxInlineBody ) - { + if ( $message->ContentType =~ m{^(text|message)}i ) { if ( @@ -130,7 +127,7 @@ unless ( $message->GetHeader('Content-Disposition') =~ /attachment/i ) { if ( $message->ContentType =~ m{^text/(?:html|enriched)$}i ) { $content = $m->comp( '/Elements/ScrubHTML', Content => $content ); - $m->out($content); + $m->out( $content ); } # if it's a text/plain show the body @@ -149,24 +146,22 @@ unless ( $message->GetHeader('Content-Disposition') =~ /attachment/i ) { } } + # if it's an image, show it as an image + elsif ( $message->ContentType =~ /^image\//i ) { + $m->out('<img src="' + . $AttachPath . '/' + . $Transaction->Id . '/' + . $message->Id + . '/">' ); + } - # if it's an image, show it as an image - elsif ( $message->ContentType =~ /^image\//i ) { - $m->out('<img src="' - . $AttachPath . '/' - . $Transaction->Id . '/' - . $message->Id - . '/">' ); - } -} -# }}} + # }}} + + $m->comp( 'ShowTransactionAttachments', %ARGS, + Parent => $message->id, + ParentObj => $message ); -$m->comp( - 'ShowTransactionAttachments', %ARGS, - Parent => $message->id, - ParentObj => $message -); } </%PERL> |