Ignore:
Timestamp:
06/14/12 09:02:04 (12 years ago)
Author:
marcieli
Message:

Ticket #2764 - Após o merge e correção de bugs, commit da melhoria no trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/filters/interceptors/FilterMapping.php

    r6459 r6487  
    224224                        $script_criteria .= ")";  
    225225 
    226                         $script_action = " {\r\n "; 
     226                        //$script_action = " {\r\n "; 
     227                        /* Somente para controlar que o addFlag virá antes de qualquer ação. Modificar isso depois */ 
     228                        $action_addFlag = ''; 
    227229                         
    228230                        if( is_array($action) ) 
     
    230232                        { 
    231233                                switch ($action[$k]['type']) { 
     234                                        case 'setflag': 
     235                                                $require_flag = true; 
     236                                                $action[$k]['parameter'] = "\\\\" . $action[$k]['parameter']; 
     237                                                break; 
     238                                        case 'addflag':  
     239                                                $require_flag = true; 
     240                                                $action_addFlag = "addflag \"" . $action[$k]['parameter'] . "\";\r\n "; 
     241                                                break; 
    232242                                        case 'redirect': 
    233243                                                break; 
     
    245255                                                $vacation = true; 
    246256                                                continue; 
    247                                         case 'setflag': 
    248                                                 $require_flag = true; 
    249                                                 $action[$k]['parameter'] = "\\\\" . $action[$k]['parameter']; 
    250                                                 break; 
    251257                                        case 'discard': 
    252258                                                break; 
    253259                                } 
    254                                 if ($vacation == false) $script_action .= $action[$k]['type'] . " \"" . $action[$k]['parameter'] . "\";\r\n "; 
     260                                if ($vacation == false && $action[$k]['type'] != 'addflag') $script_action .= $action[$k]['type'] . " \"" . $action[$k]['parameter'] . "\";\r\n "; 
    255261                        } 
    256                         $script_action .= "}"; 
    257262                         
     263                        /* ATENÇÃO: Colocar sempre o comando addflag antes de qualquer outro no caso de ações compostas no Sieve */ 
     264                        if ($action_addFlag != '') $script_action = $action_addFlag . $script_action;  
     265                         
     266                        $script_action = "{\r\n " . $script_action . "}"; 
     267                        $action_addFlag = ''; 
    258268                        if($vacation == false) 
    259269                                $script_rules .= $script_match . $script_criteria . $script_action . "\r\n"; 
     
    263273                        $script_match = ""; 
    264274                        $script_criteria = "";   
     275                        $script_action = ""; 
    265276                        $data['applyMessages'] = "";                                                     
    266277                } 
     
    295306 
    296307                $content = $script_begin . $script_header . $script_rules . "\r\n\r\n#PseudoScript#" . "\r\n#" . $json_data; 
    297                  
     308 
    298309                return( $content ); 
    299310        } 
Note: See TracChangeset for help on using the changeset viewer.