Changeset 372 for trunk/expressoMail1_2
- Timestamp:
- 07/28/08 16:55:56 (16 years ago)
- Location:
- trunk/expressoMail1_2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r349 r372 2110 2110 $tmp1 = explode("##",$tmp); 2111 2111 $name_box = $tmp1[0]; 2112 $criteria = explode("<=>",rawurldecode($tmp1[1])); 2113 $criteria[1] = $this->remove_accents($criteria[1]); 2112 unset($filter); 2113 foreach($tmp1 as $index => $criteria) 2114 { 2115 if ($index != 0 && strlen($criteria) != 0) 2116 { 2117 $filter_array = explode("<=>",rawurldecode($criteria)); 2118 $filter .= " ".$filter_array[0]; 2119 $filter .= '"'.$filter_array[1].'"'; 2120 } 2121 } 2122 $name_box = mb_convert_encoding(utf8_decode($name_box), "UTF7-IMAP", "ISO_8859-1" ); 2123 $filter = $this->remove_accents($filter); 2114 2124 2115 2125 if(!is_resource($mbox_stream)) 2116 $mbox_stream = $this->open_mbox( );2126 $mbox_stream = $this->open_mbox($name_box); 2117 2127 else 2118 2128 imap_reopen($mbox_stream, "{".$this->imap_server.":".$this->imap_port.$this->imap_options."}".$name_box); 2129 2130 if (preg_match("/^.?\bALL\b/", $filter)){ // Quick Search, note: this ALL isn't the same ALL from imap_search 2119 2131 2120 if($criteria[0] == "ALL ") {2121 2132 $all_criterias = array ("TO","SUBJECT","FROM","CC"); 2122 2133 foreach($all_criterias as $criteria_fixed) 2123 2134 { 2124 $filter = $criteria_fixed . ' "' . $criteria[1] . '"'; 2125 $search_criteria = imap_search($mbox_stream, $filter, SE_UID); 2135 $_filter = $criteria_fixed . substr($filter,4); 2136 2137 $search_criteria = imap_search($mbox_stream, $_filter, SE_UID); 2126 2138 2127 2139 if($search_criteria && count($search_criteria) < 50) 2128 2140 { 2129 2141 foreach($search_criteria as $new_search){ 2130 $m_token = trim("##". $name_box. "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--".$new_search."##"."\n");2142 $m_token = trim("##".mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--".$new_search."##"."\n"); 2131 2143 if(!@strstr($retorno,$m_token)) 2132 2144 $retorno .= $m_token; … … 2138 2150 } 2139 2151 else { 2140 $filter = $criteria[0] . '"' . $criteria[1] . '"';2141 2152 $search_criteria = imap_search($mbox_stream, $filter, SE_UID); 2142 2143 if($search_criteria) { 2144 foreach($search_criteria as $new_search){ 2145 $retorno .= trim("##".$name_box . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--".$new_search."##"."\n"); 2146 } 2153 if( is_array( $search_criteria) ) 2154 { 2155 foreach($search_criteria as $new_search) 2156 $retorno .= trim("##".mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--" . $new_search."##"."\n"); 2147 2157 } 2148 2158 } -
trunk/expressoMail1_2/js/search.js
r320 r372 527 527 // Verifica se os campos estão preenchidos; 528 528 if(trim(Element("txt_ass").value) != ""){ 529 fields += "SUBJECT " + "<=>" +url_encode(Element("txt_ass").value) + " 529 fields += "SUBJECT " + "<=>" +url_encode(Element("txt_ass").value) + "##"; 530 530 } 531 531 if(trim(Element("txt_body").value) != ""){ 532 fields += "BODY " + "<=>" + url_encode(Element("txt_body").value) + " 532 fields += "BODY " + "<=>" + url_encode(Element("txt_body").value) + "##"; 533 533 } 534 534 if(trim(Element("txt_de").value) != ""){ 535 fields += "FROM " + "<=>" + url_encode(Element("txt_de").value) + " 535 fields += "FROM " + "<=>" + url_encode(Element("txt_de").value) + "##"; 536 536 } 537 537 if(trim(Element("txt_para").value) != ""){ 538 fields += "TO " + "<=>" + url_encode(Element("txt_para").value) + " 538 fields += "TO " + "<=>" + url_encode(Element("txt_para").value) + "##"; 539 539 } 540 540 if(trim(Element("txt_cc").value) != ""){ 541 fields += "CC " + "<=>" + url_encode(Element("txt_cc").value) + " 541 fields += "CC " + "<=>" + url_encode(Element("txt_cc").value) + "##"; 542 542 } 543 543 if(value) { 544 fields = "##ALL " + "<=>" +url_encode(value) + " "; 545 } 546 547 fields += "##"; 548 if(fields == "####"){ 544 fields = "##ALL " + "<=>" +url_encode(value) + "##"; 545 } 546 547 if(fields == "##"){ 549 548 alert(get_lang("Define some search parameters!")); 550 549 return false;
Note: See TracChangeset
for help on using the changeset viewer.