[Rt-commit] r4879 - in rtir/branches/1.9-EXPERIMENTAL: html/RTIR/Elements

alexmv at bestpractical.com alexmv at bestpractical.com
Wed Mar 29 16:59:17 EST 2006


Author: alexmv
Date: Wed Mar 29 16:59:16 2006
New Revision: 4879

Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/TransactionData

Log:
 r11964 at zoq-fot-pik:  chmrr | 2006-03-29 16:59:06 -0500
  * Don't just use random constants


Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/TransactionData
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/TransactionData	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/TransactionData	Wed Mar 29 16:59:16 2006
@@ -24,64 +24,59 @@
 %# END LICENSE BLOCK
 <%PERL>
 while (my $Transaction = $Transactions->Next) {
-my $type = $Transaction->Type;
-next if ( $type eq 'CustomField' &&
-          substr($Transaction->BriefDescription, 0, 6) eq '_RTIR_');
-if (@Include) {
-  my $found = 0;
-  foreach my $inc (@Include) {
-    $found = 1 if ($inc eq $type);
-  }
-  next unless ($found);
-}
-my $attachments = $Transaction->Attachments;
-my ($headers, $content);
-$attachments->GotoFirstItem;
-while (my $message = $attachments->Next) {
-   #we don't want to show any empty transactions, unless they have kids
-   next unless ($message->Content || $message->Children->Count);
+    my $type = $Transaction->Type;
+    next if ( $type eq 'CustomField' and substr($Transaction->BriefDescription, 0, 6) eq '_RTIR_');
 
-  if ($ShowHeaders && $message->Parent == 0) {
-      $headers = $message->NiceHeaders;
-      chomp $headers;
-      if ($headers) {
-	   # localize the common headers (like 'Subject:'), too.
-	   eval {$headers =~ s/^([^:]+)(?=:)/loc($1)/em; } # we eval here to catch errors when 5.6 panics
-           
-      }
-  }
-     # 13456 is a random # of about the biggest size we want to see inline text
-     my $MAX_INLINE_BODY = 13456;
-     if ($message->ContentType =~ m{^(text/plain|message|text$)}i && 
-				    length($message->Content)< $MAX_INLINE_BODY ) {
+    if (@Include) {
+        my $found = 0;
+        foreach my $inc (@Include) {
+            $found = 1 if ($inc eq $type);
+        }
+        next unless ($found);
+    }
+    my $attachments = $Transaction->Attachments;
+    my ($headers, $content);
+    $attachments->GotoFirstItem;
+    while (my $message = $attachments->Next) {
+        #we don't want to show any empty transactions, unless they have kids
+        next unless ($message->Content || $message->Children->Count);
 
-	 $content = $message->Content;
+        if ($ShowHeaders && $message->Parent == 0) {
+            $headers = $message->NiceHeaders;
+            chomp $headers;
+            if ($headers) {
+                # localize the common headers (like 'Subject:'), too.
+                eval {$headers =~ s/^([^:]+)(?=:)/loc($1)/em; } # we eval here to catch errors when 5.6 panics
+            }
+        }
 
-     }
-     else {
-	 $content = "";
-     }
-}
+        my $inline = RT->Config->Get( 'MaxInlineBody', $session{'CurrentUser'} );
+        if ($message->ContentType =~ m{^(text/plain|message|text$)}i and 
+            ($inline == 0 or length($message->Content) < $inline) ) {
+            $content = $message->Content;
+        } else {
+            $content = "";
+        }
+    }
 
-# quote the included text
-if ($QuoteText) {
-  if ($headers) {
-    $headers =~ s/^/> /g;
-    $headers =~ s/\n/\n> /g;
-  }
-  if ($content) {
-    $content =~ s/^/> /g;
-    $content =~ s/\n/\n> /g;
-  }
-}
+    # quote the included text
+    if ($QuoteText) {
+        if ($headers) {
+            $headers =~ s/^/> /g;
+            $headers =~ s/\n/\n> /g;
+        }
+        if ($content) {
+            $content =~ s/^/> /g;
+            $content =~ s/\n/\n> /g;
+        }
+    }
 </%PERL>
-% if ($headers) {
-<% $headers %>
-
-% }
-% if ($content) {
-<% $content |n %>
-% }
+%   if ($headers) {
+<%      $headers %>
+%   }
+%   if ($content) {
+<%      $content |n %>
+%   }
 % }
 <%ARGS>
 $Transactions => undef


More information about the Rt-commit mailing list