Changeset 5488


Ignore:
Timestamp:
02/09/12 15:58:57 (12 years ago)
Author:
gustavo
Message:

Ticket #2484 - Melhorias na estrutura de diretórios do ExpressoMail?

Location:
trunk/expressoMail1_2
Files:
2 edited

Legend:

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

    r5482 r5488  
    9292            return $this->mbox; 
    9393         } 
    94  
     94          
     95        function move_folder($params){ 
     96                //preg_match( '/[a-zA-Z0-9]+$/',$params['folder_to_move'], $new_folder); 
     97                $old_folder = mb_convert_encoding($params['folder_to_move'], 'UTF7-IMAP','UTF-8, ISO-8859-1, UTF7-IMAP'); 
     98                $new_folder = explode($this->imap_delimiter, $old_folder ); 
     99                $to_folder = mb_convert_encoding($params['folder_to'], 'UTF7-IMAP','UTF-8, ISO-8859-1, UTF7-IMAP'); 
     100                $mbox = imap_open('{'.$this->imap_server.":".$this->imap_port.$this->imap_options.'}'.$new_folder[0], $this->username, $this->password); 
     101                imap_renamemailbox($mbox, '{'.$this->imap_server.":".$this->imap_port.$this->imap_options.'}'.$old_folder, '{'.$this->imap_server.":".$this->imap_port.$this->imap_options.'}'.$to_folder.$this->imap_delimiter.$new_folder[count($new_folder)-1]); 
     102                //imap_close($mbox);  
     103                return true; 
     104        }  
     105         
    95106        function parse_error($error, $field = ''){ 
    96107                // This error is returned from Imap. 
     
    332343            if( $this->useCache === true ) 
    333344                $this->cache->set( 'infoHead://'.$this->username.'://'.$this->mboxFolder.'://'.$msg_number , $return , $this->expirationCache); 
    334                          
     345                     
    335346            return $return; 
    336347        } 
     
    23382349        { 
    23392350                $namebox        = $arr['newp']; 
     2351                $base_path = $arr['base_path']; 
    23402352                $mbox_stream = $this->open_mbox(); 
    23412353                $imap_server = $_SESSION['phpgw_info']['expressomail']['email_server']['imapServer']; 
    2342                 $namebox =  mb_convert_encoding($namebox, "UTF7-IMAP", "UTF-8"); 
    2343  
    2344                 $result = "Ok"; 
    2345                 if(!imap_createmailbox($mbox_stream,"{".$imap_server."}$namebox")) 
    2346                 { 
    2347                         $result = implode("<br />\n", imap_errors()); 
    2348                 } 
    2349  
     2354                $test = explode("/", $namebox); 
     2355                if(count($test) < 1 || $base_path == null || $base_path == "" || $base_path == 'undefined'){ 
     2356                        if($base_path != null || $base_path != "" || $base_path != 'undefined'){ 
     2357                                        $namebox = $base_path.$namebox; 
     2358                        } 
     2359                        $namebox =  mb_convert_encoding($namebox, "UTF7-IMAP", "UTF-8"); 
     2360                        $result = "Ok"; 
     2361                        if(!imap_createmailbox($mbox_stream,"{".$imap_server."}".$namebox)) 
     2362                        { 
     2363                                $result = implode("<br />\n", imap_errors()); 
     2364                        } 
     2365                }else{ 
     2366                        $child = $base_path.$this->imap_delimiter; 
     2367                        for($i =0; $i < count($test); $i++){ 
     2368                                $child .= ($test[$i] ? $test[$i] : $this->functions->getLang("New Folder")); 
     2369                                $namebox =  mb_convert_encoding($child, "UTF7-IMAP", "UTF-8"); 
     2370                                $result = "Ok"; 
     2371                                if(!imap_createmailbox($mbox_stream,"{".$imap_server."}$namebox")) 
     2372                                { 
     2373                                        $result = implode("<br />\n", imap_errors());                                            
     2374                                } 
     2375                                $child .=$this->imap_delimiter; 
     2376                        } 
     2377                }                
    23502378                if($mbox_stream) 
    23512379                        imap_close($mbox_stream); 
    2352  
    23532380                return $result; 
    2354  
    23552381        } 
    23562382 
     
    44114437                                                        foreach($search_criteria as $new_search) 
    44124438                                                        { 
    4413                                                                 $elem = $this->get_info_head_msg($new_search); 
    4414                                                                 $elem['udate']       = gmdate('d/m/Y', $elem['udate'] + $this->functions->CalculateDateOffset());  
     4439                                                                $elem = $this->get_info_head_msg($new_search); 
     4440                                                                $elem['udate']       = gmdate('d/m/Y', $elem['udate'] + $this->functions->CalculateDateOffset());  
    44154441                                                                $elem['boxname'] = mb_convert_encoding( $name_box, "ISO-8859-1", "UTF7-IMAP" );  
    44164442                                                                $elem['uid'] = $new_search; 
     
    44604486                                            $elem = $this->get_info_head_msg( $new_search ); 
    44614487                                            $elem['udate']       = gmdate('d/m/Y', $elem['udate'] + $this->functions->CalculateDateOffset());  
    4462                                             $elem['boxname'] = mb_convert_encoding( $name_box, "ISO-8859-1", "UTF7-IMAP" );  
     4488                                                                                        $elem['boxname'] = mb_convert_encoding( $name_box, "ISO-8859-1", "UTF7-IMAP" );  
    44634489                                            $elem['uid'] = $new_search; 
    44644490                                            /* compare dates in ordering */ 
     
    44954521            $arrayRetorno['data']               =  $pageret; 
    44964522            $arrayRetorno['currentTab'] =  $params['current_tab']; 
    4497  
    44984523            return ($pageret) ? $arrayRetorno : 'none'; 
    44994524        } 
  • trunk/expressoMail1_2/setup/phpgw_pt-br.lang

    r5473 r5488  
    270270It's not possible rename the folder:    expressoMail1_2 pt-br   Não é possível renomear a pasta:  
    271271It's not possible rename this folder, because it is being used in the moment!   expressoMail1_2 pt-br   Não é possível renomear esta pasta, pois está em uso no momento! 
     272It's not possible move this folder, because it is being used in the moment!     expressoMail1_2 pt-br   Não é possível mover esta pasta, pois está em uso no momento! 
     273Can not move this folder to this location, because the target has already a folder with this name       expressoMail1_2 pt-br   Impossivel mover esta pasta para este local,Pois o destino já tem uma pasta com este nome 
     274It's not possible to move this folder to its subfolders!        expressoMail1_2 pt-br   Não é possível mover esta pasta para suas subpastas! 
     275It's not possible move this folder, because its subfolder is being used in the moment!  expressoMail1_2 pt-br   Não é possível mover esta pasta, pois uma subpasta desta pasta está em uso no momento! 
     276It's not possible rename this folder, because its subfolder is being used in the moment!        expressoMail1_2 pt-br   Não é possível editar esta pasta, pois uma subpasta desta pasta está em uso no momento! 
    272277It's not possible rename this folder!   expressoMail1_2 pt-br   Não é possível renomear esta pasta! 
     278The folder was successfully moved       expressoMail1_2 pt-br   Pasta foi movida com sucesso 
     279The folder was successfully rename      expressoMail1_2 pt-br   Pasta foi renomeada com sucesso 
    273280justifycenter   expressoMail1_2 pt-br   Centralizado 
    274281justifyfull     expressoMail1_2 pt-br   Justificar 
     
    758765Include digital signature       expressoMail1_2 pt-br   Incluir assinatura digital 
    759766cannot create folder with more than 100 characters      expressoMail1_2 pt-br   Uma pasta deve ter no máximo 100 caracteres 
     767Do you want to cancel the folder creation?      expressoMail1_2 pt-br   Deseja cancelar a criação da pasta? 
     768Do you want to cancel the folder edition?       expressoMail1_2 pt-br   Deseja cancelar a edição da pasta? 
     769One or more messages from this folder are open  expressoMail1_2 pt-br   Uma ou mais mensagens desta pasta estão abertas 
     770One or more messages from any sub-folder are open       expressoMail1_2 pt-br   Uma ou mais mensagens de alguma sub-pasta desta pasta estão abertas 
     771Thie folder is already in this place    expressoMail1_2 pt-br   A pasta já esta neste local 
     772Delete/move subfolders first    expressoMail1_2 pt-br   Delete/mova suas subpastas primeiro 
Note: See TracChangeset for help on using the changeset viewer.