Changeset 3722


Ignore:
Timestamp:
01/26/11 11:10:08 (13 years ago)
Author:
eduardoalex
Message:

Ticket #1392 - Corrigindo a busca por mensagens com ## e -- no assunto

Location:
branches/2.2/expressoMail1_2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php

    r3709 r3722  
    34263426                                        imap_reopen($mbox_stream, "{".$this->imap_server.":".$this->imap_port.$this->imap_options."}".$name_box); 
    34273427 
    3428                                 if (preg_match("/^.?\bALL\b/", $filter)){ // Quick Search, note: this ALL isn't the same ALL from imap_search 
     3428                if (preg_match("/^.?\bALL\b/", $filter)){ // Quick Search, note: this ALL isn't the same ALL from imap_search 
    34293429 
    34303430                                        $all_criterias = array ("TO","SUBJECT","FROM","CC"); 
     
    34393439                                                { 
    34403440                                                        foreach($search_criteria as $new_search){ 
    3441                                                                 if ($search_result_number != '65536' && $sum == $search_result_number) 
    3442                                                                 { 
    3443                                                                   return $retorno ? $sum . "=sumResults=" . $retorno : "none"; 
    3444                                                                 } 
     3441                                if ($search_result_number != '65536' && $sum == $search_result_number) 
     3442                                { 
     3443                                  return $retorno ? $sum . "=sumResults=" . $retorno : "none"; 
     3444                                } 
    34453445 
    34463446                                                                $m_token = trim("##". mb_convert_encoding( $folder_name, "ISO_8859-1", "UTF7-IMAP" ) . "--" . mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--".$new_search."##"."\n"); 
    34473447                                                                if(!@strstr($retorno,$m_token)) 
    3448                                                                 { 
    3449                                                                     $retorno .= $m_token; 
    3450                                                                     $sum++; 
    3451                                                                 } 
     3448                                { 
     3449                                    $retorno .= $m_token; 
     3450                                    $sum++; 
     3451                                } 
    34523452                                                        } 
    34533453                                                } 
     
    35403540                if($header->from[0]->personal != "") 
    35413541                        $from = $header->from[0]->personal; 
    3542                 $ret_msg = $this->decode_string($from) . "--" . $subject . "--". gmdate("d/m/Y",$header ->udate + $this->functions->CalculateDateOffset())."--". $this->size_msg($header->Size) ."--". $flag; 
     3542                $ret_msg = $this->decode_string($from) . "--" . htmlentities(rawurlencode($subject)) . "--". gmdate("d/m/Y",$header ->udate + $this->functions->CalculateDateOffset())."--". $this->size_msg($header->Size) ."--". $flag; 
    35433543                return $ret_msg; 
    35443544        } 
  • branches/2.2/expressoMail1_2/js/local_messages.js

    r3716 r3722  
    967967    var retorno = ""; 
    968968    while(rs.isValidRow()) { 
    969         var header = connector.unserialize(rs.field(0)); 
    970         retorno+="##"+"local_"+rs.field(1)+"--"+"local_"+rs.field(1)+"--"+header["from"]["name"]+"--"+header["subject"]+"--"+header["udate"]+"--"+this.aux_convert_size(rs.field(3))+"--"+header["Unseen"]+header["Recent"]+header["Flagged"]+header["Draft"]+"--"+rs.field(2)+"##"; 
    971         rs.next(); 
     969                var header = connector.unserialize(rs.field(0)); 
     970                var date_formated = ""+header["udate"]; 
     971                /* Antigamente o udate vinha com o formato de data e foi alterado para vir o timestamp.  
     972                 * Nesse caso, e-mails arquivados anteriormente usamos o udate, caso contrario, usamos o smalldate, 
     973                 * pois o udate agora vem como timestamp*/ 
     974                if(!date_formated.match(/\d{2}\/\d{2}\/\d{4}/))  
     975                        date_formated = header["smalldate"]; 
     976                retorno+="##"+"local_"+rs.field(1)+"--"+"local_"+rs.field(1)+"--"+header["from"]["name"]+"--"+escape(header["subject"])+"--"+date_formated+"--"+this.aux_convert_size(rs.field(3))+"--"+header["Unseen"]+header["Recent"]+header["Flagged"]+header["Draft"]+"--"+rs.field(2)+"##"; 
     977                rs.next(); 
    972978    } 
    973979 
  • branches/2.2/expressoMail1_2/js/search.js

    r3711 r3722  
    427427                        var tr = document.createElement("TR"); 
    428428                                tr.style.height = preferences.line_height; 
    429  
    430                         if (false && nw_array[i].match(/.*--.*--\w*--\d{2}\/\d{2}\/\d{4}--\d+? \w*b--.*--\d*$/g) != null) //subject with "--" 
    431                         { 
    432                                 var aux1 = nw_array[i].match(/\d{2}\/\d{2}\/\d{4}--\d+? \w*b--.*--\d*$/g); 
    433                                         aux1 = aux1[0].split("--"); 
    434                                 nw_array[i] = nw_array[i].substr(0, nw_array[i].indexOf(aux1[0])-2); 
    435                                  
    436                                 var aux         = []; 
    437                                  
    438                                 aux[0]  = nw_array[i].substr(0, nw_array[i].indexOf('--')); 
    439                                 nw_array[i] = nw_array[i].substr(nw_array[i].indexOf('--')+2); 
    440                                 aux[3] = nw_array[i].substr(0, nw_array[i].indexOf('--')); 
    441                                 nw_array[i] = nw_array[i].substr(nw_array[i].indexOf('--')+2); 
    442                                 aux[1] = nw_array[i].substr(0, nw_array[i].indexOf('--')); 
    443                                 aux[2] = nw_array[i].substr(nw_array[i].indexOf('--')+2); 
    444                                 aux = aux.concat(aux1); 
    445                         } 
    446                         else 
    447                         { 
    448                                 var aux = nw_array[i].split("--"); 
    449                                 aux.splice(4,0,aux[1]); 
    450                                 var mailbox = aux.shift(); 
    451                                 aux.splice(0,1,mailbox); 
    452                         } 
    453  
     429                        nw_array[i] = url_decode(unescape(nw_array[i])); 
     430                         
     431                        var aux1; 
     432                        aux1 = nw_array[i].match(/\d{2}\/\d{2}\/\d{4}--\d+? \w*b--.*--\d*$/g); 
     433                        /* 
     434                         * E-mails do dia estão vindo com o horário em mensagens locais.  
     435                         * Caso isso seja "corrigido" essa condicional não será mais necessária 
     436                         */ 
     437                        if(aux1==null)  
     438                                aux1 = nw_array[i].match(/\d{2}:\d{2}--\d+? \w*b--.*--\d*$/g); 
     439                        aux1 = aux1[0].split("--"); 
     440                        nw_array[i] = nw_array[i].substr(0, nw_array[i].indexOf(aux1[0])-2); 
     441                         
     442                        var aux         = []; 
     443                        var mailbox = ""; 
     444                        aux[0] = mailbox = nw_array[i].substr(0, nw_array[i].indexOf('--')); 
     445                        nw_array[i] = nw_array[i].substr(nw_array[i].indexOf('--')+2); 
     446                        aux[3] = nw_array[i].substr(0, nw_array[i].indexOf('--')); 
     447                        nw_array[i] = nw_array[i].substr(nw_array[i].indexOf('--')+2); 
     448                        aux[1] = nw_array[i].substr(0, nw_array[i].indexOf('--')); 
     449                        aux[2] = nw_array[i].substr(nw_array[i].indexOf('--')+2); 
     450                        aux = aux.concat(aux1); 
     451 
     452                         
    454453                        var mailbox_name = aux[0]; 
    455454                        var mailbox_id = aux[3]; 
     
    529528                                        { 
    530529                                                var td1 = this.aux_local_folder_display(td1); 
    531                                                 aux[2] = tr.name = aux[0]; // precisa trocar pelo nome real no banco do gears. 
     530                                                tr.name = aux[0]; // precisa trocar pelo nome real no banco do gears. 
    532531                                        } 
    533532                                        else 
Note: See TracChangeset for help on using the changeset viewer.