Changeset 5742 for trunk


Ignore:
Timestamp:
03/16/12 15:04:24 (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

    r5740 r5742  
    197197                                                                         
    198198                                                                         
    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                                                                         ); 
    245 ob_start(); 
    246 print_r(var_export($followupflagged)); 
    247  
    248 $output = ob_get_clean(); 
    249 file_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                                                                         } */ 
     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                                                         
     221                                                        if(isset($labeleds) && count($labeleds) > 0 && $labeleds){ 
     222                                                                $return[$i]['labels'] = array(); 
     223 
     224                                                                foreach ($labeleds as $e){ 
     225                                                                 
     226                                                                        $labels = Controller::read( array( 'concept' => 'label', 'id' =>  $e['labelId']));      
     227                                                                        $return[$i]['labels'][] = $labels; 
     228                                                                }        
     229                                                        } 
    266230                                    $i++; 
    267231                            } 
Note: See TracChangeset for help on using the changeset viewer.