Changeset 4847 for branches/2.3/expressoMail1_2/js/search.js
- Timestamp:
- 07/21/11 16:29:18 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/expressoMail1_2/js/search.js
r4782 r4847 380 380 if ( local_folders.length > 0 ){ 381 381 expresso_local_messages.setSortType(sortType); 382 gears = expresso_local_messages.search( local_folders, expresso_local_messages.getFilter() );382 gears = expresso_local_messages.search( expresso_local_messages.getFolders(), expresso_local_messages.getFilter() ); 383 383 } 384 384 } … … 428 428 429 429 if ( local_folders.length > 0 ) 430 gears = expresso_local_messages.search( local_folders, expresso_local_messages.getFilter() );430 gears = expresso_local_messages.search( expresso_local_messages.getFolders(), expresso_local_messages.getFilter() ); 431 431 432 432 data['data_gears'] = gears; … … 923 923 table_element.appendChild(colgr_element); 924 924 925 if( parseInt( Data['gears_num_msgs'] ) > 0 )925 if( parseInt( Data['gears_num_msgs'] ) > 0 && !Data['data_gears']) 926 926 { 927 927 var _div_gears = document.createElement("div"); … … 1223 1223 } 1224 1224 1225 var handler = function( data ) 1226 { 1227 var allMsg = [3]; 1228 var count = ( data['num_msgs'] ) ? data['num_msgs'] : "0"; 1229 var tmp = []; 1230 1231 // Gears - local 1232 if ( local_folders.length > 0 ){ 1233 expresso_local_messages.setSortType('SORTDATE'); 1234 tmp = expresso_local_messages.search( local_folders, fields ); 1235 } 1236 1237 if( data['num_msgs'] ) 1225 var handler = function( data ) 1238 1226 { 1239 allMsg['data'] = data['data']; 1240 allMsg['num_msgs'] = data['num_msgs']; 1241 } 1242 1243 if( tmp.length > 0 ) 1244 { 1245 allMsg['gears_num_msgs'] = tmp.length ; 1227 var allMsg = [3]; 1228 var tmp = []; 1229 1230 // Gears - local 1231 if ( local_folders.length > 0 ){ 1232 expresso_local_messages.setSortType('SORTDATE'); 1233 tmp = expresso_local_messages.search( local_folders, fields ); 1234 } 1235 var count = data['num_msgs'] ? data['num_msgs'] : tmp.length > 0 ? tmp.length : "0"; 1236 1237 if( data['num_msgs'] ) 1238 { 1239 allMsg['data'] = data['data']; 1240 allMsg['num_msgs'] = data['num_msgs']; 1241 } 1242 1243 if( tmp.length > 0 ) 1244 { 1245 allMsg['gears_num_msgs'] = tmp.length ; 1246 } 1247 1248 if( data['num_msgs'] == 0 && tmp.length < 0) 1249 { 1250 alert( get_lang("None result was found.") ); 1251 } 1252 else 1253 { 1254 if(tmp.length > 0 && !data['num_msgs']) 1255 { 1256 allMsg['data_gears'] = tmp; 1257 } 1258 1259 write_msg( count + " " + get_lang("results found") ); 1260 EsearchE.mount_result( allMsg, 'SORTDATE' ); 1261 } 1246 1262 } 1263 1264 this.condition = nm_box; 1265 this.page = 0; 1266 var args = "$this.imap_functions.search_msg"; 1267 var params = "condition=" + nm_box+ "&page=0"+ "&sort_type=SORTDATE"; 1268 1269 if( expresso_offline ) 1270 handler('none'); 1271 else 1272 cExecute( args, handler, params); 1247 1273 1248 if( ( data['num_msgs'] ) == 0 ) 1249 { 1250 alert( get_lang("None result was found.") ); 1251 } 1252 else 1253 { 1254 if( (tmp.length > 0) && (!data['num_msgs']) ) 1255 { 1256 EsearchE.viewLocalMessage(); 1257 } 1258 else 1259 { 1260 write_msg( count + " " + get_lang("results found") ); 1261 EsearchE.mount_result( allMsg, 'SORTDATE' ); 1262 } 1263 } 1264 } 1265 1266 this.condition = nm_box; 1267 this.page = 0; 1268 var args = "$this.imap_functions.search_msg"; 1269 var params = "condition=" + nm_box+ "&page=0"+ "&sort_type=SORTDATE"; 1270 1271 if( expresso_offline ) 1272 handler('none'); 1273 else 1274 cExecute( args, handler, params); 1275 } 1274 } 1276 1275 // clean; 1277 1276 searchE.prototype.func_clean = function()
Note: See TracChangeset
for help on using the changeset viewer.