Changeset 4847
- Timestamp:
- 07/21/11 16:29:18 (13 years ago)
- Location:
- branches/2.3/expressoMail1_2/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/expressoMail1_2/js/local_messages.js
r4831 r4847 8 8 this.store = null; 9 9 this.filterSerch = ""; 10 this.folders = []; 10 11 this.sortType = ""; 11 12 } … … 934 935 } 935 936 937 local_messages.prototype.setFolders = function(sFolders) 938 { 939 this.folders = sFolders; 940 } 941 942 local_messages.prototype.getFolders = function() 943 { 944 return this.folders; 945 } 946 936 947 local_messages.prototype.setFilter = function(sFilter) 937 948 { … … 959 970 this.init_local_messages(); 960 971 this.setFilter(sFilter); 972 this.setFolders(folders); 961 973 var filters = sFilter.replace(/^##|##$/g,"").split('##'); 962 974 var friendly_filters = new Array(); -
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.