Changeset 3402


Ignore:
Timestamp:
10/22/10 15:06:23 (14 years ago)
Author:
eduardoalex
Message:

Ticket #1220 - Adicionado controle para uso ou nao da flag importante

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php

    r3401 r3402  
    33643364                                else { 
    33653365                                        $search_criteria = imap_search($mbox_stream, $filter, SE_UID); 
    3366                                          
    3367                         if((!strpos($filter,"FLAGGED") === false) || (!strpos($filter,"UNFLAGGED") === false)) 
     3366                                        if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_important_flag']) 
    33683367                                        { 
    3369                                 $num_msgs = imap_num_msg($mbox_stream); 
    3370                                                 $flagged_msgs = array(); 
    3371                                                 for ($i=$num_msgs; $i>0; $i--) 
    3372                                                 {                                                                
    3373                                                         $iuid = @imap_uid($this->mbox,$i); 
    3374                                                         $header = $this->get_header($iuid);                                                              
    3375                                                         if(trim($header->Flagged)) 
     3368                                if((!strpos($filter,"FLAGGED") === false) || (!strpos($filter,"UNFLAGGED") === false)) 
     3369                                                { 
     3370                                        $num_msgs = imap_num_msg($mbox_stream); 
     3371                                                        $flagged_msgs = array(); 
     3372                                                        for ($i=$num_msgs; $i>0; $i--) 
     3373                                                        {                                                                
     3374                                                                $iuid = @imap_uid($this->mbox,$i); 
     3375                                                                $header = $this->get_header($iuid);                                                              
     3376                                                                if(trim($header->Flagged)) 
     3377                                                                { 
     3378                                                                        $flagged_msgs[$i] = $iuid; 
     3379                                                                } 
     3380                                                        } 
     3381                                                        if((count($flagged_msgs) >0) && (strpos($filter,"UNFLAGGED") === false)) 
    33763382                                                        { 
    3377                                                                 $flagged_msgs[$i] = $iuid; 
     3383                                                                $arry_diff = array_diff($flagged_msgs,$search_criteria); 
     3384                                                                foreach($arry_diff as $msg) 
     3385                                                                { 
     3386                                                                        $search_criteria[] = $msg; 
     3387                                                                } 
     3388                                                        } 
     3389                                                        else if((count($flagged_msgs) >0) && (is_array($search_criteria)) && (!strpos($filter,"UNFLAGGED") === false)) 
     3390                                                        { 
     3391                                                                $search_criteria = array_diff($search_criteria,$flagged_msgs); 
    33783392                                                        } 
    33793393                                                } 
    3380                                                 if((count($flagged_msgs) >0) && (strpos($filter,"UNFLAGGED") === false)) 
    3381                                                 { 
    3382                                                         $arry_diff = array_diff($flagged_msgs,$search_criteria); 
    3383                                                         foreach($arry_diff as $msg) 
    3384                                                         { 
    3385                                                                 $search_criteria[] = $msg; 
    3386                                                         } 
    3387                                                 } 
    3388                                                 else if((count($flagged_msgs) >0) && (is_array($search_criteria)) && (!strpos($filter,"UNFLAGGED") === false)) 
    3389                                                 { 
    3390                                                         $search_criteria = array_diff($search_criteria,$flagged_msgs); 
    3391                                                 } 
    3392                                         } 
     3394                                        }        
    33933395                                        if( is_array( $search_criteria) ) 
    33943396                                        { 
Note: See TracChangeset for help on using the changeset viewer.