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