Changeset 5702


Ignore:
Timestamp:
03/12/12 11:34:43 (12 years ago)
Author:
cristiano
Message:

Ticket #2497 - Mensagem de erro em falha no upload, alerta de arquivos em upload ao enviar

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/js/abas.js

    r5637 r5702  
    410410             if($('#fileupload_msg'+ID).find('.in-progress').length) 
    411411             { 
    412                  msg = 'Existem arqivos sendo enviados para o servidor.'; 
     412                 msg = 'Existem anexos sendo enviados para o servidor.'; 
    413413                 buttons = ['Descartar alterações e anexos', 'Salvar estado atual fechar', 'Continuar editando'];  
    414414                 width = 560; 
  • trunk/expressoMail1_2/js/draw_api.js

    r5678 r5702  
    42224222 
    42234223                done: function(e, data){ 
    4224                         if(!!data.result && data.result != "[]"){ 
    4225                                 var newAttach = jQuery.parseJSON(data.result); 
    4226                                 fileUploadMSG.find('.in-progress:first').parents('p').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>'); 
    4227                                 addAttachment(ID,newAttach['mailAttachment'][0][0].id); 
     4224                        if(!!data.result && data.result != "[]" ){ 
     4225                                var newAttach = jQuery.parseJSON(data.result);                                
     4226                                if(newAttach.rollback === false) 
     4227                                { 
     4228                                    fileUploadMSG.find('.in-progress:first').parents('p').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>'); 
     4229                                    addAttachment(ID,newAttach['mailAttachment'][0][0].id); 
     4230                                } 
     4231                                else                              
     4232                                  fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');    
    42284233                                 
    42294234                        }else { 
    4230                                 fileUploadMSG.find(' .progress.on-complete:first').removeClass('on-complete').parents('p').find('.status-upload').addClass('ui-icon ui-icon-cancel'); 
     4235                                fileUploadMSG.find(' .progress.on-complete:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error'); 
    42314236                        } 
    42324237                        fileUploadMSG.find(' .in-progress:first').remove(); 
  • trunk/expressoMail1_2/js/main.js

    r5689 r5702  
    21462146 
    21472147function send_message(ID, folder, folder_name){ 
    2148  
    2149         if (preferences.auto_save_draft == 1) 
    2150             autoSaveControl.status[ID] = true; 
    2151  
    2152         var save_link = Element("save_message_options_"+ID); 
     2148     if(!zebraDiscardEventDialog && $('#fileupload_msg'+ID).find('.in-progress').length ) 
     2149     { 
     2150         zebraDiscardEventDialog = true; 
     2151         window.setTimeout(function() { 
     2152         $.Zebra_Dialog('Existem anexos sendo enviados para o servidor. Caso envie sua mensagem agora estes arquivos serão perdidos.', { 
     2153                    'type':     'question', 
     2154                    'overlay_opacity': '0.5', 
     2155                    'buttons':  ['Descartar anexos e enviar', 'Continuar editando e esperar anexos'], 
     2156                    'width' : 500, 
     2157                    'onClose':  function(clicked) { 
     2158                            if(clicked == 'Descartar anexos e enviar' )  
     2159                              send_valided_message(ID, folder, folder_name); 
     2160 
     2161                            window.setTimeout(function() { 
     2162                                    zebraDiscardEventDialog = false; 
     2163                            }, 500); 
     2164                    } 
     2165             }) 
     2166          }, 300);  
     2167 
     2168     } 
     2169     else 
     2170       send_valided_message(ID, folder, folder_name);      
     2171} 
     2172 
     2173function send_valided_message(ID, folder, folder_name) 
     2174{  
     2175         
     2176       if (preferences.auto_save_draft == 1) 
     2177           autoSaveControl.status[ID] = true; 
     2178         
     2179        var save_link = Element("save_message_options_"+ID); 
    21532180        var onClick = save_link.onclick; 
    21542181        save_link.onclick = ''; 
     
    22202247        msgId.value = currentTab; 
    22212248 
    2222  
    2223  
    22242249        form.appendChild(msgId); 
    22252250        form.appendChild(save_folder); 
     
    22272252        form.appendChild(msg_attachments); 
    22282253 
    2229     var mail_type = document.createElement('input'); 
     2254        var mail_type = document.createElement('input'); 
    22302255        mail_type.setAttribute('type', 'hidden'); 
    22312256        mail_type.name = 'type'; 
    22322257        mail_type.value = ( mail_as_plain ) ? 'plain' : 'html'; 
    2233     form.parentNode.appendChild(mail_type); 
     2258        form.parentNode.appendChild(mail_type); 
    22342259 
    22352260        var _subject = trim(Element("subject_"+ID).value); 
     
    22722297                } 
    22732298        } 
    2274 } 
     2299 
     2300} 
     2301 
     2302 
    22752303function is_valid_email(campo){  
    22762304        var invalidEmail = searchEmail(campo); 
  • trunk/expressoMail1_2/setup/tables_current.inc.php

    r5684 r5702  
    8484                                'id' => array('type' => 'auto','nullable' => False), 
    8585                                'source' => array('type' => 'blob','nullable' => False), 
    86                                 'type' => array('type' => 'varchar','precision' => '50','nullable' => False), 
     86                                'type' => array('type' => 'varchar','precision' => '255','nullable' => False), 
    8787                                'name' => array('type' => 'varchar','precision' => '255','nullable' => False), 
    8888                'disposition' => array('type' => 'varchar','precision' => '20','nullable' => true), 
  • trunk/expressoMail1_2/setup/tables_update.inc.php

    r5684 r5702  
    214214                                'id' => array('type' => 'auto','nullable' => False), 
    215215                                'source' => array('type' => 'blob','nullable' => False), 
    216                                 'type' => array('type' => 'varchar','precision' => '50','nullable' => False), 
     216                                'type' => array('type' => 'varchar','precision' => '255','nullable' => False), 
    217217                                'name' => array('type' => 'varchar','precision' => '255','nullable' => False), 
    218218                                'disposition' => array('type' => 'varchar','precision' => '20','nullable' => true), 
  • trunk/expressoMail1_2/templates/default/expressomail.css

    r5640 r5702  
    161161.message-attach.name{width: 200px;} 
    162162.message-attach.size{margin:0 4px 0 4px;} 
     163.message-attach-error{color:red;} 
  • trunk/library/ckeditor/plugins/expresso/plugin.js

    r5604 r5702  
    169169                        if(!!data.result && data.result != "[]"){ 
    170170                                var newAttach = jQuery.parseJSON(data.result); 
    171                                 fileUploadMSG.find('.in-progress:first').parents('p').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>'); 
    172                                 addAttachment(ID,newAttach['mailAttachment'][0][0].id); 
    173                                 var content_body  = RichTextEditor.getData('body_'+ID); 
    174                                 var rex = new RegExp('<img id="'+newImageId+'" src="" [^\/>]*\/>', 'i');  
    175                                 var newImg = '<img src="../prototype/getArchive.php?mailAttachment='+newAttach['mailAttachment'][0][0].id+'" />';  
    176                                 content_body = content_body.replace(rex,newImg);  
    177                                 RichTextEditor.setData('body_'+ID,content_body);  
     171                                if(newAttach.rollback === false) 
     172                                { 
     173                                    fileUploadMSG.find('.in-progress:first').parents('p').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>'); 
     174                                    addAttachment(ID,newAttach['mailAttachment'][0][0].id); 
     175                                    var content_body  = RichTextEditor.getData('body_'+ID); 
     176                                    var rex = new RegExp('<img id="'+newImageId+'" src="" [^\/>]*\/>', 'i');  
     177                                    var newImg = '<img src="../prototype/getArchive.php?mailAttachment='+newAttach['mailAttachment'][0][0].id+'" />';  
     178                                    content_body = content_body.replace(rex,newImg);  
     179                                    RichTextEditor.setData('body_'+ID,content_body);  
     180                                } 
     181                                else 
     182                                    fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');    
    178183       
    179184                        }else { 
    180                                 fileUploadMSG.find(' .progress.on-complete:first').removeClass('on-complete').parents('p').find('.status-upload').addClass('ui-icon ui-icon-cancel'); 
     185                                    fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');    
    181186                        } 
    182187                        fileUploadMSG.find('.in-progress:first').remove(); 
  • trunk/prototype/config/mailAttachment.ini

    r5637 r5702  
    11service = PostgreSQL 
    2 PostgreSQL.concept = mail_attachment 
     2PostgreSQL.concept = expressomail_attachment 
    33 
    44[before.create] 
Note: See TracChangeset for help on using the changeset viewer.