Changeset 4855 for trunk/expressoMail1_2


Ignore:
Timestamp:
07/25/11 11:12:53 (13 years ago)
Author:
roberto.santosjunior
Message:

Ticket #1820 - Filtro fora do escritório não preserva formatação.r4851

Location:
trunk/expressoMail1_2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.ScriptS.inc.php

    r4789 r4855  
    507507        // Lê as regras fora do escritório; 
    508508        if ($this->newout != "") { 
    509             $newscriptfoot .= preg_replace("/[\\n\\r]/", " ", $this->newout) . "\n"; 
     509            $newscriptfoot .= preg_replace("/[\\n\\r]/", "%0A", $this->newout) . "\n"; 
    510510        } 
    511511        $newscriptfoot .= "#mode&&basic\n"; 
    512512 
    513513        $newscript = $newscripthead . $newscriptbody . $newscriptfoot; 
    514  
    515514        // Destroi as variaveis; 
    516515        unset($rule); 
  • trunk/expressoMail1_2/js/common_functions.js

    r4843 r4855  
    715715        } 
    716716    } 
     717     
    717718    return strEncode; 
    718719} 
    719720 
    720721function url_decode(str) { 
    721  
    722722        var n, strCode, strDecode = ""; 
    723723        for (n = 0; n < str.length; n++) { 
     
    730730            //    strDecode += str.charAt(n); 
    731731            //} 
     732        } 
     733        return strDecode; 
     734} 
     735 
     736function url_decode_s(str) { 
     737        var n, strCode, strDecode = ""; 
     738        for (n = 0; n < str.length; n++) { 
     739            if (str.charAt(n) == "%") { 
     740                strCode = str.charAt(n + 1) + str.charAt(n + 2); 
     741                strDecode += String.fromCharCode(parseInt(strCode, 16)); 
     742                n += 2; 
     743            } else { 
     744                strDecode += str.charAt(n); 
     745            } 
    732746        } 
    733747        return strDecode; 
  • trunk/expressoMail1_2/js/filter.js

    r4841 r4855  
    4646                var cont1 = parseInt(0); 
    4747                var cont2 = parseInt(0); 
    48          
     48 
    4949                if( _this.rulest.length == 0 ) 
    5050                { 
    5151                        var handler_sieve = function(data) 
    5252                        { 
    53                                 if (data.toString().indexOf('Error:') == 0)  
    54                                 { 
     53                                if(data.toString().indexOf('Error:') == 0)  
     54                                { 
     55 
    5556                                        _this.criticalError = true; 
    5657                                        alert(get_lang('The filters service is out of service, try again later...')); 
     
    6869                                        } 
    6970                                } 
    70                                 _this.out_officeR = data.vacation[0]; 
    71                                 _this.out_officeR = _this.out_officeR ? trim(_this.out_officeR.toString().replace("\n","")) : ""; 
    72                                 if(data.mode.length > 0){_this.mode_in = data.mode[0];} 
     71                                if(typeof(data.vacation[0]) == 'undefined'){ 
     72                                    _this.out_officeR = ""; 
     73                                } 
     74                                else 
     75                                    _this.out_officeR = url_decode_s(data.vacation[0]); 
    7376                                } 
    7477                                catch(e){ 
    7578                                        _this.criticalError = true; 
    76                                         alert(get_lang('The filters service is out of service, try again later...')); 
    77                                 } 
     79                                        alert(get_lang('==> The filters service is out of service, try again later...')); 
     80                                } 
     81                                if(data.mode.length > 0){_this.mode_in = data.mode[0];} 
    7882                                if (typeof(posHandler) == 'function')   
    7983                                        posHandler(param);   
     
    320324                                                "</tr><tr><td colspan='2'><hr size='1' width='100%'><b>"+get_lang("Action")+":</b></td></tr>"+ 
    321325                                                "</table><table id='table_rule1' border='0' cellpading='0' cellspacing='0' width='100%'>"+ 
    322                                                  "<tr><td colspan='2'><input type='checkBox' id='checkBox2' onclick='filter.disable_radio();' name='checkb'>"+get_lang('Keep a copy of the message at your Inbox')+ "</td><tr>"+ 
    323                                                  "<tr><td width='50%'><input type='radio' id='radio1' name='radio' value='folder'>"+get_lang('Store at')+".:</td>"+ 
     326                                                "<tr><td colspan='2'><input type='checkBox' id='checkBox2' onclick='filter.disable_radio();' name='checkb'>"+get_lang('Keep a copy of the message at your Inbox')+ "</td><tr>"+ 
     327                                                "<tr><td width='50%'><input type='radio' id='radio1' name='radio' value='folder'>"+get_lang('Store at')+".:</td>"+ 
    324328                                                "<td width='50%'><select id='select_mailboxes' name='select_mailboxes'></select></td>"+ 
    325329                                                "</tr><tr><td width='50%'><input type='radio' id='radio2' name='radio' value='address'>"+get_lang('Forward to the address')+".:</td>"+ 
     
    406410        var createFilter = function (param){  
    407411                if (filter.criticalError){  
    408                         alert(get_lang('The filters service is out of service, try again later...'));  
     412                        alert(get_lang('The filters service is out of service, try again later...')); 
    409413                        return false;  
    410414                }  
     
    453457         
    454458        cfilter.prototype.delete_r = function(){ 
    455          
    456459                // rule 
    457460                var _this = this; 
     
    483486                                _this.out_officeF = false; 
    484487                                //Save outoffice in prefs: 
    485                                 connector.loadScript("preferences");  
    486                 if(typeof(prefe) == 'undefined')  
    487                         setTimeout("filter.delete_r();",500);  
    488                 else  
    489                         prefe.save("outoffice", _this.out_officeF); 
     488                                connector.loadScript("preferences"); 
     489                                if(typeof(prefe) == 'undefined'){ 
     490                                        setTimeout("filter.delete_r();",500); 
     491                                } 
     492                                else 
     493                                        prefe.save("outoffice", _this.out_officeF); 
    490494                        } 
    491495                } 
     
    512516                                _this.rulesVoip[i] = aux; 
    513517                        } 
    514                 }  
    515  
     518                } 
     519                 
    516520                _this.reload_rules(); 
    517521        } 
     
    820824        } 
    821825 
     826    connector.loadScript("preferences"); 
    822827// build object 
    823828   var filter; 
  • trunk/expressoMail1_2/js/filters.js

    r4735 r4855  
    187187        { 
    188188                var aux = outOffice.split("&&"); 
    189                 return get_lang("Rule") + " - <a href='javascript:void(0)' onclick=filter.form_out()> " + "<b>" + get_lang("Status") + " : </b><font color='red'>" + (aux[4] == "off" ? get_lang("Disabled") : get_lang("Enabled")) + "</font></a>"; 
     189                return get_lang("Rule") + " - <a href='javascript:void(0)' onclick=filter.form_out()> " + "<b>" + get_lang("Status") + " : </b><font color='red'>" + (aux[4].replace("\n","") === "off" ? get_lang("Disabled") : get_lang("Enabled")) + "</font></a>"; 
    190190        } 
    191191         
Note: See TracChangeset for help on using the changeset viewer.