Index: /trunk/library/ckeditor/plugins/expresso/plugin.js
===================================================================
--- /trunk/library/ckeditor/plugins/expresso/plugin.js	(revision 5604)
+++ /trunk/library/ckeditor/plugins/expresso/plugin.js	(revision 5702)
@@ -169,14 +169,19 @@
 			if(!!data.result && data.result != "[]"){
 				var newAttach = jQuery.parseJSON(data.result);
-				fileUploadMSG.find('.in-progress:first').parents('p').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>');
-                                addAttachment(ID,newAttach['mailAttachment'][0][0].id);
-                                var content_body  = RichTextEditor.getData('body_'+ID);
-                                var rex = new RegExp('<img id="'+newImageId+'" src="" [^\/>]*\/>', 'i'); 
-                                var newImg = '<img src="../prototype/getArchive.php?mailAttachment='+newAttach['mailAttachment'][0][0].id+'" />'; 
-                                content_body = content_body.replace(rex,newImg); 
-                                RichTextEditor.setData('body_'+ID,content_body); 
+                                if(newAttach.rollback === false)
+                                {
+                                    fileUploadMSG.find('.in-progress:first').parents('p').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>');
+                                    addAttachment(ID,newAttach['mailAttachment'][0][0].id);
+                                    var content_body  = RichTextEditor.getData('body_'+ID);
+                                    var rex = new RegExp('<img id="'+newImageId+'" src="" [^\/>]*\/>', 'i'); 
+                                    var newImg = '<img src="../prototype/getArchive.php?mailAttachment='+newAttach['mailAttachment'][0][0].id+'" />'; 
+                                    content_body = content_body.replace(rex,newImg); 
+                                    RichTextEditor.setData('body_'+ID,content_body); 
+                                }
+                                else
+                                    fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');   
       
 			}else {
-				fileUploadMSG.find(' .progress.on-complete:first').removeClass('on-complete').parents('p').find('.status-upload').addClass('ui-icon ui-icon-cancel');
+                                    fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');   
 			}
 			fileUploadMSG.find('.in-progress:first').remove();
Index: /trunk/prototype/config/mailAttachment.ini
===================================================================
--- /trunk/prototype/config/mailAttachment.ini	(revision 5637)
+++ /trunk/prototype/config/mailAttachment.ini	(revision 5702)
@@ -1,4 +1,4 @@
 service = PostgreSQL
-PostgreSQL.concept = mail_attachment
+PostgreSQL.concept = expressomail_attachment
 
 [before.create]
Index: /trunk/expressoMail1_2/templates/default/expressomail.css
===================================================================
--- /trunk/expressoMail1_2/templates/default/expressomail.css	(revision 5640)
+++ /trunk/expressoMail1_2/templates/default/expressomail.css	(revision 5702)
@@ -161,2 +161,3 @@
 .message-attach.name{width: 200px;}
 .message-attach.size{margin:0 4px 0 4px;}
+.message-attach-error{color:red;}
Index: /trunk/expressoMail1_2/setup/tables_current.inc.php
===================================================================
--- /trunk/expressoMail1_2/setup/tables_current.inc.php	(revision 5684)
+++ /trunk/expressoMail1_2/setup/tables_current.inc.php	(revision 5702)
@@ -84,5 +84,5 @@
 				'id' => array('type' => 'auto','nullable' => False),
 				'source' => array('type' => 'blob','nullable' => False),
-				'type' => array('type' => 'varchar','precision' => '50','nullable' => False),
+				'type' => array('type' => 'varchar','precision' => '255','nullable' => False),
 				'name' => array('type' => 'varchar','precision' => '255','nullable' => False),
                 'disposition' => array('type' => 'varchar','precision' => '20','nullable' => true),
Index: /trunk/expressoMail1_2/setup/tables_update.inc.php
===================================================================
--- /trunk/expressoMail1_2/setup/tables_update.inc.php	(revision 5684)
+++ /trunk/expressoMail1_2/setup/tables_update.inc.php	(revision 5702)
@@ -214,5 +214,5 @@
 				'id' => array('type' => 'auto','nullable' => False),
 				'source' => array('type' => 'blob','nullable' => False),
-				'type' => array('type' => 'varchar','precision' => '50','nullable' => False),
+				'type' => array('type' => 'varchar','precision' => '255','nullable' => False),
 				'name' => array('type' => 'varchar','precision' => '255','nullable' => False),
                                 'disposition' => array('type' => 'varchar','precision' => '20','nullable' => true),
Index: /trunk/expressoMail1_2/js/abas.js
===================================================================
--- /trunk/expressoMail1_2/js/abas.js	(revision 5637)
+++ /trunk/expressoMail1_2/js/abas.js	(revision 5702)
@@ -410,5 +410,5 @@
              if($('#fileupload_msg'+ID).find('.in-progress').length)
              {
-                 msg = 'Existem arqivos sendo enviados para o servidor.';
+                 msg = 'Existem anexos sendo enviados para o servidor.';
                  buttons = ['Descartar alterações e anexos', 'Salvar estado atual fechar', 'Continuar editando']; 
                  width = 560;
Index: /trunk/expressoMail1_2/js/main.js
===================================================================
--- /trunk/expressoMail1_2/js/main.js	(revision 5689)
+++ /trunk/expressoMail1_2/js/main.js	(revision 5702)
@@ -2146,9 +2146,36 @@
 
 function send_message(ID, folder, folder_name){
-
-	if (preferences.auto_save_draft == 1)
-            autoSaveControl.status[ID] = true;
-
-	var save_link = Element("save_message_options_"+ID);
+     if(!zebraDiscardEventDialog && $('#fileupload_msg'+ID).find('.in-progress').length )
+     {
+         zebraDiscardEventDialog = true;
+         window.setTimeout(function() {
+         $.Zebra_Dialog('Existem anexos sendo enviados para o servidor. Caso envie sua mensagem agora estes arquivos serão perdidos.', {
+                    'type':     'question',
+                    'overlay_opacity': '0.5',
+                    'buttons':  ['Descartar anexos e enviar', 'Continuar editando e esperar anexos'],
+                    'width' : 500,
+                    'onClose':  function(clicked) {
+                            if(clicked == 'Descartar anexos e enviar' ) 
+                              send_valided_message(ID, folder, folder_name);
+
+                            window.setTimeout(function() {
+                                    zebraDiscardEventDialog = false;
+                            }, 500);
+                    }
+             })
+          }, 300); 
+
+     }
+     else
+       send_valided_message(ID, folder, folder_name);     
+}
+
+function send_valided_message(ID, folder, folder_name)
+{ 
+        
+       if (preferences.auto_save_draft == 1)
+           autoSaveControl.status[ID] = true;
+        
+        var save_link = Element("save_message_options_"+ID);
         var onClick = save_link.onclick;
 	save_link.onclick = '';
@@ -2220,6 +2247,4 @@
 	msgId.value = currentTab;
 
-
-
 	form.appendChild(msgId);
         form.appendChild(save_folder);
@@ -2227,9 +2252,9 @@
 	form.appendChild(msg_attachments);
 
-    var mail_type = document.createElement('input');
+        var mail_type = document.createElement('input');
 	mail_type.setAttribute('type', 'hidden');
 	mail_type.name = 'type';
 	mail_type.value = ( mail_as_plain ) ? 'plain' : 'html';
-    form.parentNode.appendChild(mail_type);
+        form.parentNode.appendChild(mail_type);
 
 	var _subject = trim(Element("subject_"+ID).value);
@@ -2272,5 +2297,8 @@
 		}
 	}
-}
+
+}
+
+
 function is_valid_email(campo){	
 	var invalidEmail = searchEmail(campo);
Index: /trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- /trunk/expressoMail1_2/js/draw_api.js	(revision 5678)
+++ /trunk/expressoMail1_2/js/draw_api.js	(revision 5702)
@@ -4222,11 +4222,16 @@
 
 		done: function(e, data){
-			if(!!data.result && data.result != "[]"){
-				var newAttach = jQuery.parseJSON(data.result);
-				fileUploadMSG.find('.in-progress:first').parents('p').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>');
-                                addAttachment(ID,newAttach['mailAttachment'][0][0].id);
+			if(!!data.result && data.result != "[]" ){
+				var newAttach = jQuery.parseJSON(data.result);                               
+                                if(newAttach.rollback === false)
+                                {
+                                    fileUploadMSG.find('.in-progress:first').parents('p').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>');
+                                    addAttachment(ID,newAttach['mailAttachment'][0][0].id);
+                                }
+                                else                             
+                                  fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');   
                                 
 			}else {
-				fileUploadMSG.find(' .progress.on-complete:first').removeClass('on-complete').parents('p').find('.status-upload').addClass('ui-icon ui-icon-cancel');
+				fileUploadMSG.find(' .progress.on-complete:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');
 			}
                         fileUploadMSG.find(' .in-progress:first').remove();
