From 9ce482da3960ee43decee41fba53b78c12c3e52c Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 24 Sep 2016 10:28:06 -0700 Subject: rt 4.2.13 ticket#13852 --- rt/share/html/Elements/ShowTransactionAttachments | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'rt/share/html/Elements/ShowTransactionAttachments') diff --git a/rt/share/html/Elements/ShowTransactionAttachments b/rt/share/html/Elements/ShowTransactionAttachments index 7aeded644..e0a4b50a7 100644 --- a/rt/share/html/Elements/ShowTransactionAttachments +++ b/rt/share/html/Elements/ShowTransactionAttachments @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -56,10 +56,14 @@ foreach my $message ( @{ $Attachments->{ $Parent || 0 } || [] } ) { ); my $name = defined $message->Filename && length $message->Filename ? $message->Filename : ''; - if ( $message->ContentLength or $name ) { + my $should_render_download = $message->ContentLength || $name; + + $m->callback(CallbackName => 'BeforeAttachment', ARGSRef => \%ARGS, Object => $Object, Transaction => $Transaction, Attachment => $message, Name => $name, ShouldRenderDownload => \$should_render_download); + + if ($should_render_download) {
-<&|/l&>Download <% length $name ? $name : loc('(untitled)') %>\ +<&|/l&>Download <% length $name ? $name : loc('(untitled)') %>\ % if ( $DownloadableHeaders && ! length $name && $message->ContentType =~ /text/ ) { / <% loc('with headers') %> % } -- cgit v1.2.1