Ignore:
Timestamp:
03/16/12 15:01:10 (12 years ago)
Author:
thiago
Message:

Ticket #2486 - funcionalidade de recuperação dos labels e acompanhamentos pelo php.

File:
1 edited

Legend:

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

    r5689 r5740  
    158158        function get_range_msgs2($params) 
    159159        {        
     160                include '../prototype/api/controller.php'; 
    160161            // Free others requests 
    161162            session_write_close(); 
     
    194195                                             
    195196                                    $return[$i] = $this->get_info_head_msg( $msg_number , $sample ); 
     197                                                                         
     198                                                                         
     199                                $filter = array('AND', array('=', 'folderName', $folder), array('=','messageNumber', $msg_number)); 
     200                                $followupflagged = Controller::find( 
     201                                        array('concept' => 'followupflagged'), 
     202                                        false,  
     203                                        array('filter' => $filter, 'criteria' => array('deepness' => '2')) 
     204                                ); 
     205 
     206                                if(isset($followupflagged[0]['followupflagId'])) 
     207                                { 
     208                                        $followupflag = Controller::read( array( 'concept' => 'followupflag', 'id' => $followupflagged[0]['followupflagId'] ));      
     209                                        $followupflagged[0]['followupflag'] = $followupflag; 
     210                                        $return[$i]['followupflagged'] = $followupflagged[0]; 
     211 
     212                                } 
     213 
     214                                $labeleds = Controller::find( 
     215                                        array('concept' => 'labeled'), 
     216                                        false,  
     217                                        array('filter' => $filter, 'criteria' => array('deepness' => '2')) 
     218                                ); 
     219                                 
     220                                ob_start(); 
     221                                var_dump($labeleds); 
     222 
     223                                $output = ob_get_clean(); 
     224                                file_put_contents( "/tmp/thiago.log", $output , FILE_APPEND); 
     225 
     226                                 
     227                                if(isset($labeleds) && count($labeleds) > 0 && $labeleds){ 
     228                                        $return[$i]['labels'] = array(); 
     229 
     230                                        foreach ($labeleds as $e){ 
     231                                         
     232                                                $labels = Controller::read( array( 'concept' => 'label', 'id' =>  $e['labelId']));      
     233                                                $return[$i]['labels'][] = $labels; 
     234                                        }        
     235                                } 
     236/*                                       
     237                                                                         
     238                                                                         
     239                                                                        $filter = array(array('=','messageNumber', $msg_number)); 
     240                                                                        $followupflagged = Controller::find( 
     241                                                                                array('concept' => 'followupflagged'), 
     242                                                                                false,  
     243                                                                                array('filter' => $filter, 'criteria' => array('deepness' => '2')) 
     244                                                                        ); 
     245ob_start(); 
     246print_r(var_export($followupflagged)); 
     247 
     248$output = ob_get_clean(); 
     249file_put_contents( "/tmp/thiago.log", $output , FILE_APPEND); 
     250 
     251                                                                        if(isset($followupflagged[0]['followupflagId'])) 
     252                                                                        { 
     253                                                                                $followupflag = Controller::read( array( 'concept' => 'followupflag', 'id' => $followupflagged[0]['followupflagId'] ));      
     254                                                                                $return[$i]['followupflag'] = $followupflag; 
     255                                                                        } 
     256 
     257                                                                        $labeleds = Controller::find( 
     258                                                                                array('concept' => 'labeled'), 
     259                                                                                false,  
     260                                                                                array('filter' => $filter, 'criteria' => array('deepness' => '2')) 
     261                                                                        ); 
     262                                                                        foreach ($labeleds as $e){ 
     263                                                                                $labels = Controller::read( array( 'concept' => 'label', 'id' =>  $e['labelId']));      
     264                                                                                $return[$i]['labels'] = $labels; 
     265                                                                        } */ 
    196266                                    $i++; 
    197267                            } 
     
    226296                        $return['num_msgs'] = count($sort_array_msg)+($msg_range_begin-1); 
    227297                } 
    228  
    229298                return $return; 
    230299    } 
     
    48424911                                        $return['msgs'][$i]['followupflagged'] = $followupflagged[0]; 
    48434912 
    4844                                 } 
    4845  
     4913                                }        
    48464914                                $labeleds = Controller::find( 
    48474915                                        array('concept' => 'labeled'), 
Note: See TracChangeset for help on using the changeset viewer.