Changeset 5749


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

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

Location:
trunk/prototype
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/attach_message/attach_message.css

    r5519 r5749  
    4646*/ 
    4747.recent {background-image:url(images/.png);} 
    48 .unseen {background-image:url(images/.png);} 
    49 .seen {background-image:url(images/.png);} 
    50 .answered {background-image:url(images/.png);} 
    51 .draft {background-image:url(images/.png);} 
     48.unseen {background-image:url(images/unseen.gif); background-repeat: no-repeat;} 
     49.seen {background-image:url(images/seen.gif); background-repeat: no-repeat;} 
     50.answered {background-image:url(images/answered.gif); background-repeat: no-repeat; position:relative; top:3px; left:3px;} 
     51.forwarded {background-image:url(images/forwarded.gif); background-repeat: no-repeat; position:relative; top:3px; left:3px;} 
     52.draft {background-image:url(images/draft.gif); background-repeat: no-repeat; position:relative; top:3px; left:3px;} 
     53.labeled{background-image:url(images/tag.png); background-repeat: no-repeat; position:relative; top:3px; left:3px;} 
     54.followupflagged{width:8px;height:6px;} 
    5255.deleted { } 
    53 .flagged { } 
     56.Flagged {background-image:url(images/important.png); background-repeat: no-repeat;} 
    5457 
    5558#loading-content .image {width: 32px; height: 32px; background-image: url(images/loading.gif);} 
  • trunk/prototype/modules/attach_message/attach_message.js

    r5533 r5749  
    55dots = /\./gi; 
    66dashes = /\//gi; 
    7 flags = [ 'Recent', 'Unseen',  'Answered',  'Draft',  'Deleted', 'Flagged' ]; 
     7flags = [ 'Attachment', 'Forwarded' ,'Recent', 'Unseen',  'Answered',  'Draft',  'Deleted', 'Flagged', 'Followupflag', 'Label' ]; 
    88 
    99$.ajaxPrefilter(function( options, originalOptions, jqXHR ){ 
     
    104104 
    105105flags2Class = function(cellvalue, options, rowObject) { 
    106         var classes = ''; 
     106        var classes = '';        
     107        cellvalue = cellvalue.split(','); 
     108        cell = { 
     109                        Unseen: parseInt(cellvalue[0])  ? 'Unseen' : 'Seen',  
     110                        Answered: parseInt(cellvalue[1]) ? 'Answered' : (parseInt(cellvalue[2]) ? 'Forwarded' : ''),  
     111                        Flagged: parseInt(cellvalue[3]) ? 'Flagged' : '', 
     112                        Recent: parseInt(cellvalue[4])  ? 'Recent' : '',                         
     113                        Draft: parseInt(cellvalue[5]) ? 'Draft' : ''             
     114                }; 
     115        for(var flag in cell){ 
     116                classes += '<span class="flags '+ (cell[flag]) +'" title="'+ (cell[flag]) +'"> </span>';         
     117        } 
    107118         
    108         if(cellvalue ==""){ 
    109                 classes += '<span class="flags seen" title="seen"> </span>'; 
    110                 return classes; 
    111         } 
    112         var flags_enum = cellvalue.split(','); 
     119        if(rowObject.labels){            
     120                classes += '<span class="flags labeled"> </span>'; 
     121        }else{ 
     122                classes += '<span class="flags"> </span>'; 
     123        } 
    113124         
    114         for (var i=0; i<flags_enum.length; i++){ 
    115                 classes += '<span class="flags '+flags_enum[i].toLowerCase()+'" title="'+flags_enum[i].toLowerCase()+'"> </span>'; 
    116         } 
    117          
     125        if(rowObject.followupflagged){           
     126                classes += '<span class="flags followupflagged" style="background:'+rowObject.followupflagged.backgroundColor+';"><img src="../prototype/modules/mail/img/flagEditor.png"></span>'; 
     127        } 
    118128        return classes; 
    119129} 
     
    149159 
    150160NormaliseFrom = function(cellvalue, options, rowObject) { 
    151         //alert(dump(rowObject)); 
    152         if(rowObject['flags'].indexOf("Draft") >=  0) 
     161        rowObject['flags'] = rowObject['flags'].split(","); 
     162        if(rowObject['flags'][rowObject['flags'].length-1] ==  1){ 
    153163                return get_lang(special_folders["Drafts"]); 
     164        } 
    154165        return cellvalue;        
    155166} 
     
    322333                        colModel:[ 
    323334                                {name:'msg_number',index:'msg_number', width:45, hidden:true, sortable:false}, 
    324                                 {name:'flags',index:'msg_number',edittype: 'image', width:40, sortable:false, formatter:flags2Class}, 
    325                                 {name:'from.name',index:'msg_number', width:130, sortable:false, formatter:NormaliseFrom}, 
     335                                {name:'flags',index:'msg_number',edittype: 'image', width:100, sortable:false, formatter:flags2Class}, 
     336                                {name:'from.name',index:'msg_number', width:70, sortable:false, formatter:NormaliseFrom}, 
    326337                                {name:'subject',index:'subject', width:245, sortable:false}, 
    327338                                {name:'timestamp',index:'timestamp', width:65, align:"center", sortable:false, formatter:date2Time}, 
  • 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.