Changeset 5749
- Timestamp:
- 03/19/12 14:36:58 (11 years ago)
- Location:
- trunk/prototype
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/attach_message/attach_message.css
r5519 r5749 46 46 */ 47 47 .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;} 52 55 .deleted { } 53 . flagged {}56 .Flagged {background-image:url(images/important.png); background-repeat: no-repeat;} 54 57 55 58 #loading-content .image {width: 32px; height: 32px; background-image: url(images/loading.gif);} -
trunk/prototype/modules/attach_message/attach_message.js
r5533 r5749 5 5 dots = /\./gi; 6 6 dashes = /\//gi; 7 flags = [ ' Recent', 'Unseen', 'Answered', 'Draft', 'Deleted', 'Flagged' ];7 flags = [ 'Attachment', 'Forwarded' ,'Recent', 'Unseen', 'Answered', 'Draft', 'Deleted', 'Flagged', 'Followupflag', 'Label' ]; 8 8 9 9 $.ajaxPrefilter(function( options, originalOptions, jqXHR ){ … … 104 104 105 105 flags2Class = 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 } 107 118 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 } 113 124 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 } 118 128 return classes; 119 129 } … … 149 159 150 160 NormaliseFrom = 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){ 153 163 return get_lang(special_folders["Drafts"]); 164 } 154 165 return cellvalue; 155 166 } … … 322 333 colModel:[ 323 334 {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}, 326 337 {name:'subject',index:'subject', width:245, sortable:false}, 327 338 {name:'timestamp',index:'timestamp', width:65, align:"center", sortable:false, formatter:date2Time}, -
trunk/prototype/services/ImapServiceAdapter.php
r5745 r5749 19 19 public function find( $URI, $justthese = false, $criteria = false ) 20 20 { 21 //require_once dirname(__FILE__) . '/../api/controller.php'; 21 22 $context = $justthese['context']; 22 23 $URI = $URI['concept']; … … 93 94 94 95 foreach( $result as $i => $val ) 95 $result[$i] = unserialize( $val ); 96 96 $result[$i] = unserialize( $val ); 97 97 } 98 98 else … … 110 110 } 111 111 //return var_export($result); 112 112 113 113 $response = array( "page" => $page, "total" => $total_pages, "records" => $count ); 114 114 115 115 116 for ($i=0; $i<count($result); $i++) 116 117 { 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 ); 118 119 119 120 foreach ($flags_enum as $key => $flag) 120 121 { 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]); 123 125 124 126 unset($result[$i][$flag]); 125 } 126 127 } 127 128 if (array_key_exists($i, $result)) 128 129 { … … 131 132 $response["rows"][$i]['flags'] = implode(',', $flags_enum); 132 133 $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 } 133 160 //$response["rows"][$i]['udate'] = ( $result[$i]['udate'] + $this->functions->CalculateDateOffset() * 1000 ); 134 161 unset($response["rows"][$i]['Size']); 135 162 } 136 } 137 163 } 138 164 return $this->to_utf8($response); 139 165 }
Note: See TracChangeset
for help on using the changeset viewer.