Changeset 4093


Ignore:
Timestamp:
04/20/11 12:00:21 (13 years ago)
Author:
niltonneto
Message:

Ticket #1758 - Pesquisar apenas mensagens não importante

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r4048 r4093  
    35083508                                                } 
    35093509                                        } 
    3510                                 } 
    3511                                 else 
    3512                                 { 
    3513                                         $search_criteria = imap_search($mbox_stream, $filter, SE_UID); 
    3514                                          
    3515                                         if( is_array( $search_criteria) ) 
     3510                                }                                
     3511                                else { 
     3512                        $search_criteria = imap_search($mbox_stream, $filter, SE_UID); 
     3513                                        if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_important_flag']) 
     3514                                        { 
     3515                        if((!strpos($filter,"FLAGGED") === false) || (!strpos($filter,"UNFLAGGED") === false)) 
     3516                                                { 
     3517                                $num_msgs = imap_num_msg($mbox_stream); 
     3518                                                        $flagged_msgs = array(); 
     3519                                                        for ($i=$num_msgs; $i>0; $i--) 
     3520                                                        { 
     3521                                                                $iuid = @imap_uid($this->mbox,$i); 
     3522                                                                $header = $this->get_header($iuid);                                                              
     3523                                                                if(trim($header->Flagged)) 
     3524                                                                { 
     3525                                                                        $flagged_msgs[$i] = $iuid; 
     3526                                                                } 
     3527                                                        } 
     3528                                                        if((count($flagged_msgs) >0) && (strpos($filter,"UNFLAGGED") === false)) 
     3529                                                        { 
     3530                                                                $arry_diff = is_array($search_criteria) ? array_diff($flagged_msgs,$search_criteria):$flagged_msgs; 
     3531                                                                foreach($arry_diff as $msg) 
     3532                                                                { 
     3533                                                                        $search_criteria[] = $msg; 
     3534                                                                } 
     3535                                                        } 
     3536                                                        else if((count($flagged_msgs) >0) && (is_array($search_criteria)) && (!strpos($filter,"UNFLAGGED") === false)) 
     3537                                                        { 
     3538                                                                $search_criteria = array_diff($search_criteria,$flagged_msgs); 
     3539                                                        } 
     3540                        } 
     3541                                        } 
     3542                    if( is_array( $search_criteria) ) 
    35163543                                        { 
    35173544                                                foreach($search_criteria as $new_search) 
     
    35233550                                                } 
    35243551                                        } 
    3525                                 } 
     3552                } 
    35263553                        } 
    35273554                } 
Note: See TracChangeset for help on using the changeset viewer.