[Rt-commit] r16204 - in rt/3.8/trunk: .

falcone at bestpractical.com falcone at bestpractical.com
Thu Oct 2 13:50:34 EDT 2008


Author: falcone
Date: Thu Oct  2 13:50:34 2008
New Revision: 16204

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/lib/RT/Transaction_Overlay.pm

Log:
 r40378 at ketch:  falcone | 2008-10-02 13:44:19 -0400
 * allow you to request the html part of a transaction without
   using local to set a package variable in RT::Transaction


Modified: rt/3.8/trunk/lib/RT/Transaction_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Transaction_Overlay.pm	(original)
+++ rt/3.8/trunk/lib/RT/Transaction_Overlay.pm	Thu Oct  2 13:50:34 2008
@@ -293,7 +293,7 @@
     );
 
     my $content;
-    if ( my $content_obj = $self->ContentObj ) {
+    if ( my $content_obj = $self->ContentObj( Type => $args{Type} ) ) {
         $content = $content_obj->Content ||'';
 
         if ( lc $content_obj->ContentType eq 'text/html' ) {
@@ -384,6 +384,8 @@
 
 sub ContentObj {
     my $self = shift;
+    my %args = ( Type => $PreferredContentType || 'text/plain',
+                 @_ );
 
     # If we don't have any content, return undef now.
     # Get the set of toplevel attachments to this transaction.
@@ -399,7 +401,7 @@
 
     elsif ( $Attachment->ContentType =~ '^multipart/' ) {
         my $plain_parts = $Attachment->Children;
-        $plain_parts->ContentType( VALUE => ($PreferredContentType || 'text/plain') );
+        $plain_parts->ContentType( VALUE => $args{Type} );
         $plain_parts->LimitNotEmpty;
 
         # If we actully found a part, return its content


More information about the Rt-commit mailing list