Changeset 95


Ignore:
Timestamp:
11/08/07 15:57:16 (16 years ago)
Author:
niltonneto
Message:

Implementada funcionalidade na busca rápida no Catálogo Geral.
Quando o limite de resultados é excedido, o retorno da busca traz somente os usuários da mesma organização do usuário logado.

Location:
trunk/expressoMail1_2
Files:
3 edited

Legend:

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

    r72 r95  
    2929        function quicksearch($params) 
    3030        {        
     31                include_once("class.functions.inc.php"); 
     32                $functions = new functions;                                              
    3133                 
    3234                $search_for     = $params['search_for']; 
     
    5456                         
    5557                        $sr=ldap_search($this->ds, $this->ldap_context, $filter, $justthese); 
    56                          
     58                        $count_entries = ldap_count_entries($this->ds,$sr); 
     59                         
     60                        if ($count_entries > 200) 
     61                        { 
     62                                $user_dn = $_SESSION['phpgw_info']['expressomail']['user']['account_dn']; 
     63                                $user_sector_dn = ldap_explode_dn ( $user_dn, false ); 
     64                                array_shift($user_sector_dn); 
     65                                array_shift($user_sector_dn); 
     66                                $user_sector_dn = implode(",", $user_sector_dn); 
     67                                 
     68                                // New search only on user sector 
     69                                $sr=ldap_search($this->ds, $user_sector_dn, $filter, $justthese); 
    5770                        $count_entries = ldap_count_entries($this->ds,$sr); 
    5871                        if ($count_entries > 200){ 
     
    6174                                $return['error'] = "many results"; 
    6275                                return $return; 
     76                        } 
     77                                else 
     78                                { 
     79                                        $quickSearch_only_in_userSector = true; 
     80                                } 
    6381                        } 
    6482                        $info = ldap_get_entries($this->ds, $sr); 
     
    83101                                        $i++; 
    84102                                } 
     103                                $contacts_result['quickSearch_only_in_userSector'] = $quickSearch_only_in_userSector; 
    85104                        } 
    86105                        else 
    87106                        { 
    88107                                $options = ''; 
    89                                 include_once("class.functions.inc.php"); 
    90                                 $functions = new functions;                                              
    91108                                 
    92109                                foreach ($tmp as $info => $cn) 
     
    130147                                } 
    131148                                $contacts_result = $options; 
    132                         } 
     149                                 
     150                                if ($quickSearch_only_in_userSector) 
     151                                { 
     152                                        $head_option = 
     153                                                '<tr class="quicksearchcontacts_unselected">' . 
     154                                                        '<td colspan="2" width="100%" align="center">' . 
     155                                                                $functions->getLang('More than 200 results were found') . '.<br>' . 
     156                                                                $functions->getLang('Showing only the results found in your organization') . '.'; 
     157                                                        '</td>' . 
     158                                                '</tr>'; 
     159                                        $contacts_result = $head_option . $contacts_result; 
     160                        } 
     161                } 
    133162                } 
    134163                ldap_close($this->ds); 
  • trunk/expressoMail1_2/js/QuickCatalogSearch.js

    r53 r95  
    1111                _this = this; 
    1212 
    13                 var title = 'Escolha um nome:'; 
     13                var title = get_lang('Choose a name') + ':'; 
    1414                var el = document.createElement("DIV"); 
    1515                el.style.visibility = "hidden"; 
     
    2323                el.innerHTML = ""; 
    2424                 
    25                 el.innerHTML = "&nbsp;&nbsp;<b><font color='BLUE' nowrap>"+title+"</font></b>"+ 
    26                 "&nbsp;&nbsp;<br><u></u>&nbsp;&nbsp;"; 
     25                if (data.quickSearch_only_in_userSector) 
     26                        title += "<font color='BLACK' nowrap> ("+get_lang('Showing only the results found in your organization')+".)</font>" 
     27                 
     28                el.innerHTML = "&nbsp;&nbsp;<b><font color='BLUE' nowrap>"+title+"</font></b><br>&nbsp;&nbsp;"; 
    2729                 
    2830                if (document.getElementById('select_QuickCatalogSearch') == null){ 
     
    139141                if(! this.arrayWin[div.id]) { 
    140142                        div.style.width = "600px"; 
    141                         div.style.height = "250px"; 
     143                        div.style.height = "230px"; 
    142144                        var title = get_lang('The results were found in the Global Catalog')+':'; 
    143145                        var wHeight = div.offsetHeight + "px"; 
  • trunk/expressoMail1_2/js/QuickSearchUser.js

    r64 r95  
    7777 
    7878        emQuickSearchUser.prototype.close_window = function() { 
     79                Element("em_message_search").value = ""; 
    7980                this.arrayWin['window_QuickSearchUser'].close(); 
    8081        } 
Note: See TracChangeset for help on using the changeset viewer.