Ignore:
Timestamp:
02/03/10 18:48:58 (15 years ago)
Author:
eduardoalex
Message:

Ticket #785 - Replicando no branch a correcao feita no trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.1/expressoMail1_2/js/local_messages.js

    r1939 r1970  
    310310 
    311311        } 
     312        /** 
     313         * check if ID is no from main tab, if it's from main returns false, else  
     314         * returns an array with all string in position 0, the mail id in position 1  
     315         * and the part of string relative to tab in position 2 
     316         * @param {Object} id_mail 
     317         */ 
     318        local_messages.prototype.parse_id_mail = function(id_mail) {  
     319                if (this.isInt(id_mail)) 
     320                        return false; 
     321                 
     322                var matches = id_mail.match(/(.+)(_[a-zA-Z0-9]+)/); 
     323                return matches; 
     324        } 
     325         
     326        local_messages.prototype.isInt = function(x) { 
     327                var y=parseInt(x); 
     328                if (isNaN(y)) return false; 
     329                return x==y && x.toString()==y.toString(); 
     330        } 
    312331         
    313332        local_messages.prototype.get_local_mail = function(id_mail) { 
    314333                this.init_local_messages(); 
     334 
     335                var plus_id = ''; 
     336                var matches = ''; 
     337                if(matches = this.parse_id_mail(id_mail)) { //Mails coming from other tab. 
     338                        id_mail = matches[1]; 
     339                        plus_id = matches[2]; 
     340                } 
     341                 
    315342                var rs = this.dbGears.execute("select mail.rowid,mail.mail,mail.ffrom,mail.subject,mail.body,mail.fto,mail.cc,folder.folder,mail.original_id from mail inner join folder on mail.id_folder=folder.rowid  where mail.rowid="+id_mail); 
    316343                var retorno = null; 
     
    324351        if (typeof(retorno.source) == 'string') 
    325352        { 
    326             retorno.msg_number=rs.field(0); 
     353            retorno.msg_number=rs.field(0)+plus_id; 
    327354            retorno.original_ID=rs.field(8); 
    328355            retorno.msg_folder=rs.field(7); 
     
    367394            retorno['local_message'] = true; 
    368395            retorno['msg_folder'] = "local_"+rs.field(7); //Now it's a local folder 
    369             retorno['msg_number'] = rs.field(0); //the message number is the rowid 
     396            retorno['msg_number'] = rs.field(0)+plus_id; //the message number is the rowid 
    370397 
    371398        } 
     
    490517        local_messages.prototype.get_url_anexo = function(msg_number,pid) { 
    491518                this.init_local_messages(); 
    492  
     519                var matches = ''; 
     520                if(matches = this.parse_id_mail(msg_number)) { 
     521                        msg_number = matches[1]; 
     522                } 
     523                 
    493524                var retorno; 
    494525                var rs = this.dbGears.execute("select url from anexo where id_mail="+msg_number+" and pid = '"+pid+"'"); 
     
    574605                for (var i in msgs_to_set) { 
    575606                 
     607                        var matches = '';//Messages comming from other tabs. 
     608                        if(matches = this.parse_id_mail(msgs_to_set[i])) {  
     609                                msgs_to_set[i] = matches[1]; 
     610                        } 
     611                                         
    576612                        var rs = this.dbGears.execute("select header,unseen from mail where rowid=" + msgs_to_set[i]); 
    577613                        header = connector.unserialize(rs.field(0)); 
Note: See TracChangeset for help on using the changeset viewer.