Ignore:
Timestamp:
03/19/12 14:36:58 (12 years ago)
Author:
douglasz
Message:

Ticket #2486 - Adicionado os icones na tela de anexar mensagens

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/services/ImapServiceAdapter.php

    r5745 r5749  
    1919    public function find( $URI, $justthese = false, $criteria = false ) 
    2020        {  
     21                //require_once dirname(__FILE__) . '/../api/controller.php'; 
    2122                $context = $justthese['context']; 
    2223                $URI = $URI['concept']; 
     
    9394 
    9495                                        foreach( $result as $i => $val ) 
    95                                         $result[$i] = unserialize( $val ); 
    96  
     96                                                $result[$i] = unserialize( $val ); 
    9797                                } 
    9898                                else 
     
    110110                                } 
    111111                                //return var_export($result); 
    112  
     112                                 
    113113                                $response = array( "page" => $page, "total" => $total_pages, "records" => $count ); 
     114 
    114115                                 
    115116                                for ($i=0; $i<count($result); $i++) 
    116117                                { 
    117                                         $flags_enum = array('Recent', 'Unseen',  'Answered',  'Draft',  'Deleted', 'Flagged'); 
     118                                        $flags_enum = array('Unseen'=> 1,  'Answered'=> 1, 'Forwarded'=> 1, 'Flagged'=> 1, 'Recent'=> 1, 'Draft'=> 1 ); 
    118119 
    119120                                        foreach ($flags_enum as $key => $flag) 
    120121                                        { 
    121                                                 if ( !isset($result[$i][$flag]) || !trim($result[$i][$flag]) || trim($result[$i][$flag]) == '')  
    122                                                         unset($flags_enum[$key]); 
     122                                                if ( !isset($result[$i][$key]) || !trim($result[$i][$key]) || trim($result[$i][$key]) == '')  
     123                                                        $flags_enum[$key] = 0; 
     124                                                        //unset($flags_enum[$key]); 
    123125 
    124126                                                unset($result[$i][$flag]); 
    125                                         } 
    126  
     127                                        }                                        
    127128                                        if (array_key_exists($i, $result)) 
    128129                                        { 
     
    131132                                                $response["rows"][$i]['flags'] = implode(',', $flags_enum); 
    132133                                                $response["rows"][$i]['size'] = $response["rows"][$i]['Size']; 
     134                                                $response["rows"][$i]['folder'] = $folder_name; 
     135                                                $filter = array('AND', array('=', 'folderName', $folder_name), array('=','messageNumber', $result[$i]['msg_number'])); 
     136                                                $followupflagged = Controller::find( 
     137                                                        array('concept' => 'followupflagged'), 
     138                                                        false,  
     139                                                        array('filter' => $filter, 'criteria' => array('deepness' => '2')) 
     140                                                ); 
     141 
     142 
     143                                                if(isset($followupflagged[0]['followupflagId'])) 
     144                                                { 
     145                                                        $followupflag = Controller::read( array( 'concept' => 'followupflag', 'id' => $followupflagged[0]['followupflagId'] ));      
     146                                                        $followupflagged[0]['followupflag'] = $followupflag; 
     147                                                        $response["rows"][$i]['followupflagged'] = $followupflagged[0]; 
     148 
     149                                                } 
     150 
     151                                                $labeleds = Controller::find( 
     152                                                        array('concept' => 'labeled'), 
     153                                                        false,  
     154                                                        array('filter' => $filter, 'criteria' => array('deepness' => '2')) 
     155                                                ); 
     156                                                foreach ($labeleds as $e){ 
     157                                                        $labels = Controller::read( array( 'concept' => 'label', 'id' =>  $e['labelId']));      
     158                                                        $response["rows"][$i]['labels'][$e['labelId']] = $labels; 
     159                                                }        
    133160                                                //$response["rows"][$i]['udate'] = ( $result[$i]['udate'] + $this->functions->CalculateDateOffset()  * 1000 ); 
    134161                                                unset($response["rows"][$i]['Size']); 
    135162                                        } 
    136                                  } 
    137  
     163                                 }                                        
    138164                                return $this->to_utf8($response); 
    139165                        } 
Note: See TracChangeset for help on using the changeset viewer.