Changeset 7094 for branches


Ignore:
Timestamp:
08/22/12 09:29:10 (12 years ago)
Author:
eduardow
Message:

Ticket #3059 - Correção para tela de editar filtros com mais de uma action.

Location:
branches/2.4/prototype/modules/filters
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4/prototype/modules/filters/edit-filter.ejs

    r6827 r7094  
    158158                        </fieldset> 
    159159                        <fieldset> 
    160                                 <input type="checkbox" name="actionType[]" value="fileintoInbox"/> 
     160                                <input type="checkbox" name="actionType[]" value="fileintoInbox" class="fileintoInbox"/> 
    161161                                <label><%= get_lang("Keep a copy of the message at your Inbox")%></label> 
    162162                                <input type="hidden" name="actionParameter[]" value="INBOX"/> 
  • branches/2.4/prototype/modules/filters/filters.js

    r6824 r7094  
    204204 */ 
    205205showDetails = function( filter ){ 
    206  
    207206    form.get(0).reset(); 
    208207 
     
    218217                .siblings( '[name="criteriaValue[]"]' ).val( filter.criteria[i].value ); 
    219218    } 
     219    var first_fileinto_action = true;  
    220220    for( var i = 0; i < filter.actions.length; i++ ){ 
    221                 actions.filter( '[value="' + filter.actions[i].type + '"]' ).attr("checked", "True"); 
    222                 actions.filter( '[value="' + filter.actions[i].type + '"]' ).val( filter.actions[i].type ) 
    223                 .siblings( '[name="actionParameter[]"]' ).val( filter.actions[i].parameter ); 
    224221                if(filter.actions[i].type == "redirect") 
    225222                        actions.siblings('[name="addressRedirect"]').val(filter.actions[i].parameter); 
    226223                if(filter.actions[i].type == "reject") 
    227224                        actions.siblings('[name="messageReject"]').val(filter.actions[i].parameter); 
    228                 if(filter.actions[i].type == "fileinto" || filter.actions[i].type == "setflag") 
     225                if((filter.actions[i].type == "fileinto" && first_fileinto_action) || filter.actions[i].type == "setflag"){  
    229226                        actions.parent().find('[value="'+filter.actions[i].parameter+'"]').attr("selected", "selected"); 
     227    if(filter.actions[i].type == "fileinto")  
     228                                first_fileinto_action =false;  
     229                }  
     230                /*A condição abaixo é executada quando uma segunda action do tipo "fileinto" for encontrada*/  
     231                if(filter.actions[i].type == "fileinto" && !first_fileinto_action){  
     232                        $('.fileintoInbox').attr('checked', 'True');  
     233                        continue;  
     234                }         
     235                /*O comando "continue" da condição acima faz com que estas linhas restantes sejam ignoradas*/  
     236                actions.filter( '[value="' + filter.actions[i].type + '"]' ).attr("checked", "True");  
     237                actions.filter( '[value="' + filter.actions[i].type + '"]' ).val( filter.actions[i].type )  
     238                .siblings( '[name="actionParameter[]"]' ).val( filter.actions[i].parameter );  
    230239    } 
    231240        isExact.filter('[value="'+(filter.isExact != "false"? "and" : "or")+'"]').attr("checked", "True"); 
Note: See TracChangeset for help on using the changeset viewer.