[6285] | 1 | /* |
---|
| 2 | * Retorna as regras por remetente e que o usuário deseja ser avisado |
---|
| 3 | */ |
---|
| 4 | function getFromAlertRules() { |
---|
| 5 | var filters = DataLayer.get("filter"); |
---|
| 6 | fromRules = []; |
---|
| 7 | var alertMessage; |
---|
[6355] | 8 | var active; |
---|
[6285] | 9 | for (var index in filters) { |
---|
| 10 | alertMessage = filters[index]['alertMessage']; |
---|
[6355] | 11 | active = filters[index]['enabled']; |
---|
[6285] | 12 | for(var criterias in filters[index]['actions']) { |
---|
[6355] | 13 | if (filters[index]['actions'][criterias]['type'] == 'fileinto' && alertMessage == 'true' && active == 'true') |
---|
[6285] | 14 | fromRules[fromRules.length] = filters[index]['actions'][criterias]['parameter']; |
---|
| 15 | } |
---|
| 16 | } |
---|
| 17 | return fromRules; |
---|
| 18 | } |
---|
| 19 | |
---|
[6292] | 20 | /* |
---|
| 21 | * Verifica se a regra Fora de escritório está ativa |
---|
| 22 | */ |
---|
[5950] | 23 | function outOfficeVerify() { |
---|
| 24 | DataLayer.remove('filter', false); |
---|
| 25 | var filters = DataLayer.get("filter"); |
---|
| 26 | var outoffice_active = false; |
---|
[6021] | 27 | outoffice = false; |
---|
[5950] | 28 | for(var index in filters){ |
---|
| 29 | if(filters[index].id == "vacation") |
---|
| 30 | outoffice = true; |
---|
| 31 | if(filters[index].id == "vacation" && filters[index].enabled == "true"){ |
---|
| 32 | write_msg(get_lang("Attention, you are in out of office mode."), true); |
---|
| 33 | outoffice_active = true; |
---|
| 34 | break; |
---|
| 35 | } |
---|
| 36 | } |
---|
[6021] | 37 | if(!outoffice_active) |
---|
| 38 | clean_msg(); |
---|
[5950] | 39 | } |
---|
| 40 | |
---|
[6292] | 41 | /* |
---|
| 42 | * Valida os campos do formulário da tela de filtros para salvar. |
---|
| 43 | */ |
---|
[5591] | 44 | valid_save = function(){ |
---|
[5662] | 45 | var accord = list_container.find(".rule-details-container").accordion({autoHeight: false}); |
---|
[5598] | 46 | if(list_container.find('[name="name"]').attr("disabled") != "disabled") |
---|
[5591] | 47 | { |
---|
[5598] | 48 | if($.trim(list_container.find('[name="name"]').val()) == ""){ |
---|
[5801] | 49 | $.Zebra_Dialog(get_lang("No name filled"),{ |
---|
[5662] | 50 | 'onClose': function(caption) { |
---|
| 51 | list_container.find('[name="name"]').focus(); |
---|
| 52 | } |
---|
| 53 | }); |
---|
| 54 | accord.accordion('activate',0); |
---|
[5591] | 55 | return false; |
---|
[5598] | 56 | }else if($.trim(list_container.find('[name="name"]').val()) == "vacation"){ |
---|
[5801] | 57 | $.Zebra_Dialog(get_lang("Invalid name, 'vacation' is a reserved word"),{ |
---|
[5662] | 58 | 'onClose': function(caption) { |
---|
| 59 | list_container.find('[name="name"]').val("").focus(); |
---|
| 60 | } |
---|
| 61 | }); |
---|
| 62 | accord.accordion('activate',0); |
---|
[5591] | 63 | return false; |
---|
| 64 | }else{ |
---|
| 65 | filter_list = DataLayer.get("filter", true); |
---|
| 66 | var error = false; |
---|
| 67 | $.each(filter_list, function(index, value){ |
---|
[5598] | 68 | if(filter_list[index].name == list_container.find('[name="name"]').val()){ |
---|
[5801] | 69 | $.Zebra_Dialog(get_lang("There is already a filter with this name"),{ |
---|
[5662] | 70 | 'onClose': function(caption) { |
---|
| 71 | list_container.find('[name="name"]').val("").focus(); |
---|
| 72 | } |
---|
| 73 | }); |
---|
| 74 | accord.accordion('activate',0); |
---|
[5591] | 75 | error = true; |
---|
| 76 | return; |
---|
| 77 | } |
---|
| 78 | }); |
---|
| 79 | if(error){ |
---|
| 80 | return false; |
---|
| 81 | } |
---|
| 82 | } |
---|
| 83 | } |
---|
| 84 | var criteria = ""; |
---|
[5598] | 85 | var criteria_list = list_container.find('[name="criteriaValue[]"]'); |
---|
[6126] | 86 | var er_num = /^[0-9]+$/; |
---|
| 87 | |
---|
| 88 | if($(".sizeRule").val() != "" && er_num.test($(".sizeRule").val()) == false) { |
---|
| 89 | $.Zebra_Dialog(get_lang("Size rule must be a number"),{ |
---|
| 90 | 'onClose': function(caption) { |
---|
| 91 | list_container.find('[name="actionType[]"]:checked').parent().find("input:text, textarea").focus(); |
---|
| 92 | } |
---|
| 93 | }); |
---|
| 94 | accord.accordion('activate',0); |
---|
| 95 | return false; |
---|
| 96 | } |
---|
[5591] | 97 | $.each(criteria_list, function(index, value){ |
---|
| 98 | criteria += $.trim($(criteria_list[index]).val()); |
---|
| 99 | }); |
---|
[6144] | 100 | if(criteria == ""){ |
---|
[5801] | 101 | $.Zebra_Dialog(get_lang("No criteria filled"),{ |
---|
[5662] | 102 | 'onClose': function(caption) { |
---|
| 103 | list_container.find('[name="criteriaValue[]"]:first').focus(); |
---|
| 104 | } |
---|
| 105 | }); |
---|
| 106 | accord.accordion('activate',0); |
---|
[5591] | 107 | return false; |
---|
| 108 | } |
---|
[5598] | 109 | if(list_container.find('[name="actionType[]"]:checked').parent().find("input:text, textarea").length){ |
---|
| 110 | if($.trim(list_container.find('[name="actionType[]"]:checked').parent().find("input:text, textarea").val()) == ""){ |
---|
[5801] | 111 | $.Zebra_Dialog(get_lang("Fill the action value"),{ |
---|
[5662] | 112 | 'onClose': function(caption) { |
---|
| 113 | list_container.find('[name="actionType[]"]:checked').parent().find("input:text, textarea").focus(); |
---|
| 114 | } |
---|
| 115 | }); |
---|
[5591] | 116 | return false; |
---|
| 117 | } |
---|
[6126] | 118 | var er_mail = RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/); |
---|
| 119 | if(er_mail.test($.trim(list_container.find('[value="redirect"]:checked').parent().find("input:text, textarea").val())) == false){ |
---|
| 120 | $.Zebra_Dialog(get_lang("Invalid mail"),{ |
---|
| 121 | 'onClose': function(caption) { |
---|
| 122 | list_container.find('[name="actionType[]"]:checked').parent().find("input:text, textarea").focus(); |
---|
| 123 | } |
---|
| 124 | }); |
---|
| 125 | return false; |
---|
| 126 | } |
---|
[5591] | 127 | } |
---|
[6320] | 128 | if(list_container.find('.alertMessage').is(':checked')){ |
---|
[6326] | 129 | if($(criteria_list[0]).val() != "" && $('.select-folderlist').find('[type="radio"]').is(':checked')){ |
---|
[6320] | 130 | var hasValue = false; |
---|
| 131 | $.each(criteria_list, function(index, value){ |
---|
| 132 | if($(criteria_list[index]).val() != "" && index != 0){ |
---|
| 133 | hasValue = true; |
---|
| 134 | } |
---|
| 135 | }); |
---|
| 136 | if(hasValue){ |
---|
| 137 | $.Zebra_Dialog(get_lang("This filter not permits alert")); |
---|
| 138 | return false; |
---|
| 139 | } |
---|
| 140 | if(list_container.find('[name="hasAttachment"]').is(':checked')){ |
---|
| 141 | $.Zebra_Dialog(get_lang("This filter not permits alert")); |
---|
| 142 | return false; |
---|
| 143 | } |
---|
| 144 | }else{ |
---|
| 145 | $.Zebra_Dialog(get_lang("This filter not permits alert")); |
---|
| 146 | return false; |
---|
| 147 | } |
---|
| 148 | } |
---|
[5591] | 149 | return true; |
---|
| 150 | }; |
---|
| 151 | |
---|
[5341] | 152 | bytes2Size = function(bytes) { |
---|
| 153 | var sizes = ['B', 'KB', 'MB', 'GB', 'TB']; |
---|
| 154 | if (bytes === 0) return 'n/a'; |
---|
| 155 | var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))); |
---|
| 156 | var size = (i<2) ? Math.round((bytes / Math.pow(1024, i))) : Math.round((bytes / Math.pow(1024, i)) * 100)/100; |
---|
| 157 | return size + ' ' + sizes[i]; |
---|
| 158 | }; |
---|
| 159 | |
---|
| 160 | flags2Class = function(cellvalue) { |
---|
| 161 | var flags_enum = cellvalue.split(','); |
---|
| 162 | var classes = ''; |
---|
| 163 | for (var i=0; i<flags_enum.length; i++){ |
---|
| 164 | classes += '<span class="icon-'+flags_enum[i].toLowerCase()+'"> </span>'; |
---|
| 165 | } |
---|
| 166 | return classes; |
---|
| 167 | }; |
---|
| 168 | |
---|
| 169 | date2Time = function (timestamp) { |
---|
| 170 | var date = new Date(); |
---|
| 171 | if ((date.getTime() - timestamp) < (24*60*60*1000)) { |
---|
| 172 | return '<span class="timable" title="'+timestamp+'"> </span>'; |
---|
| 173 | } else { |
---|
| 174 | date = new Date(timestamp); |
---|
| 175 | var b = date.toISOString().split("T")[0].split("-"); |
---|
| 176 | var c = b[2] + "/" + b[1] + "/" + b[0]; |
---|
| 177 | return '<span class="datable">' + c + '</span>'; |
---|
| 178 | } |
---|
| 179 | }; |
---|
| 180 | |
---|
| 181 | keys = function( object ){ |
---|
| 182 | |
---|
| 183 | var array = []; |
---|
| 184 | |
---|
| 185 | for( var key in object ) |
---|
| 186 | array[ array.length ] = key; |
---|
| 187 | |
---|
| 188 | return( array ); |
---|
| 189 | |
---|
| 190 | } |
---|
| 191 | |
---|
[6292] | 192 | /* |
---|
| 193 | * Preenche o formulário de filtros com as informações originais para edição |
---|
| 194 | */ |
---|
[5341] | 195 | showDetails = function( filter ){ |
---|
| 196 | |
---|
| 197 | form.get(0).reset(); |
---|
| 198 | |
---|
| 199 | nameObj.val( filter.name ); |
---|
[5539] | 200 | nameObj.attr("disabled", "disabled"); |
---|
[5341] | 201 | for( var i = 0; i < filter.criteria.length; i++ ){ |
---|
[5630] | 202 | criterias.filter( '[value="' + filter.criteria[i].field + '"]' ) |
---|
| 203 | .siblings( '[name="criteriaOperator[]"]' ).val( filter.criteria[i].operator ).end() |
---|
| 204 | .siblings( '[name="criteriaValue[]"]' ).val( filter.criteria[i].value ); |
---|
[5341] | 205 | } |
---|
| 206 | for( var i = 0; i < filter.actions.length; i++ ){ |
---|
[5539] | 207 | actions.filter( '[value="' + filter.actions[i].type + '"]' ).attr("checked", "True"); |
---|
| 208 | actions.filter( '[value="' + filter.actions[i].type + '"]' ).val( filter.actions[i].type ) |
---|
| 209 | .siblings( '[name="actionParameter[]"]' ).val( filter.actions[i].parameter ); |
---|
| 210 | if(filter.actions[i].type == "redirect") |
---|
| 211 | actions.siblings('[name="addressRedirect"]').val(filter.actions[i].parameter); |
---|
| 212 | if(filter.actions[i].type == "reject") |
---|
| 213 | actions.siblings('[name="messageReject"]').val(filter.actions[i].parameter); |
---|
[5632] | 214 | if(filter.actions[i].type == "fileinto" || filter.actions[i].type == "setflag") |
---|
| 215 | actions.parent().find('[value="'+filter.actions[i].parameter+'"]').attr("selected", "selected"); |
---|
[5341] | 216 | } |
---|
[5539] | 217 | isExact.filter('[value="'+(filter.isExact != "false"? "and" : "or")+'"]').attr("checked", "True"); |
---|
[6292] | 218 | |
---|
| 219 | if (filter.alertMessage == 'true') $('.alertMessage').attr('checked', 'True'); |
---|
[5341] | 220 | } |
---|
| 221 | |
---|
| 222 | /* --- ------ --- */ |
---|
| 223 | |
---|
| 224 | DataLayer.codec( "filter", "detail", { |
---|
| 225 | decoder: function( form ){ |
---|
[6285] | 226 | if( form.vacation ) |
---|
[5341] | 227 | return { |
---|
[5539] | 228 | criteria: [{ value: "vacation", operator: "", field: "vacation" }], |
---|
| 229 | actions: [{ parameter: form.vacation, type: "vacation" }], |
---|
[5341] | 230 | id: "vacation", |
---|
| 231 | name: "vacation", |
---|
[5627] | 232 | isExact: false, |
---|
| 233 | applyMessages : "", |
---|
[5902] | 234 | enabled : true |
---|
[5341] | 235 | } |
---|
| 236 | |
---|
[6143] | 237 | var apply_messages_ = keys(selectedMessages); |
---|
| 238 | delete selectedMessages; |
---|
[5862] | 239 | |
---|
[6143] | 240 | return { |
---|
[5539] | 241 | //id: form.name, |
---|
[6168] | 242 | name: form.name ? form.name.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>') : nameObj.val().replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'), |
---|
[5341] | 243 | isExact: ( form.isExact === "and" ), |
---|
[5539] | 244 | criteria: $.map( form.criteriaOperator || [], function( criteriaOperator, i ){ |
---|
[5341] | 245 | return (!form.criteriaValue[i]) ? null: |
---|
[6143] | 246 | { |
---|
[6168] | 247 | value: form.criteriaValue[i].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'), |
---|
[6143] | 248 | operator: criteriaOperator, |
---|
[6168] | 249 | field: form.criteriaType[i].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>') |
---|
[6143] | 250 | }; |
---|
[5341] | 251 | }), |
---|
| 252 | actions: $.map( form.actionType || [], function( type, i ){ |
---|
[5539] | 253 | var the_parameter = form.actionParameter[i]; |
---|
| 254 | |
---|
| 255 | !the_parameter ? the_parameter = form.actionParameter[i+1] : ""; |
---|
[6285] | 256 | if (type == 'alertMessage') { |
---|
| 257 | //if(!$('[value="alertMessage"]').parent().hasClass("hidden")){ |
---|
| 258 | type = 'addflag'; |
---|
| 259 | the_parameter = '$FilteredMessage'; |
---|
| 260 | //}else{ |
---|
| 261 | // return; |
---|
| 262 | //} |
---|
| 263 | } |
---|
[5539] | 264 | if (type == 'fileinto') { |
---|
| 265 | the_parameter = form.valueFileInto; |
---|
| 266 | } |
---|
| 267 | if (type == 'reject') { |
---|
| 268 | the_parameter = form.messageReject; |
---|
| 269 | } |
---|
| 270 | if (type == 'fileintoInbox') { |
---|
[5591] | 271 | if(!$('[value="fileintoInbox"]').parent().hasClass("hidden")){ |
---|
| 272 | type = 'fileinto'; |
---|
| 273 | the_parameter = 'INBOX'; |
---|
| 274 | }else{ |
---|
| 275 | return; |
---|
| 276 | } |
---|
[5539] | 277 | } |
---|
| 278 | if (type == 'fileintoTrash') { |
---|
| 279 | type = 'fileinto'; |
---|
| 280 | the_parameter = 'INBOX/Trash'; |
---|
| 281 | } |
---|
| 282 | if (type == 'redirect') { |
---|
| 283 | the_parameter = form.addressRedirect; |
---|
| 284 | } |
---|
| 285 | if (type == 'setflag') { |
---|
| 286 | the_parameter = form.valueSetFlag; |
---|
| 287 | } |
---|
[5341] | 288 | return (!type) ? null: |
---|
[5539] | 289 | {parameter: the_parameter, type: type }; |
---|
[5341] | 290 | |
---|
| 291 | }), |
---|
[5902] | 292 | enabled : true, |
---|
[6285] | 293 | alertMessage: $('.alertMessage').is(':checked'), |
---|
[5862] | 294 | //applyMessages: allMessages? !$.isEmptyObject( selectedMessages ) ? |
---|
| 295 | //keys( selectedMessages ) : allMessages : "" |
---|
| 296 | applyMessages: apply_messages_ |
---|
| 297 | //applyMessages: "" |
---|
[6143] | 298 | }; |
---|
[5341] | 299 | }, |
---|
| 300 | |
---|
| 301 | encoder: function( filters ){ |
---|
| 302 | var rules = []; |
---|
| 303 | |
---|
| 304 | for( var id in filters ) |
---|
| 305 | rules[ rules.length ] = filters[id]; |
---|
| 306 | |
---|
| 307 | return { rules: rules }; |
---|
| 308 | |
---|
| 309 | } |
---|
[5862] | 310 | |
---|
[5341] | 311 | }); |
---|
| 312 | |
---|
| 313 | DataLayer.codec( "folder", "select", { |
---|
| 314 | |
---|
| 315 | decoder:function(){ |
---|
| 316 | |
---|
| 317 | |
---|
| 318 | |
---|
| 319 | }, |
---|
| 320 | encoder:function( data ){ |
---|
| 321 | var tree1 = [], tree2 = [], tree3 = []; |
---|
| 322 | |
---|
| 323 | for (var i=0; i<data.length; i++) { |
---|
| 324 | |
---|
| 325 | if (/^INBOX/.test(data[i].id)) { |
---|
| 326 | if (!unorphanize(tree1, data[i])) { |
---|
| 327 | data[i].children = []; |
---|
| 328 | tree1.push(data[i]); |
---|
| 329 | } |
---|
| 330 | } |
---|
| 331 | else if (/^user/.test(data[i].id)) { |
---|
| 332 | if (!unorphanize(tree2, data[i])) { |
---|
| 333 | data[i].children = []; |
---|
| 334 | tree2.push(data[i]); |
---|
| 335 | } |
---|
| 336 | } |
---|
| 337 | else if (/^local_messages/.test(data[i].id)) { |
---|
| 338 | if (!unorphanize(tree3, data[i])) { |
---|
| 339 | data[i].children = []; |
---|
| 340 | tree3.push(data[i]); |
---|
| 341 | } |
---|
| 342 | } |
---|
| 343 | |
---|
| 344 | } |
---|
| 345 | |
---|
| 346 | return {folders: [ tree1, tree2, tree3 ]}; |
---|
| 347 | |
---|
| 348 | } |
---|
| 349 | |
---|
| 350 | }); |
---|
| 351 | |
---|
[6285] | 352 | fromRules = getFromAlertRules(); |
---|
[5630] | 353 | |
---|
[5341] | 354 | var BASE_PATH = '../prototype/'; |
---|
| 355 | |
---|
| 356 | DataLayer.basePath = BASE_PATH + "REST.php?q="; |
---|
| 357 | DataLayer.dispatchPath = BASE_PATH; |
---|
| 358 | |
---|
| 359 | var selectedMessages = {}; |
---|
| 360 | var allMessages = false; |
---|
| 361 | |
---|
[6292] | 362 | |
---|
| 363 | /* |
---|
| 364 | * Bloqueia usuário por email - utilizado na tela de mensagens do ExpressoMail |
---|
| 365 | */ |
---|
[5630] | 366 | function block_user_email(email) { |
---|
| 367 | var idd = email; |
---|
[5762] | 368 | /** TODO - Mudar quando API abstrair atualizações no cache */ |
---|
| 369 | DataLayer.remove('filter', false); |
---|
| 370 | var filters = DataLayer.get('filter'); |
---|
[5654] | 371 | for(var index in filters){ |
---|
| 372 | if(filters[index].name == email) { |
---|
[5801] | 373 | if(confirm(get_lang("This user is already blocked. Would you like to unlock it?"))) { |
---|
[5655] | 374 | DataLayer.remove( 'filter', filters[index].id ); |
---|
[5762] | 375 | DataLayer.commit("filter", false, function(){ |
---|
[5801] | 376 | $.Zebra_Dialog(get_lang("Lock User") + " " + email + " " + get_lang("removed")); |
---|
[5762] | 377 | list_filters(); |
---|
[6364] | 378 | getFromAlertRules(); |
---|
[5762] | 379 | }); |
---|
[5654] | 380 | return true; |
---|
[5662] | 381 | }else |
---|
| 382 | return true; |
---|
[5654] | 383 | } |
---|
| 384 | } |
---|
[5801] | 385 | if(confirm(get_lang("Want to block the user") + " " + email + "?")){ |
---|
[5762] | 386 | DataLayer.put( 'filter', idd, |
---|
[5630] | 387 | { name: email, isExact: false, |
---|
| 388 | criteria:{ 0: {value: email, operator: "=", field: "from"} }, |
---|
[6176] | 389 | actions: { 0: {parameter: "INBOX" + cyrus_delimiter + "Spam", type: "fileinto"}}, |
---|
[5630] | 390 | enabled: true, |
---|
| 391 | id: email, |
---|
| 392 | block: true |
---|
| 393 | }); |
---|
[5762] | 394 | DataLayer.commit("filter", false, function(){ |
---|
[5801] | 395 | $.Zebra_Dialog(get_lang("User") + " " + email + " " + get_lang("blocked")); |
---|
[5762] | 396 | list_filters(); |
---|
[6364] | 397 | getFromAlertRules(); |
---|
[5762] | 398 | }); |
---|
| 399 | |
---|
| 400 | } |
---|
[5630] | 401 | } |
---|
| 402 | |
---|
[6292] | 403 | |
---|
| 404 | /* |
---|
| 405 | * Mostra o grid de mensagens para aplicar a regra nas mensagens da caixa de entrada. |
---|
| 406 | */ |
---|
[6048] | 407 | function showGridMessages(thiss) { |
---|
| 408 | var criteria_list = list_container.find('[name="criteriaValue[]"]'); |
---|
| 409 | var criteria_operator_list = list_container.find('[name="criteriaOperator[]"]'); |
---|
| 410 | var criteria_value = ""; |
---|
| 411 | var criteria = ""; |
---|
| 412 | $.each(criteria_list, function(index, value){ |
---|
| 413 | criteria += $.trim($(criteria_list[index]).val()) + ","; |
---|
| 414 | }); |
---|
| 415 | var criteria_ = criteria.split(","); |
---|
| 416 | var criteria_operator = ""; |
---|
| 417 | $.each(criteria_operator_list, function(index, value){ |
---|
| 418 | criteria_operator += $.trim($(criteria_list[index]).val()) != "" ? index + "," : ","; |
---|
| 419 | criteria_value += $.trim($(criteria_operator_list[index]).val()) + ","; |
---|
| 420 | }); |
---|
| 421 | var criteria_operator_ = criteria_operator.split(","); |
---|
| 422 | var criteria_value_ = criteria_value.split(","); |
---|
| 423 | var options = ["from", "to", "subject", "body", "size"]; |
---|
| 424 | var criterias_ = new Array(); |
---|
| 425 | var j = 0; |
---|
| 426 | for (i in criteria_) { |
---|
| 427 | if(criteria_[i] != "") { |
---|
| 428 | (j == 0) ? criterias_[j] = {"0": options[i], "1": criteria_value_[i], "2": criteria_[i]} : criterias_[j] = {"0": "OR", "1": options[i], "2": criteria_value_[i], "3": criteria_[i]}; |
---|
| 429 | j++; |
---|
| 430 | } |
---|
| 431 | } |
---|
| 432 | showGridButton = thiss.parent(); |
---|
| 433 | $.ajax({ |
---|
| 434 | url: DataLayer.basePath + 'folder/INBOX/message&' + $.param( {"filter": criterias_} ), |
---|
| 435 | dataType: 'json', |
---|
| 436 | success: function(data){ |
---|
| 437 | allMessages = data; |
---|
| 438 | |
---|
| 439 | var parametro = { "filter": ( data != false ? [ "msgNumber", "IN", data ] : criterias_ ) }; |
---|
| 440 | |
---|
| 441 | if (typeof grid !== "undefined") { |
---|
| 442 | grid.jqGrid( 'setGridParam', { url: DataLayer.basePath + 'folder/INBOX/message&' + $.param( parametro ) } ).trigger( 'reloadGrid' ); |
---|
| 443 | //return; |
---|
| 444 | } |
---|
| 445 | grid = showGridButton.siblings(".fields-search-messages-grid, .fields-search-messages-grid-pager") |
---|
| 446 | .removeClass('hidden').filter(".fields-search-messages-grid").trigger( 'reloadGrid' ).jqGrid({ |
---|
| 447 | //url: DataLayer.basePath + 'folder/INBOX/message&' + $.param( {"filter": [ "msgNumber", "IN", data ]} ), |
---|
| 448 | url: DataLayer.basePath + 'folder/INBOX/message&' + $.param( parametro ), |
---|
| 449 | datatype: "json", |
---|
| 450 | mtype: 'GET', |
---|
[6143] | 451 | colNames:['#', 'De', 'Assunto', 'Data', 'Tamanho'], |
---|
[6048] | 452 | colModel:[ |
---|
| 453 | {name:'msg_number',index:'msg_number', width:45, hidden:true, sortable:false}, |
---|
[6143] | 454 | {name:'from.email',index:'msg_number', width:130, sortable:false}, |
---|
[6048] | 455 | {name:'subject',index:'subject', width:250, sortable:false}, |
---|
| 456 | {name:'timestamp',index:'timestamp', width:65, align:"center", sortable:false, formatter:date2Time}, |
---|
| 457 | {name:'size',index:'size', width:50, align:"right", sortable:false, formatter:bytes2Size} |
---|
| 458 | ], |
---|
| 459 | jsonReader : { |
---|
| 460 | root:"rows", |
---|
| 461 | page: "page", |
---|
| 462 | total: "total", |
---|
| 463 | records: "records", |
---|
| 464 | repeatitems: false, |
---|
| 465 | id: "0" |
---|
| 466 | }, |
---|
| 467 | rowNum:10, |
---|
| 468 | //rowList:[10,25,50], |
---|
| 469 | rowList:[10], |
---|
| 470 | pager: '#fields-search-messages-grid-pager', |
---|
| 471 | sortname: 'id', |
---|
| 472 | viewrecords: true, |
---|
| 473 | sortorder: "desc", |
---|
| 474 | multiselect: true, |
---|
| 475 | autowidth: true, |
---|
| 476 | reloadAfterEdit: true, |
---|
| 477 | reloadAfterSubmit: true, |
---|
| 478 | height:200, |
---|
| 479 | loadComplete: function(data) { |
---|
| 480 | // // aplica o contador |
---|
| 481 | // jQuery('.timable').each(function (i) { |
---|
| 482 | // jQuery(this).countdown({ |
---|
| 483 | // since: new Date(parseInt(this.title)), |
---|
| 484 | // significant: 1, |
---|
| 485 | // layout: 'há {d<}{dn} {dl} {d>}{h<}{hn} {hl} {h>}{m<}{mn} {ml} {m>}{s<}{sn} {sl}{s>}', |
---|
| 486 | // description: ' atrás' |
---|
| 487 | // }); |
---|
| 488 | // }); |
---|
| 489 | }, |
---|
| 490 | onSelectRow: function (id, selected) { |
---|
| 491 | if( selected ) |
---|
| 492 | { |
---|
| 493 | selectedMessages[ id ] = true; |
---|
| 494 | } |
---|
| 495 | else |
---|
| 496 | { |
---|
| 497 | delete selectedMessages[ id ]; |
---|
| 498 | } |
---|
| 499 | }, |
---|
| 500 | caption: 'Mensagens que atendem aos critérios' |
---|
| 501 | }); // end jqGrid |
---|
| 502 | } // end success |
---|
| 503 | }); // end ajax |
---|
| 504 | } |
---|
| 505 | |
---|
| 506 | |
---|
[6292] | 507 | /* |
---|
| 508 | * Lista os filtros para o usuário |
---|
| 509 | */ |
---|
[5539] | 510 | function list_filters(html){ |
---|
[6021] | 511 | outOfficeVerify(); |
---|
[5539] | 512 | if(html){ |
---|
| 513 | if( ! $(".filters-windows").length ) |
---|
[5761] | 514 | container = $('.expressomail-module-container').append("<div class='filters-windows'></div>").find(".filters-windows").html( html ).find(".expresso-window-container"); |
---|
| 515 | list_container = $('.expressomail-module-container').find(".rule-list-container"); |
---|
[5539] | 516 | } |
---|
| 517 | list_container = $(".expresso-window-filters").dialog({ |
---|
| 518 | width:700, |
---|
| 519 | modal: true, |
---|
| 520 | resizable: false, |
---|
| 521 | closeOnEscape:true, |
---|
| 522 | close:function(event, ui) { |
---|
| 523 | event.stopPropagation(); |
---|
[5598] | 524 | if(list_container.find(".cancel").length) |
---|
[5627] | 525 | list_container.find(".cancel").trigger('click'); |
---|
| 526 | $(".dialog-head-buttonpane").hide(); |
---|
[5539] | 527 | }, |
---|
| 528 | open: function () { |
---|
| 529 | $(".ui-dialog .ui-dialog-titlebar") |
---|
| 530 | .append('<a href="#" class="ui-dialog-titlebar-minimize ui-corner-all" role="button"><span class="ui-icon ui-icon-minusthick">minimize</span></a>') |
---|
| 531 | .find('.ui-dialog-titlebar-minimize').click(function() { |
---|
| 532 | $(".ui-dialog-buttonpane, .ui-dialog-content").toggle(); |
---|
| 533 | $(".ui-icon-minusthick, .ui-icon-newwin").toggleClass('ui-icon-minusthick').toggleClass('ui-icon-newwin'); |
---|
| 534 | }); |
---|
[5627] | 535 | $(".dialog-head-buttonpane").show(); |
---|
[5539] | 536 | }, |
---|
| 537 | autoOpen: false, |
---|
| 538 | buttons: [{ |
---|
[5801] | 539 | text : get_lang("Close"), |
---|
[5539] | 540 | click : function() { |
---|
| 541 | $( this ).dialog( "close" ); |
---|
| 542 | } |
---|
| 543 | }] |
---|
| 544 | }); |
---|
| 545 | $(".ui-dialog-titlebar").after("<div class='dialog-head-buttonpane ui-dialog-buttonpane ui-widget-content ui-helper-clearfix' style='background-color: rgb(224, 238, 238); '><div class='ui-dialog-buttonset header-buttonpane'></div></div>"); |
---|
| 546 | $(".dialog-head-buttonpane").css("padding", "5px"). |
---|
[5801] | 547 | find(".header-buttonpane").html("<a href='#' class='button add' title='"+get_lang("Add new rule")+"'>"+get_lang("New rule")+"</a>"+(!outoffice ? "<a href='#' class='button add vacation' title='"+get_lang("Add rule out of office")+"'>"+get_lang("Out of office")+"</a>" : "")).find(".button").button(); |
---|
[5539] | 548 | |
---|
| 549 | $(".ui-dialog-buttonpane.ui-widget-content").css("background-color", "#E0EEEE"); |
---|
[5598] | 550 | var list = DataLayer.render( BASE_PATH + 'modules/filters/filter-list.ejs', DataLayer.get("filter:detail", true)); |
---|
| 551 | list_container.html(list).find(".button").button(); |
---|
[5543] | 552 | |
---|
| 553 | list_container.find(".rule-list").selectable({ |
---|
| 554 | selecting: function(event, ui) { |
---|
| 555 | $(ui.selecting).find(':checkbox').attr('checked', true); |
---|
| 556 | }, |
---|
| 557 | unselecting: function(event, ui) { |
---|
| 558 | $(ui.unselecting).find(':checkbox').attr('checked', false); |
---|
| 559 | } |
---|
| 560 | }); |
---|
| 561 | |
---|
[5598] | 562 | list_container.find( ".menu-control .button" ).filter(".update").button({ |
---|
[5543] | 563 | icons: { |
---|
| 564 | primary: "ui-icon-pencil" |
---|
| 565 | }, |
---|
| 566 | text: false |
---|
| 567 | }).click(function(){ |
---|
[5627] | 568 | var id = $(this).parents("li.rule").find('.id').val(); |
---|
[5543] | 569 | var filters = DataLayer.get( 'filter', true); |
---|
| 570 | for(var i =0; i < filters.length; i++){ |
---|
| 571 | if(filters[i].id == id){ |
---|
| 572 | filters = filters[i]; |
---|
| 573 | break; |
---|
| 574 | } |
---|
| 575 | } |
---|
[5801] | 576 | DataLayer.render( BASE_PATH + 'modules/filters/edit-filter.ejs', {folders : DataLayer.get("folder", true), delimiter: cyrus_delimiter},function(html){ |
---|
[5543] | 577 | var details_container = $(".expresso-window-filters").html(html); |
---|
| 578 | if(filters.name != "vacation"){ |
---|
| 579 | form = container.find("form"); |
---|
| 580 | criterias = details_container.find( 'fieldset input[name="criteriaType[]"]' ); |
---|
| 581 | actions = details_container.find( 'fieldset input[name="actionType[]"]' ); |
---|
| 582 | nameObj = details_container.find( 'input[name="name"]' ); |
---|
| 583 | isExact = details_container.find( 'input[name="isExact"]' ); |
---|
| 584 | showDetails(filters); |
---|
[5598] | 585 | var accord = list_container.find(".rule-details-container").accordion({autoHeight: false}); |
---|
| 586 | list_container.find(".button").button().filter(".forth").click(function(){ |
---|
[5539] | 587 | accord.accordion('activate',1); |
---|
[5930] | 588 | }).end().filter(".forth2").click(function(){ |
---|
| 589 | accord.accordion('activate',2); |
---|
[5539] | 590 | }).end().filter(".back").click(function(){ |
---|
| 591 | accord.accordion('activate',0); |
---|
[5930] | 592 | }).end().filter(".back2").click(function(){ |
---|
| 593 | accord.accordion('activate',1); |
---|
[5539] | 594 | }).end().filter(".cancel").click(function(){ |
---|
| 595 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
| 596 | }).end().filter(".submit").click(function(){ |
---|
[5543] | 597 | if(nameObj) |
---|
| 598 | nameObj.attr("disabled", "false"); |
---|
[5591] | 599 | if(valid_save()) |
---|
| 600 | $(this).submit(); |
---|
| 601 | else |
---|
| 602 | return; |
---|
[6355] | 603 | DataLayer.commit( 'filter', false,function(data){ |
---|
[6364] | 604 | if(filters['alertMessage'] == "true"){ |
---|
| 605 | if(filters['alertMessage'] != $('.alertMessage').is(':checked').toString()){ |
---|
| 606 | /**RETIRA FLAG*/ |
---|
| 607 | removeMessagesFlag(filters['id']); |
---|
| 608 | } |
---|
[6355] | 609 | } |
---|
[5662] | 610 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
[6364] | 611 | getFromAlertRules(); |
---|
[5662] | 612 | }); |
---|
[6048] | 613 | }).end().filter('.button.search').click(function() { |
---|
| 614 | /* Valida se o usuário preencheu as informações */ |
---|
| 615 | if(valid_save()) |
---|
| 616 | showGridMessages($(this)); |
---|
| 617 | else |
---|
| 618 | return; |
---|
| 619 | }) |
---|
[5543] | 620 | }else{ |
---|
[5598] | 621 | list_container.find(".vacation-details-container").removeClass("hidden"); |
---|
| 622 | list_container.find(".rule-details-container").addClass("hidden"); |
---|
| 623 | list_container.find(".button").button().filter(".back").click(function(){ |
---|
[5539] | 624 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
| 625 | }).end().filter(".submit").click(function(){ |
---|
| 626 | $(this).submit(); |
---|
[5662] | 627 | DataLayer.commit( 'filter', false,function(){ |
---|
| 628 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
[6364] | 629 | getFromAlertRules(); |
---|
[5662] | 630 | }); |
---|
[5539] | 631 | }); |
---|
[5543] | 632 | details_container.find('[name="vacation"]').val(filters.actions[0].parameter); |
---|
| 633 | } |
---|
[5539] | 634 | }); |
---|
[5543] | 635 | }).end() |
---|
| 636 | .filter(".enable").button({ |
---|
| 637 | icons: { |
---|
[5648] | 638 | primary: "ui-icon-circle-close" |
---|
[5543] | 639 | }, |
---|
| 640 | text: false |
---|
| 641 | }).click(function(){ |
---|
[6021] | 642 | var id = $(this).parents("li.rule").find('.id').val(); |
---|
[5601] | 643 | DataLayer.put( 'filter', id, { enabled: false }); |
---|
[6355] | 644 | /**RETIRA FLAG*/ |
---|
| 645 | removeMessagesFlag(id); |
---|
[5627] | 646 | DataLayer.commit("filter", false,function(){ |
---|
| 647 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
[6364] | 648 | getFromAlertRules(); |
---|
[5627] | 649 | }); |
---|
[5543] | 650 | }).end() |
---|
| 651 | |
---|
| 652 | .filter(".disable").button({ |
---|
| 653 | icons: { |
---|
[5648] | 654 | primary: "ui-icon-circle-check" |
---|
[5543] | 655 | }, |
---|
| 656 | text: false |
---|
| 657 | }).click(function(){ |
---|
[5627] | 658 | var id = $(this).parents("li.rule").find('.id').val(); |
---|
[5601] | 659 | DataLayer.put( 'filter', id, { enabled: true }); |
---|
[5627] | 660 | DataLayer.commit("filter", false,function(){ |
---|
| 661 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
[6364] | 662 | getFromAlertRules(); |
---|
[5627] | 663 | }); |
---|
[5543] | 664 | }).end() |
---|
| 665 | |
---|
| 666 | .filter(".close").button({ |
---|
| 667 | icons: { |
---|
| 668 | primary: "ui-icon-close" |
---|
| 669 | }, |
---|
| 670 | text: false |
---|
[5648] | 671 | }).click(function(event){ |
---|
[5662] | 672 | var filter_name = $(event.target).parents("li.rule").find('.id').val(); |
---|
[5902] | 673 | var filter_screen_name = $(event.target).parents("li.rule").find('.title').html(); |
---|
| 674 | $.Zebra_Dialog(get_lang("Are you sure to delete the filter") + ": <strong>"+filter_screen_name+"</strong>",{ |
---|
[5662] | 675 | 'type': 'question', |
---|
[5801] | 676 | 'title': get_lang("Exclusion Confirmation"), |
---|
[5662] | 677 | 'buttons': [get_lang('Yes'), get_lang('No')], |
---|
| 678 | 'onClose': function(caption) { |
---|
| 679 | if(caption == get_lang('Yes')){ |
---|
[5762] | 680 | /** TODO - Mudar quando API abstrair atualizações no cache */ |
---|
| 681 | DataLayer.remove('filter', false); |
---|
| 682 | DataLayer.get('filter'); |
---|
[6355] | 683 | /**RETIRA FLAG*/ |
---|
| 684 | removeMessagesFlag(filter_name); |
---|
[5662] | 685 | DataLayer.remove( 'filter', filter_name); |
---|
[6355] | 686 | |
---|
[5662] | 687 | DataLayer.commit("filter", false,function(){ |
---|
| 688 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
[6364] | 689 | getFromAlertRules(); |
---|
[5662] | 690 | }); |
---|
| 691 | }else{ |
---|
| 692 | $(event.target).removeClass("ui-selected").parent().removeClass("ui-selected"); |
---|
| 693 | } |
---|
| 694 | } |
---|
[5543] | 695 | }); |
---|
| 696 | }).end().removeClass("ui-button-icon-only"); |
---|
| 697 | |
---|
[6021] | 698 | $(".button.allenable").click(function(){ |
---|
[5987] | 699 | container.find('.rule-list').find('.rule').find('.select').find(':checked').parents('.rule').find('.title').each(function(i,o){ |
---|
[5995] | 700 | DataLayer.put( 'filter', o.innerHTML, { enabled: true }); |
---|
[5987] | 701 | }); |
---|
| 702 | DataLayer.commit("filter", false, function(){ |
---|
| 703 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
[6364] | 704 | getFromAlertRules(); |
---|
[5987] | 705 | }); |
---|
| 706 | }); |
---|
[5985] | 707 | |
---|
[6021] | 708 | $(".button.alldisable").click(function(){ |
---|
[5987] | 709 | container.find('.rule-list').find('.rule').find('.select').find(':checked').parents('.rule').find('.title').each(function(i,o){ |
---|
[5995] | 710 | DataLayer.put( 'filter', o.innerHTML, { enabled: false }); |
---|
[6355] | 711 | /**RETIRA FLAG*/ |
---|
| 712 | removeMessagesFlag(o.innerHTML); |
---|
[5987] | 713 | }); |
---|
| 714 | DataLayer.commit("filter", false, function(){ |
---|
| 715 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
[6364] | 716 | getFromAlertRules(); |
---|
[5987] | 717 | }); |
---|
| 718 | }); |
---|
| 719 | |
---|
| 720 | |
---|
| 721 | |
---|
[6021] | 722 | $(".button.alldelete").click(function(){ |
---|
[5985] | 723 | $.Zebra_Dialog(get_lang("Are you sure to delete the filters?"),{ |
---|
| 724 | 'type': 'question', |
---|
| 725 | 'title': get_lang("Exclusion Confirmation"), |
---|
| 726 | 'buttons': [get_lang('Yes'), get_lang('No')], |
---|
| 727 | 'onClose': function(caption) { |
---|
| 728 | if(caption == get_lang('Yes')){ |
---|
| 729 | /** TODO - Mudar quando API abstrair atualizações no cache */ |
---|
| 730 | DataLayer.remove('filter', false); |
---|
| 731 | DataLayer.get('filter'); |
---|
| 732 | container.find('.rule-list').find('.rule').find('.select').find(':checked').parents('.rule').find('.title').each(function(i,o){ |
---|
[6355] | 733 | /**RETIRA FLAG*/ |
---|
| 734 | removeMessagesFlag(o.innerHTML); |
---|
[5985] | 735 | DataLayer.remove( 'filter', o.innerHTML ); |
---|
[6355] | 736 | |
---|
[5985] | 737 | }); |
---|
| 738 | DataLayer.commit("filter", false,function(){ |
---|
| 739 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
[6364] | 740 | getFromAlertRules(); |
---|
[5985] | 741 | }); |
---|
| 742 | }else{ |
---|
| 743 | return true; |
---|
| 744 | } |
---|
| 745 | } |
---|
| 746 | }); |
---|
| 747 | }); |
---|
| 748 | |
---|
[5930] | 749 | var aa = 0; |
---|
| 750 | |
---|
[5598] | 751 | list_container.parent().find(".button.add:first").click(function(){ |
---|
| 752 | list_container.parent().find(".dialog-head-buttonpane").addClass("hidden"); |
---|
[5801] | 753 | DataLayer.render( BASE_PATH + 'modules/filters/edit-filter.ejs', {folders : DataLayer.get("folder", true), delimiter: cyrus_delimiter},function(html){ |
---|
[5598] | 754 | list_container.html(html); |
---|
| 755 | var accord = list_container.find(".rule-details-container").accordion({autoHeight: false}); |
---|
| 756 | list_container.find(".button").button().filter(".forth").click(function(){ |
---|
[5543] | 757 | accord.accordion('activate',1); |
---|
[5930] | 758 | }).end().filter(".forth2").click(function(){ |
---|
| 759 | accord.accordion('activate',2); |
---|
[5543] | 760 | }).end().filter(".back").click(function(){ |
---|
| 761 | accord.accordion('activate',0); |
---|
[5930] | 762 | }).end().filter(".back2").click(function(){ |
---|
| 763 | accord.accordion('activate',1); |
---|
[5543] | 764 | }).end().filter(".cancel").click(function(){ |
---|
| 765 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
[5862] | 766 | }).end().filter(".submit").click(function() { |
---|
[5591] | 767 | if(valid_save()) |
---|
| 768 | $(this).submit(); |
---|
| 769 | else |
---|
| 770 | return; |
---|
[5627] | 771 | DataLayer.commit( 'filter',false,function(){ |
---|
| 772 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
[6364] | 773 | getFromAlertRules(); |
---|
[5627] | 774 | }); |
---|
[5862] | 775 | }).end().filter('.button.search').click(function() { |
---|
| 776 | if(valid_save()) |
---|
[6048] | 777 | showGridMessages($(this)); |
---|
[5862] | 778 | else |
---|
| 779 | return; |
---|
| 780 | }); // end function click |
---|
| 781 | }); // end DataLayer.render |
---|
[5543] | 782 | }); |
---|
[5598] | 783 | list_container.parent().find(".button.add.vacation").click(function(){ |
---|
| 784 | list_container.parent().find(".dialog-head-buttonpane").addClass("hidden"); |
---|
[5801] | 785 | DataLayer.render( BASE_PATH + 'modules/filters/edit-filter.ejs', {folders : DataLayer.get("folder", true), delimiter: cyrus_delimiter},function(html){ |
---|
[5598] | 786 | list_container.html(html); |
---|
| 787 | list_container.find(".vacation-details-container").removeClass("hidden"); |
---|
| 788 | list_container.find(".rule-details-container").addClass("hidden"); |
---|
| 789 | list_container.find(".button").button().filter(".back").click(function(){ |
---|
[5543] | 790 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
| 791 | }).end().filter(".submit").click(function(){ |
---|
| 792 | $(this).submit(); |
---|
[5627] | 793 | DataLayer.commit( 'filter',false,function(){ |
---|
| 794 | DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {},list_filters); |
---|
[6364] | 795 | getFromAlertRules(); |
---|
[5627] | 796 | }); |
---|
[5543] | 797 | }); |
---|
| 798 | }); |
---|
| 799 | }); |
---|
[5539] | 800 | } |
---|
[6292] | 801 | |
---|
| 802 | /* |
---|
| 803 | * Inicia a funcionalidade de filtros de mensagens |
---|
| 804 | */ |
---|
[5782] | 805 | function init_filters(){ |
---|
| 806 | var html = DataLayer.render( BASE_PATH + 'modules/filters/init.ejs', {}); |
---|
| 807 | list_filters(html); |
---|
| 808 | } |
---|
[6355] | 809 | |
---|
| 810 | /* |
---|
| 811 | * Ao excluir filtro, desabilitar filtro ou retirar a ação Alerta de um filtro |
---|
| 812 | * esta função é chamada para retirar as flags que caracterizam uma mensagem como alertada pelos Filtros por Remetente |
---|
| 813 | */ |
---|
| 814 | function removeMessagesFlag(id){ |
---|
| 815 | var filters_c = DataLayer.get('filter', id); |
---|
| 816 | var folder = ''; |
---|
| 817 | var from = ''; |
---|
[6364] | 818 | |
---|
[6355] | 819 | for(var i=0; i < filters_c['actions'].length; i++){ |
---|
| 820 | if(filters_c['actions'][i].type == 'fileinto'){ |
---|
| 821 | folder = filters_c['actions'][i].parameter; |
---|
| 822 | } |
---|
| 823 | } |
---|
[6364] | 824 | $.each(fromRules, function(index, value) { |
---|
| 825 | if(value == folder){ |
---|
| 826 | for(var i=0; i < filters_c['criteria'].length; i++){ |
---|
| 827 | if(filters_c['criteria'][i].field == 'from'){ |
---|
| 828 | from = filters_c['criteria'][i].value; |
---|
| 829 | } |
---|
| 830 | } |
---|
| 831 | cExecute ("$this.imap_functions.removeFlagMessagesFilter&folder="+folder+"&from="+from, function(){}); |
---|
| 832 | return false; |
---|
[6355] | 833 | } |
---|
[6364] | 834 | }); |
---|
[6355] | 835 | } |
---|