Changeset 5692


Ignore:
Timestamp:
03/09/12 16:38:38 (12 years ago)
Author:
airton
Message:

Ticket #2088 - Melhorias no filtro de mensagens do Expresso - Alteracao em algumas repeticoes

File:
1 edited

Legend:

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

    r5672 r5692  
    107107                        $data['isExact'] == 'false' ?  $script_match .= 'if anyof (' : $script_match .= 'if allof ('; 
    108108 
    109                         for ($j=0; $j<count($criteria); $j++) 
     109                        foreach ($criteria as $j => $value); 
    110110                        {                                        
    111111                                switch($criteria[$j]['field']) { 
     
    190190 
    191191                        $script_action = " {\r\n "; 
    192                         for ($k=0; $k<count($action); $k++) 
     192                        foreach ($action as $k=> $value); 
    193193                        { 
    194194                                switch ($action[$k]['type']) { 
     
    409409        public function applySieveFilter( &$uri , &$result , &$criteria , $original  ) 
    410410        { 
    411                  $result['id'] = $uri['id']; 
    412  
    413                  if( $original['properties']['applyMessages'] ) 
    414                  { 
    415                       $filter = Controller::read($uri); 
    416  
    417                       $proc = array(); 
    418                       $proc['keep'] = false; 
     411                $result['id'] = $uri['id']; 
     412                $rule_apply = array();  
     413                 
     414                $filter = Controller::read($uri); 
     415                $filter_ = $this->parseSieveScript($filter['content']); 
     416                 
     417                foreach ($filter_ as $f_) { 
     418                        if($f_['id'] == $uri['id']) {  
     419                                $rule_apply     = $f_; 
     420                        } 
     421                } 
     422                 
     423                $actions = array(); 
     424                $actions['type']      = $rule_apply['actions'][0]['type']; 
     425                $actions['parameter'] = $rule_apply['actions'][0]['parameter']; 
     426                 
     427                $messages = $rule_apply['applyMessages']; 
     428                   
     429                           
     430                $proc = array(); 
     431                $proc['keep'] = false; 
    419432                       
    420                       foreach ($filter['actions'] as $v){ 
    421                               if($v['type'] == 'keep') 
    422                                       $proc['keep'] = true; 
    423                               else{ 
    424                                       $proc['type'] = $v['type']; 
    425                                       $proc['parameter'] = $v['parameter']; 
    426                               } 
    427                       } 
    428  
    429                       $imap = Controller::service( 'Imap' ); 
    430                       $imap->apliSieveFilter($original['properties']['applyMessages'] , $proc );  
    431                       return $result; 
    432                   } 
     433                 
     434                $imap = Controller::service( 'Imap' ); 
     435                //$imap->apliSieveFilter($original['properties']['applyMessages'] , $proc );  
     436                $imap->apliSieveFilter($messages , $actions );  
     437                return $result; 
    433438        } 
    434439 
Note: See TracChangeset for help on using the changeset viewer.