Changeset 5471
- Timestamp:
- 02/03/12 15:00:08 (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/search.js
r5452 r5471 1 /**************************************************************************\2 Início3 \**************************************************************************/4 1 function searchE() 5 2 { … … 10 7 this.condition = ""; 11 8 this.sort_type = ""; 12 //this.page = 0;13 9 this.name_box_search = ""; 14 10 this.all_boxes = []; … … 16 12 this.txtfields = new Array("txt_ass","txt_de","txt_body","txt_para","txt_cc","txt_cco", "since_date", "before_date", "on_date"); 17 13 this.selectFields = new Array("flagged", "seen", "answered", "recent"); 14 this.xtools = new xtools('../expressoMail1_2/templates/'); 18 15 } 19 16 … … 21 18 searchE.prototype.showForms = function(value) 22 19 { 23 // Principal 24 if(!Element("window_search")) 25 { 26 var form_search = document.createElement("DIV"); 27 form_search.style.visibility = 'hidden'; 28 form_search.style.top = '0px'; 29 form_search.style.left = '0px'; 30 form_search.style.cursor = 'default'; 31 form_search.id = "window_search"; 32 document.body.appendChild(form_search); 33 } 34 $("#window_search").css("pointer", "default"); 35 // Pesquisa 36 if(!Element("div_form_search")) 37 { 38 var div_form_search = document.createElement("DIV"); 39 div_form_search.id = "div_form_search"; 40 div_form_search.style.position = "absolute"; 41 div_form_search.style.left = "10px"; 42 div_form_search.style.top = "10px"; 43 div_form_search.style.borderStyle = "outset"; 44 div_form_search.style.borderColor = "black"; 45 div_form_search.style.borderWidth = "1px"; 46 div_form_search.style.width = "784px"; 47 div_form_search.style.height = "418px"; 48 div_form_search.style.overflow = "hidden"; 49 div_form_search.innerHTML = ""; 50 var call_form_search = EsearchE.mount_form(); 51 div_form_search.appendChild(call_form_search); 52 form_search.appendChild(div_form_search); 53 } 54 55 if(!Element("div_button_search")){ 56 var div_button_search = document.createElement("DIV"); 57 div_button_search.id = "div_button_search"; 58 div_button_search.style.position = "absolute"; 59 div_button_search.style.marginLeft = "430px"; 60 div_button_search.style.top = "223px"; 61 div_button_search.style.width = "350px"; 62 div_button_search.style.height = "25px"; 63 div_button_search.innerHTML = "<table style='width: 100%;' border='0' cellpadding='0' cellspacing='0' align='center'>"+ 64 "<tr>"+ 65 "<td width='33%' align='center'><input type='button' value=" + get_lang('Search') + " onclick='EsearchE.func_search()'></td>"+ 66 "<td width='33%' align='center'><input type='button' value=" + get_lang('Clean') + " onclick='EsearchE.func_clean()'></td>"+ 67 "<td width='33%' align='center'><input type='button' value=" + get_lang('Close') + " onclick='EsearchE.func_close(\"hidden\")'></td>"+ 68 "</tr>"+ 69 "</table>"; 70 form_search.appendChild(div_button_search); 71 } 72 73 if(!Element("table_layer")){ 20 var div = null; 21 var args = null; 22 23 args = 24 { 25 'button_left' : "<<", 26 'button_right' : ">>", 27 "Inform_your_search_in_the_text_fields" : get_lang('Inform your search in the text fields'), 28 "From" : get_lang('From'), 29 "To" : get_lang('To'), 30 "Cc" : get_lang('Cc'), 31 "Subject" : get_lang('Subject'), 32 "Message_body" : get_lang('Message body'), 33 "Since_Date" : get_lang('Since Date'), 34 "Before_Date" : get_lang('Before Date'), 35 "On_Date" : get_lang('On Date'), 36 "Flags" : get_lang('Flags'), 37 "Flagged" : get_lang('Flagged'), 38 "Unflagged" : get_lang('Unflagged'), 39 "Seen" : get_lang('Seen'), 40 "Unseen" : get_lang('Unseen'), 41 "Answered_Forwarded" : get_lang('Answered/Forwarded'), 42 "Unanswered_Unforwarded" : get_lang('Unanswered/Unforwarded'), 43 "Recent" : get_lang('Recent'), 44 "Old" : get_lang('Old'), 45 "Search_the_messages_in_these_folders" : get_lang('Search the messages in these folders'), 46 "In_all_the_folders" : get_lang('In all the folders') 47 } 48 49 div = document.createElement("div"); 50 div.innerHTML = this.xtools.parse(this.xtools.xml('searchMails'), 'searchMails.xsl', args ); 51 div.setAttribute( "style","overflow:hidden"); 52 53 $(div).dialog( 54 { 55 resizable : false, 56 title : get_lang("Search Email"), 57 position : 'center', 58 width : 795, 59 height : 450, 60 modal : false, 61 buttons : [ 62 { 63 text: get_lang("Close"), 64 click: function() 65 { 66 $(this).dialog("close"); 67 } 68 }, 69 { 70 text: get_lang("Clean"), 71 click: function() 72 { 73 EsearchE.func_clean(); 74 } 75 }, 76 { 77 text: get_lang("Search"), 78 click: function() 79 { 80 /*EsearchE.func_search();*/ 81 $(this).dialog("close"); 82 } 83 } 84 ], 85 beforeClose : function() 86 { 87 $("#sel_search_nm_box1")[0].parentNode.removeChild($("#sel_search_nm_box1")[0]); 88 $("#divFoldersSearch")[0].parentNode.removeChild($("#divFoldersSearch")[0]); 89 $(this).dialog("destroy"); 90 div.removeChild(div.firstChild); 91 } 92 }); 93 94 if( !Element("table_layer") ) 95 { 74 96 var table_layer = ""; 75 97 } 76 98 77 if(value == "")78 EsearchE.showWindow(Element("window_search"));79 80 99 // Cria as caixas postais; 81 EsearchE.mount_folders();82 100 this.foldersTree(); 101 83 102 if(value) 84 103 { … … 87 106 EsearchE.func_search(value, null, 'SORTDATE_REVERSE'); 88 107 } 108 89 109 var dates = $("#since_date, #before_date").datepicker({ 90 110 onSelect: function( selectedDate ) { … … 98 118 } 99 119 }); 120 100 121 $("#on_date").datepicker(); 101 122 } 102 123 103 //Form 104 searchE.prototype.mount_form = function(value) 105 { 106 var form_sch = document.createElement("FORM"); 107 form_sch.id = "form_sch"; 108 109 form_sch.innerHTML = '<fieldset style="width:400px; text-align:right; padding: 5px; position:absolute;">' 110 + ' <legend>'+get_lang('Inform your search in the text fields')+'</legend>' 111 + ' <label>'+get_lang("From")+':</label>' 112 + ' <input style="margin-left: 6px;" type="text" id="txt_de" size="39">' 113 + ' <br style="margin-bottom:15px"/>' 114 + ' <label>'+get_lang('To')+':</label>' 115 + ' <input style="margin-left: 6px;" type="text" id="txt_para" size="39">' 116 + ' <br style="margin-bottom:15px"/>' 117 + ' <label>'+get_lang('Cc')+':</label>' 118 + ' <input style="margin-left: 6px;" type="text" id="txt_cc" size="39">' 119 + ' <br style="margin-bottom:15px"/>' 120 + ' <label>'+get_lang('Subject')+':</label>' 121 + ' <input style="margin-left: 6px;" type="text" id="txt_ass" size="39">' 122 + ' <br style="margin-bottom:15px"/>' 123 + ' <label>'+get_lang('Message body')+':</label>' 124 + ' <input style="margin-left: 6px;" type="text" id="txt_body" size="39">' 125 126 + ' <br style="margin-bottom:30px"/>' 127 + ' <label>'+get_lang("Since Date")+':</label>' 128 + ' <input style="margin-left: 6px;" type="text" id="since_date" size="8" maxlength="10" onkeypress="return dateMask(this, event);">' 129 //+ ' <img id="since_date-trigger" src="../phpgwapi/templates/default/images/datepopup.gif" title="'+get_lang("Select Date")+'" style="cursor:pointer; cursor:hand;"/>' 130 + ' <label style="margin-left: 20px;">'+get_lang('Before Date')+':</label>' 131 + ' <input style="margin-left: 6px;" type="text" id="before_date" size="8" maxlength="10" onkeypress="return dateMask(this, event);">' 132 //+ ' <img id="before_date-trigger" src="../phpgwapi/templates/default/images/datepopup.gif" title="'+get_lang("Select Date")+'" style="cursor:pointer; cursor:hand;"/>' 133 + ' <br style="margin-bottom:15px"/>' 134 135 + ' <label>'+get_lang('On Date')+':</label>' 136 + ' <input style="margin-left: 6px;" type="text" id="on_date" size="8" maxlength="10" onkeypress="return dateMask(this, event);">' 137 //+ ' <img style="margin-right: -8px" id="on_date-trigger" src="../phpgwapi/templates/default/images/datepopup.gif" title="'+get_lang("Select Date")+'" style="cursor:pointer; cursor:hand;"/><span> </span>' 138 + ' <br style="margin-bottom:30px"/>' 139 140 + ' <label>'+get_lang('Flags')+':</label>' 141 + ' <select style="width:15em; margin-left: 6px" name="flagged" id="flagged">' 142 + ' <option value=""/>' 143 + ' <option value="FLAGGED">'+ get_lang("Flagged") +'</option>' 144 + ' <option value="UNFLAGGED">'+ get_lang("Unflagged") +'</option>' 145 + ' </select>' 146 + ' <br style="margin-bottom:15px"/>' 147 + ' <select style="width:15em;" name="seen" id="seen">' 148 + ' <option value=""/>' 149 + ' <option value="SEEN">'+ get_lang("Seen") +'</option>' 150 + ' <option value="UNSEEN">'+ get_lang("Unseen") +'</option>' 151 + ' </select>' 152 + ' <br style="margin-bottom:15px"/>' 153 + ' <select style="width:15em;" name="answered" id="answered">' 154 + ' <option value=""/>' 155 + ' <option value="ANSWERED">'+ get_lang('Answered/Forwarded') +'</option>' 156 + ' <option value="UNANSWERED">'+ get_lang('Unanswered/Unforwarded') +'</option>' 157 + ' </select>' 158 + ' <br style="margin-bottom:15px"/>' 159 + ' <select style="width:15em;visibility:hidden;" name="recent" id="recent">' 160 + ' <option value=""/>' 161 + ' <option value="RECENT">'+ get_lang('Recent') +'</option>' 162 + ' <option value="OLD">'+ get_lang('Old') +'</option>' 163 + ' </select>' 164 165 + ' <br style="margin-bottom:60px"/>' 166 + '</fieldset>' 167 + '<fieldset style="width:350px; padding: 5px; position:absolute; margin-left: 414px">' 168 + ' <legend>'+get_lang('Search the messages in these folders')+'</legend>' 169 + ' <div id="folders" style="width:160px; height:150px;float:left;margin-bottom:10px;"></div>' 170 + ' <div style="float:left;height:100px;padding-top:50px;margin: 0 3px;">' 171 + ' <input type="button" id="incluir" name="incluir" value=">>" onclick="EsearchE.add_mailboxes()">' 172 + ' <br style="margin-bottom:15px">' 173 + ' <input type="button" id="excluir" name="excluir" value="<<" onclick="EsearchE.del_mailboxes()">' 174 + ' </div>' 175 + ' <div style="float:left;">' 176 + ' <select multiple id="sel_search_nm_box1" name="sel_search_nm_box1" style="width:140px;height:150px;"></select>' 177 + ' </div>' 178 + ' <br clear="both">' 179 + ' <input type="checkBox" id="check_all_msg" name="check_all_msg" onclick="EsearchE.all_mailboxes()">' 180 + ' <b>'+get_lang('In all the folders')+'</b>' 181 + '</fieldset>'; 182 183 return form_sch; 184 } 185 186 // Pastas; 187 searchE.prototype.mount_folders = function() 188 { 189 connector.loadScript("TreeS"); 190 191 if( Element("div_folders_search") == null) 192 { 193 var div_folders = document.createElement("DIV"); 194 div_folders.id = "div_folders_search"; 195 div_folders.style.width = "155px"; 196 div_folders.style.height = "152px"; 197 div_folders.style.borderStyle = "outset"; 198 div_folders.style.borderColor = "black"; 199 div_folders.style.borderWidth = "1px"; 200 div_folders.style.background = "#F7F7F7"; 201 div_folders.style.overflow = "auto"; 202 div_folders.innerHTML = ""; 203 var dest_div = Element("folders"); 204 dest_div.appendChild(div_folders); 205 } 206 ttree.make_tree($("#div_folders_search")[0],"_folders_tree_search","","","",""); 124 searchE.prototype.foldersTree = function() 125 { 126 var treeFoldersSearch = new dFTree({ name : 'treeFoldersSearch' }); 127 128 var root = new dNode({ id : 'root', caption: get_lang('My Folders'), onClick: "ttree.setFolder('root')" }); 129 130 treeFoldersSearch.add(root, 'root'); 131 132 for(var i = 0; i < folders.length ; i++ ) 133 { 134 var nn = new dNode({ id:folders[i].folder_id, caption: lang_folder(folders[i].folder_name), plusSign:folders[i].folder_hasChildren, onClick: "ttree.setFolder('"+folders[i].folder_id+"')"}); 135 136 if ( folders[i].folder_parent == '' ) 137 { 138 folders[i].folder_parent = 'root'; 139 } 140 else if ( folders[i].folder_parent == 'user' ) 141 { 142 if ( treeFoldersSearch.getNodeById('user') ) 143 { 144 var n_root_shared_folders = new dNode({ id:'user', caption:get_lang("Shared Folders"), plusSign:true}); 145 treeFoldersSearch.add( n_root_shared_folders,'root'); 146 } 147 } 148 149 // Ver Ticket #1548 150 if( folders[i].folder_parent != 'root') 151 { 152 var node_parent = treeFoldersSearch.getNodeById(folders[i].folder_parent); 153 154 if( typeof node_parent != 'undefined') 155 { 156 node_parent.plusSign = true; 157 treeFoldersSearch.alter(node_parent); 158 } 159 } 160 161 treeFoldersSearch.add( nn, folders[i].folder_parent ); 162 } 163 164 treeFoldersSearch.draw( $("#divFoldersSearch")[0] ); 165 treeFoldersSearch.getNodeById("root")._select(); 166 root.changeState(); 207 167 } 208 168 … … 223 183 } 224 184 225 185 if ( local_folders.length > 0 ) 226 186 _gears = expresso_local_messages.search( local_folders, expresso_local_messages.getFilter() ); 227 187 … … 253 213 } 254 214 255 if(this.page != 0 && this.page != null) { 215 if(this.page != 0 && this.page != null) 216 { 256 217 _link = document.createElement("A"); 257 if( this.value ) 258 _link.href = 'javascript:EsearchE.quickSearchMail( false, '+0+', false, "'+currentTab+'" )'; 259 else{ 260 _link.href = 'javascript:EsearchE.page=0;'; 261 _link.href += 'cExecute("$this.imap_functions.search_msg",openpage,"condition='+this.condition+'&sort_type='+this.sort_type+'&page=0¤t_tab='+currentTab+'");'; 218 if( this.value ) 219 _link.href = 'javascript:EsearchE.quickSearchMail( false, '+0+', false, "'+currentTab+'" )'; 220 else 221 { 222 _link.href = 'javascript:EsearchE.page=0;'; 223 _link.href += 'cExecute("$this.imap_functions.search_msg",openpage,"condition='+this.condition+'&sort_type='+this.sort_type+'&page=0¤t_tab='+currentTab+'");'; 224 } 262 225 } 263 }264 else{226 else 227 { 265 228 _link = document.createElement("SPAN"); 266 229 } 230 267 231 span_pg.appendChild(_link); 268 232 269 _link.innerHTML = "<<"; 270 _link.title = get_lang("First"); 233 _link.innerHTML = "<<"; 234 _link.title = get_lang("First"); 235 271 236 span_pg.innerHTML += " "; 272 237 … … 328 293 _link.innerHTML = " "+( i + 1 )+" "; 329 294 } 330 //span_pg.innerHTML += " "; 331 332 span_pg.appendChild( _link ); 295 296 span_pg.appendChild( _link ); 333 297 } 334 298 … … 360 324 var sort_type = sortType; 361 325 var is_local = border_id.match('.*_local_.*'); 326 362 327 if(!is_local) 328 { 363 329 if( this.value ) 364 330 return this.quickSearchMail( document.getElementsByName(currentTab)[0].value, false, sortType, border_id ); 331 } 365 332 366 333 var args = "$this.imap_functions.search_msg"; … … 383 350 384 351 385 if ( local_folders.length > 0 ){ 386 var currentSearch = document.getElementsByName(currentTab); 387 expresso_local_messages.setSortType(sortType); 388 gears = expresso_local_messages.search( local_folders, "##ALL <=>"+currentSearch[0].value +"##" ); 389 } 352 if ( local_folders.length > 0 ) 353 { 354 var currentSearch = document.getElementsByName(currentTab); 355 expresso_local_messages.setSortType(sortType); 356 gears = expresso_local_messages.search( local_folders, "##ALL <=>"+currentSearch[0].value +"##" ); 357 } 390 358 } 391 359 if (!is_local) … … 411 379 }; 412 380 413 414 415 416 417 418 419 420 381 if (is_local) 382 { 383 eval("handler('none')"); 384 } 385 else 386 { 387 cExecute(args,handler,params); 388 } 421 389 } 422 390 … … 1009 977 1010 978 _divScroll = document.createElement("DIV"); 1011 _divScroll.id = "divScrollHead_"+numBox;979 _divScroll.id = "divScrollHead_"+numBox; 1012 980 _divScroll.style.overflowY = "hidden"; 1013 981 _divScroll.style.overflowX = "hidden"; … … 1033 1001 1034 1002 resizeWindow(); 1035 if(typeof(Data.data_gears)=="undefined") 1036 EsearchE.show_paging( Data['num_msgs'] ); 1003 1004 if(typeof(Data.data_gears)=="undefined") 1005 EsearchE.show_paging( Data['num_msgs'] ); 1037 1006 } 1038 1007 … … 1054 1023 { 1055 1024 var sel = Element("sel_search_nm_box1"); 1056 if (!proxy_mensagens.is_local_folder(this.name_box_search)) { 1025 1026 if (!proxy_mensagens.is_local_folder(this.name_box_search)) 1027 { 1057 1028 var name_box = this.name_box_search.split(cyrus_delimiter); 1058 1029 if(this.name_box_search == "") … … 1065 1036 } 1066 1037 } 1067 else { 1038 else 1039 { 1068 1040 if(this.name_box_search=='local_root') 1069 1041 return; … … 1077 1049 name_box_def = this.name_box_search.substr(6);//Retira o 'local_' 1078 1050 } 1079 if( sel.length > 0){ 1080 for(var i=0; i < sel.options.length; i++){ 1081 if(sel.options[i].value == this.name_box_search){ 1051 1052 if( sel.length > 0) 1053 { 1054 for(var i=0; i < sel.options.length; i++) 1055 { 1056 if(sel.options[i].value == this.name_box_search) 1057 { 1082 1058 alert(get_lang('This message is already selected!')); 1083 1059 return false; … … 1085 1061 } 1086 1062 } 1087 name_box_def = translateFolder(name_box_def); 1088 var opt = new Option(lang_folder(name_box_def),this.name_box_search,false,true);1089 sel[sel.length] = opt;1063 1064 name_box_def = translateFolder(name_box_def); 1065 sel[sel.length] = new Option(lang_folder(name_box_def),this.name_box_search,false,true); 1090 1066 } 1091 1067 … … 1105 1081 } 1106 1082 } 1107 1108 1083 } 1109 1084 … … 1134 1109 { 1135 1110 var fields = "##"; 1136 // Verifica se os campos estão preenchidos; 1137 if(trim(Element("txt_ass").value) != ""){ 1138 fields += "SUBJECT " + "<=>" +url_encode(Element("txt_ass").value) + "##"; 1139 } 1140 if(trim(Element("txt_body").value) != ""){ 1141 fields += "BODY " + "<=>" + url_encode(Element("txt_body").value) + "##"; 1142 } 1143 if(trim(Element("txt_de").value) != ""){ 1144 fields += "FROM " + "<=>" + url_encode(Element("txt_de").value) + "##"; 1145 } 1146 if(trim(Element("txt_para").value) != ""){ 1147 fields += "TO " + "<=>" + url_encode(Element("txt_para").value) + "##"; 1148 } 1149 if(trim(Element("txt_cc").value) != ""){ 1150 fields += "CC " + "<=>" + url_encode(Element("txt_cc").value) + "##"; 1151 } 1152 if (trim(Element("since_date").value) != "") 1111 // Verifica se os campos estão preenchidos; 1112 if(trim(Element("txt_ass").value) != ""){ 1113 fields += "SUBJECT " + "<=>" +url_encode(Element("txt_ass").value) + "##"; 1114 } 1115 if(trim(Element("txt_body").value) != ""){ 1116 fields += "BODY " + "<=>" + url_encode(Element("txt_body").value) + "##"; 1117 } 1118 if(trim(Element("txt_de").value) != ""){ 1119 fields += "FROM " + "<=>" + url_encode(Element("txt_de").value) + "##"; 1120 } 1121 if(trim(Element("txt_para").value) != ""){ 1122 fields += "TO " + "<=>" + url_encode(Element("txt_para").value) + "##"; 1123 } 1124 if(trim(Element("txt_cc").value) != ""){ 1125 fields += "CC " + "<=>" + url_encode(Element("txt_cc").value) + "##"; 1126 } 1127 if (trim(Element("since_date").value) != "") 1128 { 1129 if (validate_date(Element("since_date").value)) 1153 1130 { 1154 if (validate_date(Element("since_date").value)) 1131 fields += "SINCE " + "<=>" + url_encode(Element("since_date").value) + "##"; 1132 } 1133 else 1134 { 1135 alert(get_lang('Invalid date on field %1', get_lang('Since Date'))); 1136 return false; 1137 } 1138 } 1139 1140 if (trim(Element("before_date").value) != "") 1141 { 1142 if (validate_date(Element("before_date").value)) 1143 { 1144 fields += "BEFORE " + "<=>" + url_encode(Element("before_date").value) + "##"; 1145 } 1146 else 1155 1147 { 1156 fields += "SINCE " + "<=>" + url_encode(Element("since_date").value) + "##"; 1157 } 1158 else 1159 { 1160 alert(get_lang('Invalid date on field %1', get_lang('Since Date'))); 1161 return false; 1162 } 1163 } 1164 1165 if (trim(Element("before_date").value) != "") 1166 { 1167 if (validate_date(Element("before_date").value)) 1168 { 1169 fields += "BEFORE " + "<=>" + url_encode(Element("before_date").value) + "##"; 1170 } 1171 else 1172 { 1173 alert(get_lang('Invalid date on field %1', get_lang('Before Date'))); 1174 return false; 1175 } 1176 } 1177 if ((trim(Element("since_date").value) != "") && (trim(Element("before_date").value) != "")){ 1178 if(!(validate_date_order(trim(Element("since_date").value), trim(Element("before_date").value)))){ 1179 alert(get_lang('Invalid date on field %1', get_lang('Before Date'))); 1180 return false; 1181 } 1182 } 1183 if(trim(Element("on_date").value) != "") 1184 { 1185 if (validate_date(Element("on_date").value)) 1186 { 1187 fields += "ON " + "<=>" + url_encode(Element("on_date").value) + "##"; 1188 } 1189 else 1190 { 1191 alert(get_lang('Invalid date on field %1', get_lang('On Date'))); 1148 alert(get_lang('Invalid date on field %1', get_lang('Before Date'))); 1192 1149 return false; 1193 1150 } 1194 1151 } 1152 1153 if ((trim(Element("since_date").value) != "") && (trim(Element("before_date").value) != "")){ 1154 if(!(validate_date_order(trim(Element("since_date").value), trim(Element("before_date").value)))){ 1155 alert(get_lang('Invalid date on field %1', get_lang('Before Date'))); 1156 return false; 1157 } 1158 } 1159 1160 if(trim(Element("on_date").value) != "") 1161 { 1162 if (validate_date(Element("on_date").value)) 1163 { 1164 fields += "ON " + "<=>" + url_encode(Element("on_date").value) + "##"; 1195 1165 } 1196 1197 if(trim(Element("flagged").options[Element("flagged").selectedIndex].value) != "") 1166 else 1198 1167 { 1199 if (Element("flagged").options[Element("flagged").selectedIndex].value == "FLAGGED") 1200 { 1201 fields += "FLAGGED##"; 1202 } 1203 else 1204 { 1205 fields += "UNFLAGGED##"; 1206 } 1168 alert(get_lang('Invalid date on field %1', get_lang('On Date'))); 1169 return false; 1207 1170 } 1208 1171 1209 if(trim(Element("seen").options[Element("seen").selectedIndex].value) != "") 1172 } 1173 1174 if(trim(Element("flagged").options[Element("flagged").selectedIndex].value) != "") 1175 { 1176 if (Element("flagged").options[Element("flagged").selectedIndex].value == "FLAGGED") 1210 1177 { 1211 if (Element("seen").options[Element("seen").selectedIndex].value == "SEEN") 1212 { 1213 fields += "SEEN##"; 1214 } 1215 else 1216 { 1217 fields += "UNSEEN##"; 1218 } 1178 fields += "FLAGGED##"; 1219 1179 } 1180 else 1181 { 1182 fields += "UNFLAGGED##"; 1183 } 1184 } 1185 1186 if(trim(Element("seen").options[Element("seen").selectedIndex].value) != "") 1187 { 1188 if (Element("seen").options[Element("seen").selectedIndex].value == "SEEN") 1189 { 1190 fields += "SEEN##"; 1191 } 1192 else 1193 { 1194 fields += "UNSEEN##"; 1195 } 1196 } 1220 1197 1221 if(trim(Element("answered").options[Element("answered").selectedIndex].value) != "") 1198 if(trim(Element("answered").options[Element("answered").selectedIndex].value) != "") 1199 { 1200 if (Element("answered").options[Element("answered").selectedIndex].value == "ANSWERED"){ 1201 fields += "ANSWERED##"; 1202 } 1203 else { 1204 fields += "UNANSWERED##"; 1205 } 1206 } 1207 1208 if(trim(Element("recent").options[Element("recent").selectedIndex].value) != "") 1209 { 1210 if (Element("answered").options[Element("answered").selectedIndex].value == "RECENT") 1222 1211 { 1223 if (Element("answered").options[Element("answered").selectedIndex].value == "ANSWERED"){ 1224 fields += "ANSWERED##"; 1225 } 1226 else { 1227 fields += "UNANSWERED##"; 1228 } 1212 fields += "RECENT##"; 1229 1213 } 1230 1231 if(trim(Element("recent").options[Element("recent").selectedIndex].value) != "") 1214 else 1232 1215 { 1233 if (Element("answered").options[Element("answered").selectedIndex].value == "RECENT") 1234 { 1235 fields += "RECENT##"; 1236 } 1237 else 1238 { 1239 fields += "OLD##"; 1240 } 1216 fields += "OLD##"; 1241 1217 } 1218 } 1242 1219 1243 1220 if(fields == "##") … … 1295 1272 } 1296 1273 1297 var handler = function( data ) 1298 { 1299 var allMsg = [3]; 1300 var count = ( data['num_msgs'] ) ? data['num_msgs'] : "0"; 1301 var tmp = []; 1302 1303 // Gears - local 1304 if ( local_folders.length > 0 ){ 1305 expresso_local_messages.setSortType('SORTDATE'); 1306 tmp = expresso_local_messages.search( local_folders, fields ); 1307 } 1308 1309 if( data['num_msgs'] ) 1274 var handler = function( data ) 1275 { 1276 var allMsg = [3]; 1277 var count = ( data['num_msgs'] ) ? data['num_msgs'] : "0"; 1278 var tmp = []; 1279 1280 // Gears - local 1281 if ( local_folders.length > 0 ){ 1282 expresso_local_messages.setSortType('SORTDATE'); 1283 tmp = expresso_local_messages.search( local_folders, fields ); 1284 } 1285 1286 if( data['num_msgs'] ) 1287 { 1288 allMsg['data'] = data['data']; 1289 allMsg['num_msgs'] = data['num_msgs']; 1290 } 1291 1292 if( tmp.length > 0 ) 1293 { 1294 allMsg['gears_num_msgs'] = tmp.length ; 1295 } 1296 1297 if( ( data['num_msgs'] ) == 0 ) 1298 { 1299 alert( get_lang("None result was found.") ); 1300 } 1301 else 1302 { 1303 if( (tmp.length > 0) && (!data['num_msgs']) ) 1310 1304 { 1311 allMsg['data'] = data['data']; 1312 allMsg['num_msgs'] = data['num_msgs']; 1313 } 1314 1315 if( tmp.length > 0 ) 1316 { 1317 allMsg['gears_num_msgs'] = tmp.length ; 1318 } 1319 1320 if( ( data['num_msgs'] ) == 0 ) 1321 { 1322 alert( get_lang("None result was found.") ); 1305 EsearchE.viewLocalMessage(); 1323 1306 } 1324 1307 else 1325 1308 { 1326 if( (tmp.length > 0) && (!data['num_msgs']) ) 1327 { 1328 EsearchE.viewLocalMessage(); 1329 } 1330 else 1331 { 1332 if(count > 0) 1333 EsearchE.func_clean(); 1334 write_msg( count + " " + get_lang("results found") ); 1335 EsearchE.mount_result( allMsg, 'SORTDATE' ); 1336 } 1337 } 1338 } 1339 1340 this.condition = nm_box; 1341 this.page = 0; 1342 var args = "$this.imap_functions.search_msg"; 1343 var params = "condition=" + nm_box+ "&page=0"+ "&sort_type=SORTDATE"; 1344 1345 if( expresso_offline ) 1346 handler('none'); 1347 else 1348 cExecute( args, handler, params); 1309 if(count > 0) 1310 EsearchE.func_clean(); 1311 write_msg( count + " " + get_lang("results found") ); 1312 EsearchE.mount_result( allMsg, 'SORTDATE' ); 1313 } 1314 } 1315 } 1316 1317 this.condition = nm_box; 1318 this.page = 0; 1319 var args = "$this.imap_functions.search_msg"; 1320 var params = "condition=" + nm_box+ "&page=0"+ "&sort_type=SORTDATE"; 1321 1322 if( expresso_offline ) 1323 handler('none'); 1324 else 1325 cExecute( args, handler, params); 1349 1326 } 1350 1327 … … 1363 1340 var not_found_corrent_folder = true; 1364 1341 1365 // if( Element("check_all_msg").checked ) 1366 // { 1367 this.all_mailboxes(); 1368 var nm_box = new Array; 1369 for(var i=0; i < EsearchE.all_boxes.length; i++) 1370 { 1371 nm_box[i] = EsearchE.all_boxes[i]/* + fields*/; 1372 } 1373 if (preferences.use_local_messages == 1) 1374 { 1375 temp = expresso_local_messages.list_local_folders(); 1376 for (var x in temp) 1377 { 1378 local_folders.push(temp[x][0]); 1379 } 1380 } 1342 this.all_mailboxes(); 1343 var nm_box = new Array; 1344 1345 for(var i=0; i < EsearchE.all_boxes.length; i++) 1346 { 1347 nm_box[i] = EsearchE.all_boxes[i]; 1348 } 1349 1350 if (preferences.use_local_messages == 1) 1351 { 1352 temp = expresso_local_messages.list_local_folders(); 1353 for (var x in temp) 1354 { 1355 local_folders.push(temp[x][0]); 1356 } 1357 } 1358 1381 1359 this.sort = sort || this.sort || "SORTDATE"; 1382 1360 this.page = isNaN(page) ? ( value ? 0 : this.page ) : page; … … 1453 1431 if( !allMsg['num_msgs'] && !url.length && not_found_corrent_folder){ 1454 1432 clean_msg(); 1455 //alert( get_lang("None result was found.") );1456 1433 return EsearchE.viewLocalMessage(); 1457 1434 } … … 1476 1453 } 1477 1454 1478 // clean;1455 // clean; 1479 1456 searchE.prototype.func_clean = function() 1480 1457 { … … 1511 1488 $("#since_date, #before_date, #on_date").datepicker( "destroy" ); 1512 1489 } 1513 // Monta a janela em tela;1514 searchE.prototype.showWindow = function(div)1515 {1516 if(!this.searchW[div.id])1517 {1518 div.style.width = "804px";1519 div.style.height = "440px";1520 div.style.visibility = "hidden";1521 div.style.position = "absolute";1522 div.style.zIndex = "10";1523 var title = ":: "+ get_lang("Search")+" ::";1524 var wHeight = div.offsetHeight + "px";1525 var wWidth = div.offsetWidth + "px";1526 1527 win = new dJSWin({1528 id: 'ccList'+div.id,1529 content_id: div.id,1530 width: wWidth,1531 height: wHeight,1532 title_color: '#3978d6',1533 bg_color: '#eee',1534 title: title,1535 title_text_color: 'white',1536 button_y_img: '../phpgwapi/images/win_min.gif',1537 button_x_img: '../phpgwapi/images/winclose.gif',1538 border: true});1539 this.searchW[div.id] = win;1540 win.draw();1541 }1542 else1543 {1544 var _this = this;1545 win = this.searchW[div.id];1546 if((_this.type == "close" && win.state == 0) || win.state == 2){EsearchE.func_clean();}1547 win.draw();1548 }1549 win.open();1550 }1551 1490 1552 1491 searchE.prototype.aux_local_folder_display = function(folder) … … 1593 1532 } 1594 1533 1595 1596 1534 // Cria o objeto 1597 var EsearchE; 1598 EsearchE = new searchE(); 1535 var EsearchE = new searchE(); -
trunk/expressoMail1_2/setup/phpgw_pt-br.lang
r5458 r5471 434 434 Save in folder expressoMail1_2 pt-br Salvar na pasta 435 435 Save sent messages in folder expressoMail1_2 pt-br Salvar automaticamente as mensagens enviadas na pasta 436 Search Email expressoMail1_2 pt-br Procurar Email 436 437 Search expressoMail1_2 pt-br Pesquisar 437 438 Search for Organization expressoMail1_2 pt-br Pesquisar por Organização -
trunk/phpgwapi/js/dftree/dftree.js
r1375 r5471 205 205 } 206 206 207 if(document.getElementById("div _folders_search") != null){207 if(document.getElementById("divFoldersSearch") != null){ 208 208 if(EsearchE.name_box_search != ""){ 209 209 EsearchE.name_box_search = "";
Note: See TracChangeset
for help on using the changeset viewer.