Changeset 5766


Ignore:
Timestamp:
03/20/12 18:11:18 (12 years ago)
Author:
angelo
Message:

Ticket #1985 - Falha na ordenacao das mensagens pela coluna Quem

File:
1 edited

Legend:

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

    r5748 r5766  
    31783178        } 
    31793179 
    3180         function messages_sort($sort_box_type,$sort_box_reverse, $search_box_type,$offsetBegin,$offsetEnd) 
     3180        function messages_sort($sort_box_type,$sort_box_reverse, $search_box_type,$offsetBegin,$offsetEnd,$folder) 
    31813181        { 
    31823182                if ($sort_box_type != "SORTFROM" && $search_box_type!= "FLAGGED"){ 
     
    31973197                        if ($offsetEnd >  $num_msgs) {$offsetEnd = $num_msgs;} 
    31983198                        $slice_array = true; 
    3199                   
     3199            $from_to_sent = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['from_to_sent'];      
    32003200                        for ($i=$num_msgs; $i>0; $i--) 
    32013201                        { 
     
    32213221                                } 
    32223222 
    3223                                 if($sort_box_type=='SORTFROM') { 
    3224                                         if (($header->from[0]->mailbox . "@" . $header->from[0]->host) == $_SESSION['phpgw_info']['expressomail']['user']['email']) 
    3225                                                 $from = $header->to; 
     3223                                if($sort_box_type=='SORTFROM') {                                                                                 
     3224                                        if (strrpos($folder,'Sent') && $from_to_sent) 
     3225                                                $tmp = self::formatMailObject($header->to[0]); 
    32263226                                        else 
    3227                                                 $from = $header->from; 
    3228                                         if(isset($from[0]->personal)) 
    3229                                         $tmp = imap_mime_header_decode($from[0]->personal); 
    3230                                         else 
    3231                                                 $tmp = null; 
    3232                                         if (isset($tmp[0]->text)) 
    3233                                                 $sort[$iuid] = $tmp[0]->text; 
    3234                                         else 
    3235                                                 $sort[$iuid] = $from[0]->mailbox . "@" . $from[0]->host; 
     3227                                                $tmp = self::formatMailObject($header->from[0]); 
     3228                                        $sort[$iuid] = ($tmp['name']) ? $tmp['name'] : $tmp['email'];    
    32363229                                } 
    32373230                                else if($sort_box_type=='SORTSUBJECT') { 
     
    37193712                        $this->mbox = $this->open_mbox($folder); 
    37203713 
    3721                 return $this->messages_sort($sort_box_type,$sort_box_reverse, $search_box_type,$offsetBegin,$offsetEnd); 
     3714                return $this->messages_sort($sort_box_type,$sort_box_reverse, $search_box_type,$offsetBegin,$offsetEnd,$folder); 
    37223715        } 
    37233716 
Note: See TracChangeset for help on using the changeset viewer.