Index: /trunk/expressoMail1_2/js/main.js
===================================================================
--- /trunk/expressoMail1_2/js/main.js	(revision 7523)
+++ /trunk/expressoMail1_2/js/main.js	(revision 7525)
@@ -3808,4 +3808,5 @@
 }
 
+
 /*PERMITE A IMPRESSÃO DE UMA LISTA DE MENSAGENS E SEU CONTEÚDO*/
 function print_messages_bodies(){
@@ -3814,5 +3815,4 @@
 
 	var print_bodies = function (data){
-		data = data[get_current_folder()];
 		var print_width = screen.width - 200;
 		var x = ((screen.width - print_width) / 2);
@@ -3853,5 +3853,28 @@
 			if(message.smalldate)
 				html += newRow(get_lang('Date')+":",message.smalldate);
-				
+			/*DATA NAS MESAGENS LOCAIS*/
+			else if(message.udate){
+				var norm = function (arg) {return (arg < 10 ? '0'+arg : arg);};
+				var weekDays = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
+			    var today = new Date();
+				today.setHours(23);
+				today.setMinutes(59);
+                today.setSeconds(59);
+                today.setMilliseconds(999);
+	            udate_local = message.udate*1000 + today.getTimezoneOffset()*60*1000;
+	            date_msg = new Date(udate_local);				
+				if (preferences.show_date_numerical == 0 || typeof(preferences.show_date_numerical) == 'undefined') { 	
+					if (today.getTime() - date_msg.getTime() < 86400000)
+						html += newRow(get_lang('Date')+":",norm(date_msg.getHours()) + ':' + norm(date_msg.getMinutes()));
+					else
+						if (today.getTime() - date_msg.getTime() < 172800000)
+							newRow(get_lang('Date')+":",get_lang('Yesterday'));
+						else if (today.getTime() - date_msg.getTime() < 259200000)
+							html += newRow(get_lang('Date')+":",get_lang(weekDays[date_msg.getDay()]));
+						else
+							html += newRow(get_lang('Date')+":",norm(date_msg.getDate()) + '/' + norm(date_msg.getMonth()+1) + '/' +date_msg.getFullYear());					
+				}else
+					html += newRow(get_lang('Date')+":",norm(date_msg.getDate()) + '/' + norm(date_msg.getMonth()+1) + '/' +date_msg.getFullYear());
+			}	
 			html += newRow(get_lang('Subject')+":",message.subject);		
 			/*LISTA DE ANEXOS*/
@@ -3861,4 +3884,13 @@
 	 	        $.each(message.attachments,function(index,attach){
 	 	        	atts += " | " + attach.name + "("+ formatBytes(attach.fsize) +") " + img + " | ";
+	 	        });
+	 	        html += newRow(get_lang('Attachments: '),atts);       
+	 	    }
+	 	    /*ANEXOS LOCAIS*/
+	 	    else if (message.attachment && message.attachment.number_attachments > 0) {
+	 	        var img = '<img style="margin-bottom : -5px; cursor : pointer;" src="templates/'+template+'/images/new.png">';
+	 	        var atts = "";
+	 	        $.each(message.attachment.names.split(','),function(index,attach){
+	 	        	atts += " | " + attach + img + " |";
 	 	        });
 	 	        html += newRow(get_lang('Attachments: '),atts);       
@@ -3874,22 +3906,32 @@
 		window_print.print();
 	}
-	$.ajax({			
-			url: "controller.php?" + $.param( {action: "$this.imap_functions.getMessages",
-				details: "all",
-                messages : messages,
-				}),
-			success: function(data){
-				data = connector.unserialize(data);
-				if(data){
-                  print_bodies(data);
+			/*MENSAGENS LOCAIS*/
+	if ( proxy_mensagens.is_local_folder(get_current_folder()) ){
+		var msgs = Array();
+		$.each(get_selected_messages().split(','),function(index,value){
+			msgs.push(expresso_mail_archive.getMessageHeaders(value));
+		});
+		print_bodies(msgs);
+	}
+	else{
+		$.ajax({			
+				url: "controller.php?" + $.param( {action: "$this.imap_functions.getMessages",
+					details: "all",
+	                messages : messages,
+					}),
+				success: function(data){
+					data = connector.unserialize(data);
+					if(data){
+	                  print_bodies(data[get_current_folder()]);
+					}
+				},
+				beforeSend: function( jqXHR, settings ){
+					connector.showProgressBar();
+				},
+				complete: function( jqXHR, settings ){
+					connector.hideProgressBar();
 				}
-			},
-			beforeSend: function( jqXHR, settings ){
-				connector.showProgressBar();
-			},
-			complete: function( jqXHR, settings ){
-				connector.hideProgressBar();
-			}
-		});	
+			});
+	}	
 }
 
@@ -3897,5 +3939,5 @@
 	var tbody = $("<tbody>");
 	$.each(messages,function(index,msg){
-		var newTr = make_tr_message(msg,get_current_folder(),msg.offsetToGMT);
+		var newTr = make_tr_message(msg,get_current_folder());
 		if (msg.attachments && msg.attachments.length){
 			$(newTr).find('td').eq(1).html("<img src ='templates/"+template+"/images/clip.gif'>");
@@ -3950,23 +3992,33 @@
 		var messages = {};
 		messages[get_current_folder()] = msgs_number.split(',');
-		$.ajax({			
-		url: "controller.php?" + $.param( {action: "$this.imap_functions.getMessages",
-            details : "all",
-            messages : messages,
-			}),
-		success: function(data){
-			data = connector.unserialize(data);
-			if(data){
-				data = data[get_current_folder()];
-              	print_list(newTbody(data));
-			}
-		},
-		beforeSend: function( jqXHR, settings ){
-			connector.showProgressBar();
-		},
-		complete: function( jqXHR, settings ){
-			connector.hideProgressBar();
-		}
-	});	
+		/*MENSAGENS LOCAIS*/
+		if ( proxy_mensagens.is_local_folder(get_current_folder()) ){
+			var msgs = Array();
+			$.each(msgs_number.split(','),function(index,value){
+				msgs.push(expresso_mail_archive.getMessageHeaders(value));
+			});
+			print_list(newTbody(msgs));
+		}
+		else{
+			$.ajax({			
+				url: "controller.php?" + $.param( {action: "$this.imap_functions.getMessages",
+		            details : "all",
+		            messages : messages,
+					}),
+				success: function(data){
+					data = connector.unserialize(data);
+					if(data){
+						data = data[get_current_folder()];
+		              	print_list(newTbody(data));
+					}
+				},
+				beforeSend: function( jqXHR, settings ){
+					connector.showProgressBar();
+				},
+				complete: function( jqXHR, settings ){
+					connector.hideProgressBar();
+				}
+			});	
+		}	
 	}
 }
@@ -3983,4 +4035,5 @@
 		return print_search_msg();
 	}
+
 	if (get_selected_messages() == false){
 		return print_messages_list();
Index: /trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- /trunk/expressoMail1_2/js/draw_api.js	(revision 7523)
+++ /trunk/expressoMail1_2/js/draw_api.js	(revision 7525)
@@ -1987,5 +1987,5 @@
 				td_element3.innerHTML += "<span style=\"color:red\">("+get_lang("Draft")+") </span>";
 			else{
-				if(headers_msgs.to[0].email != null && headers_msgs.to[0].email.toLowerCase() != Element("user_email").value) 
+				if(headers_msgs.to && headers_msgs.to[0].email != null && headers_msgs.to[0].email.toLowerCase() != Element("user_email").value) 
 					td_element24.innerHTML = "<img align='center' src ='templates/"+template+"/images/sent.gif' title='"+get_lang('Sent')+"'>";
 
