Changeset 1608


Ignore:
Timestamp:
11/09/09 16:05:50 (14 years ago)
Author:
rafaelraymundo
Message:

Ticket #700 - Adiciona a preferência: selecionar número de resultados na pesquisa de email.

Location:
trunk/expressoMail1_2
Files:
4 edited

Legend:

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

    r1586 r1608  
    29672967                if($search){ 
    29682968                        $search_criteria = ''; 
     2969                        $search_result_number = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['search_result_number']; 
     2970                        $acumulated_results = 0; 
    29692971                        foreach($search as $tmp) 
    29702972                        { 
    29712973                                $tmp1 = explode("##",$tmp); 
    2972                                 $name_box = $tmp1[0]; 
     2974                                $name_box = $tmp1[0]; 
    29732975                                unset($filter); 
    29742976                                foreach($tmp1 as $index => $criteria) 
     
    29983000                                        imap_reopen($mbox_stream, "{".$this->imap_server.":".$this->imap_port.$this->imap_options."}".$name_box); 
    29993001 
     3002                                $sum = 0; 
    30003003                                if (preg_match("/^.?\bALL\b/", $filter)){ // Quick Search, note: this ALL isn't the same ALL from imap_search 
    30013004 
     
    30073010                                                $search_criteria = imap_search($mbox_stream, $_filter, SE_UID); 
    30083011 
    3009                                                 if($search_criteria && count($search_criteria) < 50) 
     3012                                                if($search_criteria) //&& count($search_criteria) < 50) 
    30103013                                                { 
    30113014                                                        foreach($search_criteria as $new_search){ 
    30123015                                                                $m_token = trim("##".mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--".$new_search."##"."\n"); 
    30133016                                                                if(!@strstr($retorno,$m_token)) 
    3014                                                                         $retorno .= $m_token; 
     3017                                                                { 
     3018                                                                    $retorno .= $m_token; 
     3019                                                                    $sum += 1; 
     3020                                                                } 
    30153021                                                        } 
    30163022                                                } 
    3017                                                 else if(count($search_criteria) >= 50) 
    3018                                                         return "many results"; 
    30193023                                        } 
    30203024                                } 
    30213025                                else { 
    3022                                         $search_criteria = imap_search($mbox_stream, $filter, SE_UID); 
    3023                                         if( is_array( $search_criteria) ) 
    3024                                         { 
    3025                                                 foreach($search_criteria as $new_search) 
    3026                                                         $retorno .= trim("##".mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--" . $new_search."##"."\n"); 
    3027                                         } 
    3028                                 } 
     3026                                    $search_criteria = imap_search($mbox_stream, $filter, SE_UID); 
     3027                                    if( is_array( $search_criteria) ) 
     3028                                    { 
     3029                                            foreach($search_criteria as $new_search) 
     3030                                                    $retorno .= trim("##".mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--" . $new_search."##"."\n"); 
     3031                                    } 
     3032                                    $sum += count($search_criteria); 
     3033                                } 
     3034 
     3035                                $acumulated_results += $sum; 
     3036 
     3037                                if ($search_result_number != '65536' && $acumulated_results >= $search_result_number) 
     3038                                { 
     3039                                    return "many results"; 
     3040                                } 
    30293041                        } 
    30303042                } 
  • trunk/expressoMail1_2/inc/hook_settings.inc.php

    r1605 r1608  
    153153        '40' => lang('big') 
    154154); 
     155 
     156$default =  array( 
     157    '50'    => '50', 
     158    '100'   => '100', 
     159    '150'   => '150', 
     160    '200'   => '200', 
     161    '300'   => '300', 
     162    '400'   => '400', 
     163    '65536' => lang('unlimited') 
     164); 
     165 
     166create_select_box('What is the maximum number of results in an e-mail search?','search_result_number',$default,''); 
    155167 
    156168create_select_box('What is the height of the lines in the list of messages?','line_height',$default,''); 
  • trunk/expressoMail1_2/index.php

    r1526 r1608  
    7070    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'] : "0"; 
    7171    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital'] : "0"; 
     72    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['search_result_number'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_result_number'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_result_number'] : "50"; 
    7273    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['num_max_certs_to_cipher'] = $GLOBALS['phpgw_info']['server']['num_max_certs_to_cipher'] ?  $GLOBALS['phpgw_info']['server']['num_max_certs_to_cipher'] : "10"; 
    7374    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] : "0"; 
  • trunk/expressoMail1_2/js/search.js

    r1604 r1608  
    789789                        } 
    790790                        if((data == "none") && (countTmp.length==0)){alert(get_lang("None result was found."));} 
    791                         else if(countTmp.length > 50){alert(get_lang("More than %1 results. Please, try to refine your search.",50));} 
    792                         else if(data == "many results"){alert(get_lang("More than %1 results. Please, try to refine your search.",50));} 
    793                         else{EsearchE.mount_result((data=='none')?tmp:(countTmp.length==0)?data:data+tmp);} 
     791                        if (preferences.search_result_number == '65536' || (data != 'many results' && countTmp.length < preferences.search_result_number)) 
     792                        { 
     793                            EsearchE.mount_result((data=='none')?tmp:(countTmp.length==0)?data:data+tmp); 
     794                        } 
     795                        else if (data == 'many results' || countTmp.length >= preferences.search_result_number) 
     796                        { 
     797                            alert(get_lang("More than %1 results. Please, try to refine your search.",preferences.search_result_number)); 
     798                        } 
    794799                } 
    795800                var args   = "$this.imap_functions.search_msg"; 
Note: See TracChangeset for help on using the changeset viewer.