Changeset 4851


Ignore:
Timestamp:
07/25/11 08:33:04 (13 years ago)
Author:
rafaelraymundo
Message:

Ticket #2117 - Filtro fora do escritório não preserva formatação

Location:
branches/2.3/expressoMail1_2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/expressoMail1_2/inc/class.ScriptS.inc.php

    r4641 r4851  
    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); 
  • branches/2.3/expressoMail1_2/js/common_functions.js

    r4782 r4851  
    709709        } 
    710710    } 
     711     
    711712    return strEncode; 
    712713} 
    713714 
    714715function url_decode(str) { 
    715  
    716716        var n, strCode, strDecode = ""; 
    717717        for (n = 0; n < str.length; n++) { 
     
    724724            //    strDecode += str.charAt(n); 
    725725            //} 
     726        } 
     727        return strDecode; 
     728} 
     729 
     730function url_decode_s(str) { 
     731        var n, strCode, strDecode = ""; 
     732        for (n = 0; n < str.length; n++) { 
     733            if (str.charAt(n) == "%") { 
     734                strCode = str.charAt(n + 1) + str.charAt(n + 2); 
     735                strDecode += String.fromCharCode(parseInt(strCode, 16)); 
     736                n += 2; 
     737            } else { 
     738                strDecode += str.charAt(n); 
     739            } 
    726740        } 
    727741        return strDecode; 
  • branches/2.3/expressoMail1_2/js/filter.js

    r4770 r4851  
    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);   
     
    407411        var createFilter = function (param){  
    408412                if (filter.criticalError){  
    409                         alert(get_lang('The filters service is out of service, try again later...'));  
     413                        alert(get_lang('The filters service is out of service, try again later...')); 
    410414                        return false;  
    411415                }  
     
    454458         
    455459        cfilter.prototype.delete_r = function(){ 
    456          
    457460                // rule 
    458461                var _this = this; 
     
    485488                                //Save outoffice in prefs: 
    486489                                connector.loadScript("preferences"); 
    487                                 if(typeof(prefe) == 'undefined') 
     490                                if(typeof(prefe) == 'undefined'){ 
    488491                                        setTimeout("filter.delete_r();",500); 
     492                                } 
    489493                                else 
    490494                                        prefe.save("outoffice", _this.out_officeF); 
     
    513517                                _this.rulesVoip[i] = aux; 
    514518                        } 
    515                 }  
    516  
    517                 _this.reload_rules(); 
     519                } 
     520                 
     521                _this.reload_rules() 
    518522        } 
    519523         
     
    824828        } 
    825829 
     830    connector.loadScript("preferences"); 
    826831// build object 
    827832   var filter; 
  • branches/2.3/expressoMail1_2/js/filters.js

    r4576 r4851  
    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.