Ignore:
Timestamp:
11/11/09 17:13:52 (14 years ago)
Author:
rafaelraymundo
Message:

Ticket #722 - Implementação da pesquisa avançada no expressoMail.

File:
1 edited

Legend:

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

    r1614 r1622  
    29552955        } 
    29562956 
     2957        function make_search_date($date){ 
     2958 
     2959            $months = array( 
     2960                1   => 'jan', 
     2961                2   => 'feb', 
     2962                3   => 'mar', 
     2963                4   => 'apr', 
     2964                5   => 'may', 
     2965                6   => 'jun', 
     2966                7   => 'jul', 
     2967                8   => 'aug', 
     2968                9   => 'sep', 
     2969                10  => 'oct', 
     2970                11  => 'nov', 
     2971                12  => 'dec' 
     2972            ); 
     2973 
     2974            //TODO: Adaptar a data de acordo com o locale do sistema. 
     2975            list($day,$month,$year) = explode("/", $date); 
     2976            $search_date = $day."-".$months[intval($month)]."-".$year; 
     2977            return $search_date; 
     2978 
     2979        } 
     2980 
    29572981        function search_msg($params = ''){ 
    29582982            $retorno = ""; 
     
    29803004                            $filter_array = explode("<=>",rawurldecode($criteria)); 
    29813005                            $filter .= " ".$filter_array[0]; 
    2982                             $filter .= '"'.$filter_array[1].'"'; 
     3006                            if (strlen($filter_array[1]) != 0){ 
     3007                                if (trim($filter_array[0]) != 'BEFORE' && 
     3008                                    trim($filter_array[0]) != 'SINCE' && 
     3009                                    trim($filter_array[0]) != 'ON') 
     3010                                { 
     3011                                    $filter .= '"'.$filter_array[1].'"'; 
     3012                                } 
     3013                                else 
     3014                                    { 
     3015                                        $filter .= '"'.$this->make_search_date($filter_array[1]).'"'; 
     3016                                    } 
     3017                            } 
    29833018                        } 
    29843019                    } 
Note: See TracChangeset for help on using the changeset viewer.