Changeset 5621


Ignore:
Timestamp:
03/05/12 09:22:46 (12 years ago)
Author:
rafaelraymundo
Message:

Ticket #2512 - Ao abrir o e-mail anexado o Expresso não mostra a mensagem original.

Location:
branches/2.3/expressoMail1_2/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/expressoMail1_2/inc/class.imap_attachment.inc.php

    r3289 r5621  
    22class imap_attachment 
    33{ 
     4        function flattenParts($messageParts, $flattenedParts = array(), $prefix = '', $index = 1, $fullPrefix = true) { 
     5 
     6                foreach($messageParts as $part) { 
     7                        $flattenedParts[$prefix.$index] = $part; 
     8                        if(isset($part->parts)) { 
     9                                if($part->type == 2) { 
     10                                        $flattenedParts = $this->flattenParts($part->parts, $flattenedParts, $prefix.$index.'.', 0, false); 
     11                                } 
     12                                elseif($fullPrefix) { 
     13                                        $flattenedParts = $this->flattenParts($part->parts, $flattenedParts, $prefix.$index.'.'); 
     14                                } 
     15                                else { 
     16                                        $flattenedParts = $this->flattenParts($part->parts, $flattenedParts, $prefix); 
     17                                } 
     18                                unset($flattenedParts[$prefix.$index]->parts); 
     19                        } 
     20                        $index++; 
     21                } 
     22 
     23                return $flattenedParts; 
     24 
     25        } 
     26     
    427        function get_attachment_info($mbox_stream, $msg_number)  
    528        {        
    629                $structure = imap_fetchstructure($mbox_stream,$msg_number,FT_UID); 
     30                $aaa = $this->flattenParts($structure->parts); 
    731                $contentParts = count($structure->parts); 
    832         
     
    1337                        for($i=1; $i<$contentParts; $i++) 
    1438                        { 
    15                                 $msg_info['attachment'][$i]['part_in_msg']      = ($i+1); 
     39                                $msg_info['attachment'][$i]['part_in_msg']      = ($i); 
    1640                                $msg_info['attachment'][$i]['name']                             = urlencode($structure->parts[$i]->dparameters[0]->value); 
    1741                                $msg_info['attachment'][$i]['type']                             = $structure->parts[$i]->subtype; 
  • branches/2.3/expressoMail1_2/inc/class.imap_functions.inc.php

    r5226 r5621  
    10911091                                                                                $msg->encoding[ $msg_number ][ $values ] = 'quoted-printable';  
    10921092                                                                }  
    1093  
     1093                                                                /* 
    10941094                                                                $body = $this->decodeBody(  
    1095                                                                         imap_fetchbody(  
     1095                                                                                imap_fetchbody(  
    10961096                                                                                $this->mbox,  
    10971097                                                                                $msg_number,  
     
    11011101                                                                        $msg->encoding[ $msg_number ][ $values ],  
    11021102                                                                        $msg->charset[ $msg_number ][ $values ]  
    1103                                                                 );  
    1104  
     1103                                                                ); 
     1104                                                                */ 
     1105                                                                $body = $this->decodeBody(  
     1106                                                                        imap_fetchbody(  
     1107                                                                                $this->mbox,  
     1108                                                                                $msg_number,  
     1109                                                                                $attachment['part_in_msg'] . ".1",  
     1110                                                                                FT_UID  
     1111                                                                        ),  
     1112                                                                        $msg->encoding[ $msg_number ][ $values ],  
     1113                                                                        $msg->charset[ $msg_number ][ $values ]  
     1114                                                                ); 
     1115                                                                 
    11051116                                                                if ( strtolower( $msg->structure[$msg_number]->parts[1]->parts[0]->subtype ) == 'plain' )  
    11061117                                                                {  
Note: See TracChangeset for help on using the changeset viewer.