Ignore:
Timestamp:
09/17/12 14:30:47 (12 years ago)
Author:
douglas
Message:

Ticket #0000 - Copiadas as alterações do Trunk. Versão final da 2.4.2.

Location:
branches/2.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4

  • branches/2.4/expressoMail1_2/inc/class.exporteml.inc.php

    r5934 r7228  
    1616        var $mbox_stream; 
    1717        var $tempDir; 
    18          
     18 
    1919        function ExportEml() { 
    2020            
     
    5050                return $sEMail; 
    5151        } 
    52          
     52 
    5353        // create EML File. 
    5454        // Funcao alterada para tratar a exportacao 
     
    6262            $header    = imap_headerinfo($this->mbox_stream, imap_msgno($this->mbox_stream, $id), 80, 255); 
    6363            $subject = $this->decode_subject($header->fetchsubject); 
    64              
     64                         
    6565            if (strlen($subject) > 60) 
    6666                $subject = substr($subject, 0, 59); 
     
    214214                // se encontram em um mesmo folder 
    215215                if (count($sorted_msgs)==1){ 
    216                                                          
    217216                        $array_names_keys = array_keys($sorted_msgs); 
    218217                        $this->folder = mb_convert_encoding($array_names_keys[0], "UTF7-IMAP","UTF-8, ISO-8859-1, UTF7-IMAP"); 
     
    228227                                $fileName       = $this->CreateFileEml($sEMLData, $tempDir, $msg_number[0]."_".$_SESSION[ 'phpgw_session' ][ 'session_id' ]); 
    229228                 
    230                                  
     229                                $header    = imap_headerinfo($this->mbox_stream, imap_msgno($this->mbox_stream, $msg_number[0]), 80, 255); 
     230                $subject = $this->decode_subject(html_entity_decode($header->fetchsubject)); 
     231 
    231232                                imap_close($this->mbox_stream); 
    232233                                if (!$fileName) { 
    233234                                        return false; 
    234235                                }else{ 
    235                                         return $tempDir.'/'.$fileName; 
     236                                        $return = array(); 
     237                                        $return[] = $tempDir.'/'.$fileName; 
     238                                        $return[] = $subject; 
     239                                        return $return; 
    236240                                } 
    237241                        } 
     
    271275                        } 
    272276 
    273                         return $file; 
     277                        return $file;                    
    274278                 
    275279                //exporta mensagens de diferentes pastas 
     
    362366                                $file = false; 
    363367                        } 
    364  
    365368            return $file; 
    366369                 
     
    369372                { 
    370373                        $this-> folder = $params['folder']; 
    371                                 $this->folder = mb_convert_encoding($this->folder, "UTF7-IMAP","UTF-8, ISO-8859-1, UTF7-IMAP"); 
     374                        $this->folder = mb_convert_encoding($this->folder, "UTF7-IMAP","UTF-8, ISO-8859-1, UTF7-IMAP"); 
    372375                        $array_ids = explode(',', $params['msgs_to_export']); 
    373376                        $error = False; 
     
    383386                                $sEMLData       = $this->parseEml($header, $body);                      
    384387                                $fileName       = $this->CreateFileEml($sEMLData, $tempDir, $array_ids[0]."_".$_SESSION[ 'phpgw_session' ][ 'session_id' ]); 
     388                         
     389                                $header    = imap_headerinfo($this->mbox_stream, imap_msgno($this->mbox_stream, $array_ids[0]), 80, 255); 
     390                    $subject = $this->decode_subject(html_entity_decode($header->fetchsubject)); 
    385391 
    386392                                imap_close($this->mbox_stream); 
     
    388394                                        return false; 
    389395                                } else { 
    390                                         return $tempDir.'/'.$fileName; 
     396                                        $return = array(); 
     397                                        $return[] = $tempDir.'/'.$fileName; 
     398                                        $return[] = $subject; 
     399                                        return $return; 
    391400                                } 
    392401                        } 
     
    416425                                {                
    417426                                        $file = $tempDir.'/'.$nameFileZip; 
     427                                        $ret[] = $file; 
     428                                    return $ret;   
    418429                                } else { 
    419430                                        $file = false; 
     
    424435                                $file = false; 
    425436                        } 
    426  
    427437                        return $file; 
    428438                } 
     
    453463                        $fileName       = $this->CreateFileEml($sEMLData, $tempDir, $array_ids[0]."_".$_SESSION[ 'phpgw_session' ][ 'session_id' ]); 
    454464 
     465                        $header    = imap_headerinfo($this->mbox_stream, imap_msgno($this->mbox_stream, $array_ids[0]), 80, 255); 
     466            $subject = $this->decode_subject(html_entity_decode($header->fetchsubject)); 
     467 
    455468                        imap_close($this->mbox_stream); 
    456469                        if (!$fileName) { 
    457470                                return false; 
    458471                        } else { 
    459                                 return $tempDir.'/'.$fileName; 
     472                                $return = array(); 
     473                                $return[] = $tempDir.'/'.$fileName; 
     474                                $return[] = $subject; 
     475                                return $return; 
    460476                        } 
    461477                } 
Note: See TracChangeset for help on using the changeset viewer.