[Rt-commit] r18466 - rt/3.8/trunk/share/html/Ticket/Elements
ruz at bestpractical.com
ruz at bestpractical.com
Thu Feb 19 01:46:24 EST 2009
Author: ruz
Date: Thu Feb 19 01:46:24 2009
New Revision: 18466
Modified:
rt/3.8/trunk/share/html/Ticket/Elements/ShowTransactionAttachments
Log:
* show gpg status per attachment
Modified: rt/3.8/trunk/share/html/Ticket/Elements/ShowTransactionAttachments
==============================================================================
--- rt/3.8/trunk/share/html/Ticket/Elements/ShowTransactionAttachments (original)
+++ rt/3.8/trunk/share/html/Ticket/Elements/ShowTransactionAttachments Thu Feb 19 01:46:24 2009
@@ -49,6 +49,11 @@
# Find all the attachments which have parent $Parent
# For each of these attachments
foreach my $message ( grep $_->__Value('Parent') == $Parent, @$Attachments ) {
+
+ if (RT->Config->Get('GnuPG')->{'Enable'}) {
+ $m->comp( 'ShowGnuPGStatus', Attachment => $message, WarnUnsigned => $WarnUnsigned );
+ }
+
$m->comp( 'ShowMessageHeaders',
Message => $message,
DisplayHeaders => \@DisplayHeaders,
@@ -67,7 +72,7 @@
</div>
% }
-% # If there is sub-messages, open a dedicated div
+%# If there is sub-messages, open a dedicated div
% if ( scalar ( grep $_->__Value('Parent') == $message->id, @$Attachments ) ) {
<div class="messageattachments">
% } else {
@@ -103,6 +108,7 @@
$ShowBody => 1
$Parent => 0
$ParentObj => undef
+$WarnUnsigned => 0
</%ARGS>
<%INIT>
my @DisplayHeaders=qw(_all);
@@ -135,7 +141,12 @@
my $message = shift;
# if it has a content-disposition: attachment, don't show inline
- return if ($message->GetHeader('Content-Disposition')||"") =~ /attachment/i;
+ my $disposition = $message->GetHeader('Content-Disposition');
+ if ( $disposition && $disposition =~ /attachment/i && $disposition !~ /^\s*inline/ ) {
+ $disposition = 'attachemnt';
+ } else {
+ $disposition = 'inline';
+ }
# If it's text
if ( $message->ContentType =~ m{^(text|message)}i ) {
@@ -148,6 +159,10 @@
$m->out('<p>'. loc( 'Message body not shown because it is too large.' ) .'</p>');
return;
}
+ elsif ( $disposition ne 'inline' ) {
+ $m->out('<p>'. loc( 'Message body is not shown because sender requested not to inline it.' ) .'</p>');
+ return;
+ }
if (
@@ -206,6 +221,11 @@
# if it's an image, show it as an image
elsif ( RT->Config->Get('ShowTransactionImages') and $message->ContentType =~ /^image\//i ) {
+ if ( $disposition ne 'inline' ) {
+ $m->out('<p>'. loc( 'Message body is not shown because sender requested not to inline it.' ) .'</p>');
+ return;
+ }
+
my $filename = $message->Filename || loc('(untitled)');
$m->out('<img'
. ' alt="'
More information about the Rt-commit
mailing list