Changeset 4871


Ignore:
Timestamp:
07/29/11 17:10:54 (10 years ago)
Author:
cassiano.dalpizzol
Message:

Ticket #1269 - Move e Delete Implementados em sua versão beta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/expressoMail1_2/MailArchiver/2.2/expressoMail1_2/js/mail_archiver.js

    r4856 r4871  
    151151    this.drawdata = null; 
    152152    this.onprocess = false; 
    153     this.queryconfig = new MAQueryConfig(); 
     153    this.specialfolders = { 
     154                            "inbox":"local_inbox",  
     155                            "sent":"local_sent",  
     156                            "drafts":"local_drafts",  
     157                            "outbox":"local_outbox",  
     158                            "trash":"local_trash" 
     159                          }; 
     160    //this.queryconfig = new MAQueryConfig(); 
    154161} 
    155162 
     
    380387    window.setTimeout("eval('document.getElementById(\"main_title\").innerHTML =\"Expresso Mail\"')",3000); 
    381388} 
     389 
     390/** 
     391 *Archieve Delete Message 
     392 * 
     393 *@author Cassiano Dal Pizzol [cassiano.dalpizzol@serpro.gov.br] 
     394 * 
     395 *@param msg_number Unique identification of the message 
     396 */ 
     397MailArchiver.prototype.deleteMessages = function(msgs_number){ 
     398    try{ 
     399        expresso_mail_archive.CreateMessageList(msgs_number); 
     400        if((expresso_mail_archive.message_list.length > 0) && (expresso_mail_archive.message_list[0] != '')) { 
     401            ArchiveServices.deleteMessages(expresso_mail_archive.deleteMessagesOperationOK,  
     402                                           expresso_mail_archive.deleteMessagesOperationFailure,  
     403                                           sessid,  
     404                                           expresso_mail_archive.message_list); 
     405        } 
     406    } 
     407    catch (e){ 
     408        return (e); 
     409    } 
     410} 
     411 
     412/** 
     413 *Archieve Delete Message Ok 
     414 * 
     415 *@author Cassiano Dal Pizzol [cassiano.dalpizzol@serpro.gov.br] 
     416 * 
     417 */ 
     418MailArchiver.prototype.deleteMessagesOperationOK = function(){ 
     419    var drawinginfo = {treeObject: tree_folders, treeName: 'tree_folders'}; 
     420    expresso_mail_archive.drawdata = drawinginfo; 
     421    expresso_mail_archive.drawFolderTree(); 
     422    expresso_mail_archive.listMessages(); 
     423    if(expresso_mail_archive.message_list.length > 1){ 
     424        write_msg(get_lang("The messages were deleted.")); 
     425    }else{ 
     426        write_msg(get_lang("The message was deleted.")); 
     427    }  
     428} 
     429 
     430/** 
     431 *Archieve Delete Message Operation Failure 
     432 * 
     433 *@author Cassiano Dal Pizzol [cassiano.dalpizzol@serpro.gov.br] 
     434 * 
     435 */ 
     436MailArchiver.prototype.deleteMessagesOperationFailure = function(error_message){ 
     437    if(expresso_mail_archive.message_list.length > 1){ 
     438        write_msg(get_lang("Error deleting messages.") + ' ' + error_message.getReturn()); 
     439    }else{ 
     440        write_msg(get_lang("Error deleting message.") + ' ' + error_message.getReturn()); 
     441    }  
     442} 
     443 
     444/** 
     445 *Move message 
     446 * 
     447 *@param folder Folder where the message will be moved 
     448 *@param msgs_number Unique Id of the message 
     449 * 
     450 *@author Cassiano Dal Pizzol [cassiano.dalpizzol@serpro.gov.br] 
     451 * 
     452 */ 
     453MailArchiver.prototype.moveMessages = function(folder, msgs_number){ 
     454    try{ 
     455        expresso_mail_archive.CreateMessageList(msgs_number); 
     456        if((expresso_mail_archive.message_list.length > 0) && (expresso_mail_archive.message_list[0] != '')) { 
     457            ArchiveServices.moveMessages(expresso_mail_archive.moveMessagesOperationOK,  
     458                                           expresso_mail_archive.moveMessagesOperationFailure, 
     459                                           sessid,  
     460                                           expresso_mail_archive.message_list, 
     461                                           folder 
     462                                       ); 
     463        } 
     464        else { 
     465            throw "Error moving the messages!"; 
     466        } 
     467    } 
     468    catch (e){ 
     469        return (e); 
     470    } 
     471} 
     472 
     473/** 
     474 *Move Message Ok 
     475 * 
     476 *@author Cassiano Dal Pizzol [cassiano.dalpizzol@serpro.gov.br] 
     477 * 
     478 */ 
     479MailArchiver.prototype.moveMessagesOperationOK = function(){ 
     480    var drawinginfo = {treeObject: tree_folders, treeName: 'tree_folders'}; 
     481    expresso_mail_archive.drawdata = drawinginfo; 
     482    expresso_mail_archive.drawFolderTree(); 
     483    expresso_mail_archive.listMessages(); 
     484    if(expresso_mail_archive.message_list.length > 1){ 
     485        write_msg(get_lang("The messages were moved.")); 
     486    }else{ 
     487        write_msg(get_lang("The message was moved.")); 
     488    }  
     489} 
     490 
     491/** 
     492 *Move Message Failure 
     493 * 
     494 *@author Cassiano Dal Pizzol [cassiano.dalpizzol@serpro.gov.br] 
     495 * 
     496 */ 
     497MailArchiver.prototype.moveMessagesOperationFailure = function(error_message){ 
     498    if(expresso_mail_archive.message_list.length > 1){ 
     499        write_msg(get_lang("Error deleting messages.") + ' ' + error_message.getReturn()); 
     500    }else{ 
     501        write_msg(get_lang("Error deleting message.") + ' ' + error_message.getReturn()); 
     502    }  
     503} 
     504 
    382505 
    383506//getFolderList Operation 
     
    666789    //window.alert('em toExpressoFrom com data = \n' + data + '[' + typeof(data) + ']('+data.length+')'); 
    667790    var Fromdata = eval("(" + data + ")"); 
    668     var dataName = Fromdata.mailbox.name.$; 
    669     var dataEmail = Fromdata.mailbox.localPart.$ + '@' + Fromdata.mailbox.domain.$; 
     791    var dataName = Fromdata.mailbox["@name"]; 
     792    var dataEmail = Fromdata.mailbox["@localPart"] + '@' + Fromdata.mailbox["@domain"]; 
    670793    //window.alert('name = ' + Fromdata.mailbox.name.$ + '\nlocal part = ' + Fromdata.mailbox.localPart.$ + '\ndomain = ' + Fromdata.mailbox.domain.$); 
    671794        
Note: See TracChangeset for help on using the changeset viewer.