Changeset 5181 for trunk/expressoMail1_2


Ignore:
Timestamp:
11/16/11 10:45:47 (12 years ago)
Author:
clairson
Message:

Ticket #2318 - Erro ao exportar mensagem, o mesmo exporta com 0 kb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.exporteml.inc.php

    r5172 r5181  
    437437 
    438438        function export_msg($params) { 
     439                $this-> folder = $params['folder']; 
     440                $this->folder = mb_convert_encoding($this->folder, "UTF7-IMAP","UTF-8, ISO-8859-1, UTF7-IMAP"); 
     441                $array_ids = explode(',', $params['msgs_to_export']); 
     442                $error = False; 
     443                $fileNames = ""; 
    439444                $tempDir = $this->tempDir; 
    440                 $file = "source_".$_SESSION[ 'phpgw_session' ][ 'session_id' ].".php"; 
    441                 $f = fopen($tempDir.'/'.$file,"w"); 
    442                 fputs($f, $this->export_msg_data( $params['msgs_to_export'], $params['folder'] ) ); 
    443                 fclose($f); 
    444                  
    445                 return $tempDir.'/'.$file; 
     445                $this->connectImap(); 
     446 
     447                // quando houver apenas um arquivo, exporta o .eml sem coloca-lo em zip 
     448                if (count($array_ids)==1) 
     449                { 
     450                        $header         = $this->getHeader($array_ids[0]);                                                                                      
     451                        $body           = $this->getBody($array_ids[0]);                        
     452                        $sEMLData       = $this->parseEml($header, $body);                      
     453                        $fileName       = $this->CreateFileEml($sEMLData, $tempDir, $array_ids[0]."_".$_SESSION[ 'phpgw_session' ][ 'session_id' ]); 
     454 
     455                        imap_close($this->mbox_stream); 
     456                        if (!$fileName) { 
     457                                return false; 
     458                        } else { 
     459                                return $tempDir.'/'.$fileName; 
     460                        } 
     461                } 
    446462        } 
    447463 
Note: See TracChangeset for help on using the changeset viewer.