X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=rt%2Fshare%2Fhtml%2FElements%2FShowTransactionAttachments;h=0668500674c372608edec3c2dba55e32f62e3986;hb=187086c479a09629b7d180eec513fb7657f4e291;hp=7aeded644a8f53a72778ac3184821f7e803ed1cb;hpb=9aee669886202be7035e6c6049fc71bc99dd3013;p=freeside.git diff --git a/rt/share/html/Elements/ShowTransactionAttachments b/rt/share/html/Elements/ShowTransactionAttachments index 7aeded644..066850067 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-2018 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') %> % }