Ignore:
Timestamp:
04/29/10 15:03:20 (14 years ago)
Author:
niltonneto
Message:

Ticket #1056 - Corrigido problema que remove todas as regras ao criar um nova.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/expressoMail1_2/js/filter.js

    r2658 r2666  
    4242 
    4343         
    44         cfilter.prototype.load_rules = function() 
     44        cfilter.prototype.load_rules = function( posHandler, param ) 
    4545        { 
    4646                var _this = this; 
     
    5252                        var handler_sieve = function(data) 
    5353                        { 
    54                                 if (data.indexOf('Error:') == 0) 
     54                                if (data.toString().indexOf('Error:') == 0) 
    5555                                { 
    5656                                        _this.criticalError = true; 
     
    7777                                        alert("Expresso:"+e.description); 
    7878                                } 
     79                                if (typeof(posHandler) == 'function')  
     80                                        posHandler(param);  
    7981                        } 
    8082                        if(Element('form_status') != null) 
     
    413415                } 
    414416 
    415                 this.load_rules(); 
    416                 if(confirm(get_lang("Do you want to block this e-mail?"))){ 
    417                         new_r = "&&ENABLED&&" + email + "&&&&&&discard&&&&0&&&&&&0"; 
    418 //                      setTimeout("filter.e_newrule('" + new_r + "')",2000);            
    419                         if (filter.e_newrule(new_r)){ 
    420                                 this.email_deny.push(email); 
    421                                 write_msg(get_lang("The sender was blocked"));                                                   
    422                         }else 
    423                                 write_msg(get_lang("You have reached the maximum number of rules")); 
    424                 } 
     417                var createFilter = function (param){ 
     418                        if(confirm(get_lang("Do you want to block this e-mail?"))){ 
     419                                new_r = "&&ENABLED&&" + param + "&&&&&&discard&&&&0&&&&&&0"; 
     420                                //setTimeout("filter.e_newrule('" + new_r + "')",2000);          
     421                                if (filter.e_newrule(param)){ 
     422                                        filter.email_deny.push(param); 
     423                                        write_msg(get_lang("The sender was blocked"));                                                   
     424                                }else 
     425                                        write_msg(get_lang("You have reached the maximum number of rules")); 
     426                        } 
     427                }; 
     428                this.load_rules( createFilter, email ); 
    425429        } 
    426430         
Note: See TracChangeset for help on using the changeset viewer.