Changeset 3676


Ignore:
Timestamp:
01/10/11 16:46:43 (13 years ago)
Author:
niltonneto
Message:

Ticket #785 - Corrigido problema da navegação anterior/próximo no resultado da busca.

Location:
branches/2.0/expressoMail1_2
Files:
6 edited

Legend:

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

    r3547 r3676  
    420420                $return = array(); 
    421421                $msg_number = $params['msg_number']; 
     422                if(preg_match('(.+)(_[a-zA-Z0-9]+)',$msg_number,$matches)) { //Verifies if it comes from a tab diferent of the main one. 
     423                        $msg_number = $matches[1]; 
     424                        $plus_id = $matches[2]; 
     425                } 
     426                else { 
     427                        $plus_id = ''; 
     428                } 
    422429                $msg_folder = urldecode($params['msg_folder']); 
    423430                 
     
    476483                } 
    477484 
    478                 $return['msg_number'] = $msg_number; 
     485                $return['msg_number'] = $msg_number.$plus_id; 
    479486                $return['msg_folder'] = $msg_folder; 
    480487         
  • branches/2.0/expressoMail1_2/js/draw_api.js

    r3522 r3676  
    10281028                currentTab = ID; 
    10291029                openTab.type[ID] = 2; 
    1030                             proxy_mensagens.get_msg(parseInt(folder.nextSibling.id),nextMsgBox,true,show_msg); 
     1030                            proxy_mensagens.get_msg(folder.nextSibling.id,nextMsgBox,true,show_msg); 
    10311031                //cExecute("$this.imap_functions.get_info_msg&msg_number="+folder.nextSibling.id+"&msg_folder="+nextMsgBox, show_msg); 
    10321032            }; 
     
    10841084                openTab.type[ID] = 2; 
    10851085                //cExecute("$this.imap_functions.get_info_msg&msg_number="+folder.previousSibling.id+"&msg_folder=" + previousMsgBox, show_msg); 
    1086                             proxy_mensagens.get_msg(parseInt(folder.previousSibling.id),previousMsgBox,true,show_msg); 
     1086                            proxy_mensagens.get_msg(folder.previousSibling.id,previousMsgBox,true,show_msg); 
    10871087            }; 
    10881088        } 
  • branches/2.0/expressoMail1_2/js/globals.js

    r1402 r3676  
    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.0/expressoMail1_2/js/local_messages.js

    r1381 r3676  
    130130        } 
    131131         
     132        /** 
     133         * check if ID is no from main tab, if it's from main returns false, else  
     134         * returns an array with all string in position 0, the mail id in position 1  
     135         * and the part of string relative to tab in position 2 
     136         * @param {Object} id_mail 
     137         */ 
     138        local_messages.prototype.parse_id_mail = function(id_mail) {  
     139                if (this.isInt(id_mail)) 
     140                        return false; 
     141                 
     142                var matches = id_mail.match(/(.+)(_[a-zA-Z0-9]+)/); 
     143                return matches; 
     144        } 
     145         
     146        local_messages.prototype.isInt = function(x) { 
     147                var y=parseInt(x); 
     148                if (isNaN(y)) return false; 
     149                return x==y && x.toString()==y.toString(); 
     150        }  
     151         
    132152        local_messages.prototype.get_local_mail = function(id_mail) { 
    133153                this.init_local_messages(); 
     154 
     155                var plus_id = ''; 
     156                var matches = ''; 
     157                if(matches = this.parse_id_mail(id_mail)) { //Mails coming from other tab. 
     158                        id_mail = matches[1]; 
     159                        plus_id = matches[2]; 
     160                } 
     161 
    134162                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); 
    135163                var retorno = null; 
     
    143171        if (typeof(retorno.source) == 'string') 
    144172        { 
    145             retorno.msg_number=rs.field(0); 
     173            retorno.msg_number=rs.field(0)+plus_id; 
    146174            retorno.original_ID=rs.field(8); 
    147175            retorno.msg_folder=rs.field(7); 
     
    186214            retorno['local_message'] = true; 
    187215            retorno['msg_folder'] = "local_"+rs.field(7); //Now it's a local folder 
    188             retorno['msg_number'] = rs.field(0); //the message number is the rowid 
     216            retorno['msg_number'] = rs.field(0)+plus_id; //the message number is the rowid 
    189217 
    190218        } 
     
    289317        local_messages.prototype.get_url_anexo = function(msg_number,pid) { 
    290318                this.init_local_messages(); 
    291  
     319                var matches = ''; 
     320                if(matches = this.parse_id_mail(msg_number)) { 
     321                        msg_number = matches[1]; 
     322                } 
    292323                var retorno; 
    293324                var rs = this.dbGears.execute("select url from anexo where id_mail="+msg_number+" and pid = '"+pid+"'"); 
     
    372403                } 
    373404                for (var i in msgs_to_set) { 
    374                  
     405                         
     406                        var matches = '';//Messages comming from other tabs. 
     407                        if(matches = this.parse_id_mail(msgs_to_set[i])) {  
     408                                msgs_to_set[i] = matches[1]; 
     409                        } 
     410                         
    375411                        var rs = this.dbGears.execute("select header,unseen from mail where rowid=" + msgs_to_set[i]); 
    376412                        header = connector.unserialize(rs.field(0)); 
  • branches/2.0/expressoMail1_2/js/main.js

    r3522 r3676  
    582582                                } 
    583583                                trfolder = (tr.getAttribute('name') == null?get_current_folder():tr.getAttribute('name')); 
    584                                 selected_param += ','+trfolder+';'+tr.id; 
     584                                selected_param += ','+trfolder+';'+tr.id.replace(/_[a-zA-Z0-9]+/,""); 
    585585                        } 
    586586                } 
     
    594594                        } 
    595595                        trfolder = (tr.getAttribute('name') == null?get_current_folder():tr.getAttribute('name')); 
    596                         selected_param=trfolder+';'+tr.id; 
     596                        selected_param=trfolder+';'+tr.id.replace(/_[a-zA-Z0-9]+/,""); 
    597597                } 
    598598                var params = ""; 
  • branches/2.0/expressoMail1_2/js/search.js

    r2780 r3676  
    221221                        var uid_msg = aux.uid; 
    222222                        var subject = aux.subject; 
    223                         tr.id = uid_msg; 
     223                        tr.id = uid_msg+"_s"+global_search; 
    224224 
    225225                        // Keep the two lines together please 
     
    354354                tbody.appendChild(tr); 
    355355                } 
     356                global_search++; //Tabs from search must not have the same id on its tr's 
    356357                table.appendChild(tbody); 
    357358 
Note: See TracChangeset for help on using the changeset viewer.