Changeset 2052 in subversion
- Timestamp:
- Nov 14, 2008 6:18:00 AM (5 years ago)
- Location:
- trunk/roundcubemail/program
- Files:
-
- 3 edited
-
include/rcube_imap.php (modified) (3 diffs)
-
lib/imap.inc (modified) (2 diffs)
-
steps/mail/search.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_imap.php
r2049 r2052 289 289 function set_search_set($str=null, $msgs=null, $charset=null, $sort_field=null) 290 290 { 291 if ( $msgs == null)291 if (is_array($str) && $msgs == null) 292 292 list($str, $msgs, $charset, $sort_field) = $str; 293 293 if ($msgs != null && !is_array($msgs)) … … 924 924 function search($mbox_name='', $str=NULL, $charset=NULL, $sort_field=NULL) 925 925 { 926 if (!$str) 927 return false; 928 926 929 $mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox; 927 930 … … 929 932 930 933 // try search with ISO charset (should be supported by server) 931 if (empty($results) && !empty($charset) && $charset!='ISO-8859-1') 934 // only if UTF-8 search is not supported 935 if (empty($results) && !is_array($results) && !empty($charset) && $charset!='ISO-8859-1') 932 936 { 933 937 // convert strings to ISO-8859-1 -
trunk/roundcubemail/program/lib/imap.inc
r2046 r2052 942 942 } while (!iil_StartsWith($line, 's ', true)); 943 943 944 if (empty($data)) { 945 $conn->error = $line; 946 return false; 944 $result_code = iil_ParseResult($line); 945 946 if ($result_code != 0) { 947 $conn->error = 'iil_C_Sort: ' . $line . "\n"; 948 return false; 947 949 } 948 950 … … 2117 2119 } 2118 2120 } while (!iil_StartsWith($line, 'srch1', true)); 2119 2121 2120 2122 $result_code = iil_ParseResult($line); 2121 2123 if ($result_code == 0) { -
trunk/roundcubemail/program/steps/mail/search.inc
r2049 r2052 86 86 87 87 // execute IMAP search 88 $result = $IMAP->search($mbox, $search_str, $imap_charset, $_SESSION['sort_col']); 89 $count = 0;88 if ($search_str) 89 $result = $IMAP->search($mbox, $search_str, $imap_charset, $_SESSION['sort_col']); 90 90 91 // Make sure our $result is legit.. 92 if (is_array($result) && $result[0] != '') 91 // Get the headers 92 $result_h = $IMAP->list_headers($mbox, 1, $_SESSION['sort_col'], $_SESSION['sort_order']); 93 $count = $IMAP->messagecount(); 94 95 // save search results in session 96 if (!is_array($_SESSION['search'])) 97 $_SESSION['search'] = array(); 98 99 // Make sure we got the headers 100 if (!empty($result_h)) 93 101 { 94 // Get the headers 95 $result_h = $IMAP->list_headers($mbox, 1, $_SESSION['sort_col'], $_SESSION['sort_order']); 96 $count = $IMAP->messagecount(); 97 98 // save search results in session 99 if (!is_array($_SESSION['search'])) 100 $_SESSION['search'] = array(); 101 102 // Make sure we got the headers 103 if ($result_h != NULL) 104 { 102 if ($search_str) { 105 103 $_SESSION['search'][$search_request] = $IMAP->get_search_set(); 106 104 $_SESSION['last_text_search'] = $str; 107 rcmail_js_message_list($result_h);108 $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $count));109 105 } 106 rcmail_js_message_list($result_h); 107 $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $count)); 110 108 } 111 109 else 112 110 { 113 111 $OUTPUT->show_message('searchnomatch', 'notice'); 114 $search_request = -1;115 112 } 116 113 117 114 // update message count display 118 $pages = ceil($count/$IMAP->page_size); 119 $OUTPUT->set_env('search_request', $search_request); 115 $OUTPUT->set_env('search_request', $search_str ? $search_request : -1); 120 116 $OUTPUT->set_env('messagecount', $count); 121 $OUTPUT->set_env('pagecount', $pages);117 $OUTPUT->set_env('pagecount', ceil($count/$IMAP->page_size)); 122 118 $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count, 1)); 123 119 $OUTPUT->send();
Note: See TracChangeset
for help on using the changeset viewer.
