Changeset 4576


Ignore:
Timestamp:
06/02/11 14:59:41 (13 years ago)
Author:
rafaelraymundo
Message:

Ticket #1726 - Criacao de filtros para utilizar o tamanho da mensagem. r4552

Location:
branches/2.2.0.1/expressoMail1_2
Files:
2 edited

Legend:

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

    r4551 r4576  
    3535        $this->username = $this->scriptfile; 
    3636 
    37         $this->reply = ""; 
    38         $this->rules = ""; 
    39         $this->errstr = ""; 
    40         $this->size = ""; 
     37        $this->reply    = ""; 
     38        $this->rules    = ""; 
     39        $this->errstr   = ""; 
     40        $this->size     = ""; 
    4141 
    4242        $this->continuebit  = 1; 
    43         $this->sizebit      = 1; 
     43        $this->sizebit      = 2; 
    4444        $this->anyofbit     = 4; 
    4545        $this->keepbit      = 8; 
     
    254254        $continue = 1; 
    255255        $tmpSubject = ""; 
     256 
     257        $a = 0; 
     258 
    256259 
    257260        // Recebe os valores das regras; 
     
    278281            $rule['unconditional'] = 0; 
    279282 
     283            if( $a < 2 ) 
     284            { 
     285                error_log( print_r($tmp, true), 3, "/tmp/log" ); 
     286 
     287                error_log( print_r($rule, true), 3, "/tmp/log" ); 
     288 
     289                $a++; 
     290            } 
     291 
     292 
    280293            if (!$rule['from'] && !$rule['to'] && !$rule['subject'] && !$rule['field'] && empty($rule['size']) && $rule['action']) { 
    281294                $rule['unconditional'] = 1; 
     
    370383                    if ($rule['size'] != '') 
    371384                    { 
    372                         if ($rule['size'] == 0 && $rule['gthan']) 
     385                        if ( $rule['size'] == 0 && $rule['gthan'] ) 
    373386                        { 
    374387                            $xthan = " :over "; 
     
    381394                        } 
    382395 
    383                         if ($rule['size'] > 0) { 
     396                        if ( $rule['size'] > 0 ) 
     397                        { 
    384398                            $xthan = " :under "; 
     399 
    385400                            if ($rule['gthan']) 
    386401                                $xthan = " :over "; 
     
    427442                    $newruletext .= "discard;"; 
    428443                } 
    429                 if ($rule['keep']) 
     444 
     445                if ($rule['keep'] ) 
     446                { 
    430447                    $newruletext .= "\n\tfileinto \"INBOX\";"; 
    431                 //if ($rule['keep']) $newruletext .= "\n\tkeep;";                
     448                } 
     449 
    432450                if (!$rule['unconditional']) 
     451                { 
    433452                    $newruletext .= "\n}"; 
     453                } 
    434454 
    435455                $continue = 0; 
  • branches/2.2.0.1/expressoMail1_2/js/filters.js

    r4531 r4576  
    149149        var fields = rule.split("&&"); 
    150150        if(type == 'voip') 
     151        { 
    151152                return " <a href='javascript:void(0)' onclick=filter.form_r('"+pos+"','voip')><b>" + get_lang("Status") + " : </b>" + "<font color='red'>" + get_lang(fields[2]) + "</font>" + " - " + fields[3] + " <b>" + get_lang("Subject") + ":</b> " + fields[5] + "</a>"; 
    152         else{  
     153        } 
     154        else 
     155        { 
    153156                var _criteria = " ";  
    154157                if (fields[3].length > 0)  
     
    158161                if (fields[5].length > 0)  
    159162                        _criteria += "<b>&nbsp;"+get_lang("subject is")+"</b>:"+fields[5];  
    160                 if (parseInt(fields[11]) >= 0) 
    161                 {  
    162                         if(fields[8] == "1") 
    163                                 _criteria += "<b>&nbsp;"+get_lang("size is over than")+"</b>:"+fields[11];  
    164                         else if(fields[8] != "0") 
    165                                 _criteria += "<b>&nbsp;"+get_lang("size is under than")+"</b>:"+fields[11];  
    166                 }  
     163                if ( parseInt( fields[11] ) > 0 ) 
     164                { 
     165                    if( fields[8] == "2" || fields[8] == "10" ) 
     166                        _criteria += "<b>&nbsp;"+get_lang("size is over than")+"</b>:"+fields[11]; 
     167 
     168                    if( fields[8] == "0" || fields[8] == "8" ) 
     169                        _criteria += "<b>&nbsp;"+get_lang("size is under than")+"</b>:"+fields[11]; 
     170                } 
     171 
    167172                var _action = " ";  
    168173                if (fields[6] == 'folder')  
     
    179184} 
    180185         
    181         cfilterSh.prototype.vl_outOffice = function(outOffice){          
     186        cfilterSh.prototype.vl_outOffice = function(outOffice) 
     187        { 
    182188                var aux = outOffice.split("&&"); 
    183189                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>"; 
Note: See TracChangeset for help on using the changeset viewer.