Changeset 1970


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

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

Location:
branches/2.1/expressoMail1_2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/2.1/expressoMail1_2/inc/class.imap_functions.inc.php

    r1953 r1970  
    450450                $return = array(); 
    451451                $msg_number = $params['msg_number']; 
     452                if(preg_match('(.+)(_[a-zA-Z0-9]+)',$msg_number,$matches)) { //Verifies if it comes from a tab diferent of the main one.  
     453                        $msg_number = $matches[1];  
     454                        $plus_id = $matches[2];  
     455                }  
     456                else {  
     457                        $plus_id = '';  
     458                } 
    452459                $msg_folder = urldecode($params['msg_folder']); 
    453460 
     
    506513                } 
    507514 
    508                 $return['msg_number'] = $msg_number; 
     515                $return['msg_number'] = $msg_number.$plus_id; 
    509516                $return['msg_folder'] = $msg_folder; 
    510517 
  • branches/2.1/expressoMail1_2/js/draw_api.js

    r1938 r1970  
    11241124                currentTab = ID; 
    11251125                openTab.type[ID] = 2; 
    1126                             proxy_mensagens.get_msg(parseInt(folder.nextSibling.id),nextMsgBox,true,show_msg); 
     1126                            proxy_mensagens.get_msg(folder.nextSibling.id,nextMsgBox,true,show_msg); 
    11271127                //cExecute("$this.imap_functions.get_info_msg&msg_number="+folder.nextSibling.id+"&msg_folder="+nextMsgBox, show_msg); 
    11281128            }; 
     
    11801180                openTab.type[ID] = 2; 
    11811181                //cExecute("$this.imap_functions.get_info_msg&msg_number="+folder.previousSibling.id+"&msg_folder=" + previousMsgBox, show_msg); 
    1182                             proxy_mensagens.get_msg(parseInt(folder.previousSibling.id),previousMsgBox,true,show_msg); 
     1182                            proxy_mensagens.get_msg(folder.previousSibling.id,previousMsgBox,true,show_msg); 
    11831183            }; 
    11841184        } 
  • branches/2.1/expressoMail1_2/js/globals.js

    r1526 r1970  
    2020var tree_folders = ''; 
    2121var folders = new Array(); 
     22var global_search = 1; 
    2223var title_app_menu = '<table height="16px" align=center border=0 width=100% cellspacing=0 cellpadding=2>'+ 
    2324        '<tr><td align=left height=16px width="1%" nowrap class="table_top">&nbsp;'+ 
  • 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)); 
  • branches/2.1/expressoMail1_2/js/main.js

    r1953 r1970  
    595595                                } 
    596596                                trfolder = (tr.getAttribute('name') == null?get_current_folder():tr.getAttribute('name')); 
    597                                 selected_param += ','+trfolder+';'+tr.id; 
     597                                selected_param += ','+trfolder+';'+tr.id.replace(/_[a-zA-Z0-9]+/,""); 
    598598                        } 
    599599                } 
     
    607607                        } 
    608608                        trfolder = (tr.getAttribute('name') == null?get_current_folder():tr.getAttribute('name')); 
    609                         selected_param=trfolder+';'+tr.id; 
     609                        selected_param=trfolder+';'+tr.id.replace(/_[a-zA-Z0-9]+/,""); 
    610610                } 
    611611                var params = ""; 
  • branches/2.1/expressoMail1_2/js/search.js

    r1747 r1970  
    410410                        var uid_msg = aux[6]; 
    411411                        var subject = aux[2]; 
    412                         tr.id = uid_msg; 
     412                        tr.id = uid_msg+"_s"+global_search; 
    413413 
    414414                        // Keep the two lines together please 
     
    545545                tbody.appendChild(tr); 
    546546                } 
     547                global_search++; //Tabs from search must not have the same id on its tr's  
    547548                table.appendChild(tbody); 
    548549 
Note: See TracChangeset for help on using the changeset viewer.