- Timestamp:
- 06/02/12 16:40:08 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/filters/interceptors/FilterMapping.php
r6377 r6392 58 58 { 59 59 var $service; 60 60 var $msgs_apply = array(); 61 61 /** 62 62 * Método que cria o ID da regra que está sendo criada. … … 282 282 { 283 283 $script_rules .= "vacation" . $vacation_action . "\r\n"; 284 } 285 286 foreach ($rules as &$values) { 287 if($values['applyMessages']) 288 $this->msgs_apply[] = $values['applyMessages']; 289 $values['applyMessages'] = array(); 284 290 } 285 291 … … 501 507 $this->rules = array(); 502 508 } 503 504 509 return( $this->rules ); 505 510 } … … 522 527 public function applySieveFilter( &$uri , &$result , &$criteria , $original ) 523 528 { 529 $rule_apply = array(); 530 531 $filter = Controller::read($uri); 532 $filter_ = $this->parseSieveScript($filter['content']); 524 533 525 //if() 526 //{ 527 $rule_apply = array(); 534 foreach ($filter_ as $f_) { 535 if($f_['id'] == $uri['id']) { 536 $rule_apply = $f_; 537 } 538 } 539 540 $actions = array(); 541 $actions['type'] = $rule_apply['actions'][0]['type']; 542 $actions['parameter'] = $rule_apply['actions'][0]['parameter']; 543 /* Hardcoded */ 544 $actions['keep'] = false; 545 546 //$messages = $rule_apply['applyMessages']; 547 $messages = $this->msgs_apply[0]; 548 $this->msgs_apply = array(); 528 549 529 $filter = Controller::read($uri); 530 $filter_ = $this->parseSieveScript($filter['content']); 531 532 foreach ($filter_ as $f_) { 533 if($f_['id'] == $uri['id']) { 534 $rule_apply = $f_; 535 } 536 } 537 538 $actions = array(); 539 $actions['type'] = $rule_apply['actions'][0]['type']; 540 $actions['parameter'] = $rule_apply['actions'][0]['parameter']; 541 /* Hardcoded */ 542 $actions['keep'] = false; 543 544 $messages_to_apply = array(); 545 546 $messages = $rule_apply['applyMessages']; 547 /* 548 $proc = array(); 549 $proc['keep'] = false; 550 551 */ 552 $imap = Controller::service( 'Imap' ); 553 $imap->apliSieveFilter($messages, $actions); 554 return $result; 555 //} 550 $imap = Controller::service( 'Imap' ); 551 $imap->apliSieveFilter($messages, $actions); 552 return $result; 556 553 } 557 554 … … 596 593 { 597 594 if( !$this->rules ) 598 $this->rules = $this->getRules();595 $this->rules = $this->getRules(); 599 596 600 597 $uri['id'] = $params['id'] = isset($params['id']) ? $params['id'] : urlencode($params['name']); … … 633 630 $params['id'] = $uri['id']; 634 631 635 $update = false;636 637 632 $rules = array(); 638 633
Note: See TracChangeset
for help on using the changeset viewer.