Changeset 5740


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.

Location:
trunk/expressoMail1_2
Files:
3 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'), 
  • trunk/expressoMail1_2/js/doiMenuData.js

    r5738 r5740  
    218218        var menuItems = {}; 
    219219        if (messageInfo.labels) { 
     220                if($.isArray(messageInfo.labels)){ 
     221                        var labels = messageInfo.labels; 
     222                        messageInfo.labels = {}; 
     223                        for(var i in labels) 
     224                                messageInfo.labels[labels[i].id] = {backgroundColor: labels[i]['backgroundColor'], 
     225                                        borderColor: labels[i]['borderColor'], 
     226                                        fontColor: labels[i]['fontColor'], id: labels[i]['id'], name: labels[i]['name'],  
     227                                        uid: labels[i]['uid'] } 
     228                }        
    220229                menuItems = messageInfo.labels; 
    221230        } else { 
  • trunk/expressoMail1_2/js/draw_api.js

    r5738 r5740  
    10121012// Draw the inbox and another folders 
    10131013function draw_box(headers_msgs, msg_folder, alternate){ 
     1014 
     1015//console.log(headers_msgs); 
    10141016        /* 
    10151017         * When the paging response is not in the correct folder you need to change folder 
     
    10431045         * into message array  
    10441046         */ 
    1045         var messageNumbers = new Array(); 
     1047/*      var messageNumbers = new Array(); 
    10461048        for (var i=0; i<headers_msgs.length; i++) { 
    10471049                messageNumbers.push(headers_msgs[i].msg_number); 
     
    10621064                        } 
    10631065                } 
    1064         } 
    1065          
     1066        } */ 
     1067         
    10661068        /** 
    10671069         * Get the followupflags applied to the messages and saves the information  
    10681070         * into message array  
    10691071         */ 
    1070         var followupflaggeds = DataLayer.get('followupflagged', { 
     1072/*      var followupflaggeds = DataLayer.get('followupflagged', { 
    10711073                        criteria: { 
    10721074                                filter: ['AND', ['IN', 'messageNumber', messageNumbers], ['=', 'folderName', msg_folder]], 
     
    10851087                        } 
    10861088                } 
    1087         } 
     1089        } */ 
    10881090         
    10891091        /** 
Note: See TracChangeset for help on using the changeset viewer.