Changeset 342


Ignore:
Timestamp:
07/01/08 11:40:00 (16 years ago)
Author:
niltonneto
Message:

Algumas validações de condições nulas, para não gerar erro.
Otimizações para eliminar códigos duplicados.
Outros ajustes.

Location:
trunk/expressoMail1_2
Files:
2 edited

Legend:

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

    r325 r342  
    11<?php                    
    22include_once("class.imap_functions.inc.php"); 
     3include_once("class.functions.inc.php"); 
    34 
    45function ldapRebind($ldap_connection, $ldap_url) 
     
    1314        var $ldap_context; 
    1415        var $imap; 
    15          
    16         // usa o host e context do contact center. 
    17         function ldapConnect($refer = false,$catalogo = 0){ 
    18         include("../contactcenter/setup/external_catalogs.inc.php"); 
    19                 if ($catalogo == 0){ 
     16        var $external_srcs; 
     17        var $max_result; 
     18        var $functions; 
     19        function ldap_functions(){ 
     20        // todo: Page Configuration for External Catalogs. 
     21                @include("../contactcenter/setup/external_catalogs.inc.php"); 
     22                $this->external_srcs= $external_srcs; 
     23                $this->max_result       = 200;           
     24                $this->functions = new functions();              
     25        }        
     26        // Using ContactCenter configuration. 
     27        function ldapConnect($refer = false,$catalog = 0){ 
     28                if ($catalog > 0 && is_array($this->external_srcs)){ 
     29                        $this->ldap_host        = $this->external_srcs[$catalog]['host']; 
     30                        $this->ldap_context = $this->external_srcs[$catalog]['dn']; 
     31                        $this->bind_dn          = $this->external_srcs[$catalog]['acc']; 
     32                        $this->bind_dn_pw       = $this->external_srcs[$catalog]['pw']; 
     33                        $this->object_class = $this->external_srcs[$catalog]['obj']; 
     34                        $this->base_dn          = $this->external_srcs[$catalog]['dn']; 
     35                        $this->branch           = $this->external_srcs[$catalog]['branch']; 
     36                }else { 
    2037                        $this->ldap_host        = $_SESSION['phpgw_info']['expressomail']['ldap_server']['host']; 
    2138                        $this->ldap_context = $_SESSION['phpgw_info']['expressomail']['ldap_server']['dn']; 
    2239                        $this->bind_dn = $_SESSION['phpgw_info']['expressomail']['ldap_server']['acc']; 
    2340                        $this->bind_dn_pw = $_SESSION['phpgw_info']['expressomail']['ldap_server']['pw']; 
    24                         $this->branch = 'ou';                    
    25                 }else { 
    26                          
    27                         $this->ldap_host        =   $external_srcs[$catalogo]['host']; 
    28                         $this->ldap_context =   $external_srcs[$catalogo]['dn']; 
    29                         $this->bind_dn = $external_srcs[$catalogo]['acc']; 
    30                         $this->bind_dn_pw = $external_srcs[$catalogo]['pw']; 
    31                         $this->object_class = $external_srcs[$catalogo]['obj']; 
    32                         $this->base_dn = $external_srcs[$catalogo]['dn']; 
    33                         $this->branch = $external_srcs[$catalogo]['branch']; 
    34  
    35                 } 
     41                        $this->branch = 'ou';                            
     42                } 
     43                 
    3644                $this->ds = ldap_connect($this->ldap_host); 
    3745                ldap_set_option($this->ds, LDAP_OPT_PROTOCOL_VERSION, 3); 
    3846                ldap_set_option($this->ds, LDAP_OPT_REFERRALS, $refer); 
    39                 if ($refer){ 
     47                if ($refer)     { 
    4048                        ldap_set_rebind_proc($this->ds, ldapRebind); 
    4149                } 
    42                 @ldap_bind($this->ds,$this->bind_dn,$this->bind_dn_pw );                                 
    43                  
     50                @ldap_bind($this->ds,$this->bind_dn,$this->bind_dn_pw );                 
    4451        } 
    4552 
     
    7481        function quicksearch($params) 
    7582        {        
    76                 include_once("../contactcenter/setup/external_catalogs.inc.php"); 
    7783                include_once("class.functions.inc.php"); 
    7884                $functions = new functions;                                              
     
    102108                // follow the referral 
    103109                $this->ldapConnect(true); 
    104                  
     110                                 
    105111                if ($this->ds) 
    106                         { 
     112                { 
    107113                        if (($field != 'null') && ($ID != 'null')) 
    108                                 { 
     114                        { 
    109115                                $filter="(& (|(phpgwAccountType=u)(phpgwAccountType=l)) (|(cn=*$search_for*)(mail=*$search_for*)) (!(phpgwaccountvisible=-1)) )"; 
    110116                                $justthese = array("cn", "mail", "telephoneNumber", "mobile", "phpgwAccountVisible", "uid", "employeeNumber", "ou"); 
    111                                 } 
     117                        } 
    112118                        else 
    113                                 { 
     119                        { 
    114120                                $filter="(& (phpgwAccountType=u)(cn=*$search_for*) (!(phpgwaccountvisible=-1)) )"; 
    115                                 $justthese = array("cn", "mail", "telephoneNumber", "mobile", "phpgwAccountVisible", "jpegPhoto", "uid", "employeeNumber", "ou"); 
    116                                 } 
    117                         $sr=ldap_search($this->ds, $this->ldap_context, $filter, $justthese, 0, 201); 
     121                                $justthese = array("cn", "mail", "telephoneNumber", "mobile", "phpgwAccountVisible","jpegPhoto", "uid", "employeeNumber", "ou"); 
     122                        } 
     123                        $sr=@ldap_search($this->ds, $this->ldap_context, $filter, $justthese, 0, $this->max_result + 1); 
     124                        if(!$sr) 
     125                                return null; 
    118126                        $count_entries = ldap_count_entries($this->ds,$sr); 
    119                          
     127 
    120128                        // Get user org dn.                      
    121129                        $user_dn = $_SESSION['phpgw_info']['expressomail']['user']['account_dn']; 
     
    126134                         
    127135                        // New search only on user sector 
    128                         if ($count_entries > 200) 
    129                         { 
     136                        if ($count_entries > $this->max_result) 
     137                        { 
    130138                                // Close old ldap conection 
    131139                                ldap_close($this->ds); 
     
    134142                                $this->ldapRootConnect(true); 
    135143                                 
    136                                 $sr=ldap_search($this->ds, $user_sector_dn, $filter, $justthese, 0, 201); 
     144                                $sr= ldap_search($this->ds, $user_sector_dn, $filter, $justthese); 
     145                                if(!$sr) 
     146                                        return null; 
    137147                                $count_entries = ldap_count_entries($this->ds,$sr); 
    138148                                 
    139                                 if ($count_entries > 200){ 
     149                                if ($count_entries > $this->max_result){ 
    140150                                        $return = array(); 
    141151                                        $return['status'] = false; 
     
    154164                        $tmp_users_from_user_org = array(); 
    155165                         
    156                         if (!$quickSearch_only_in_userSector) 
    157                                 { 
    158                                 $catalogsNum=count($external_srcs); 
    159                                 for ($i=0; $i<=count($external_srcs); $i++) 
    160                                         { 
    161                                         if ($external_srcs[$i]["quicksearch"]) 
    162                                                 { 
     166                        if (!$quickSearch_only_in_userSector) { 
     167                                $catalogsNum=count($this->external_srcs); 
     168                                for ($i=0; $i<=count($this->external_srcs); $i++)       { 
     169                                        if ($this->external_srcs[$i]["quicksearch"]) { 
    163170                                                $this->ldapConnect(true,$i); 
    164171                                                $filter="(|(cn=*$search_for*)(mail=*$search_for*))"; 
    165                                                 $justthese = array("cn", "mail", "telephoneNumber", "mobile", "phpgwAccountVisible", "uid", "employeeNumber", "ou"); 
    166                                                 $sr=ldap_search($this->ds, $this->ldap_context, $filter, $justthese, 0, 201); 
     172                                                $justthese = array("cn", "mail", "telephoneNumber", "mobile", "phpgwAccountVisible", "uid","employeeNumber", "ou"); 
     173                                                $sr=@ldap_search($this->ds, $this->ldap_context, $filter, $justthese, 0, $this->max_result+1); 
     174                                                if(!$sr) 
     175                                                        return null; 
    167176                                                $count_entries = ldap_count_entries($this->ds,$sr); 
    168177                                                $search = ldap_get_entries($this->ds, $sr); 
    169                                                 for ($i=0; $i<$search["count"]; $i++) 
    170                                                         { 
     178                                                for ($i=0; $i<$search["count"]; $i++) { 
    171179                                                        $info[] = $search[$i]; 
    172                                                         } 
     180                                                } 
    173181                                                $info["count"] = count($info)-1; 
    174                                                 } 
    175182                                        } 
    176183                                } 
    177                          
     184                        } 
     185 
    178186                        for ($i=0; $i<$info["count"]; $i++) 
    179                                 { 
     187                        { 
    180188                                if ($quickSearch_only_in_userSector) 
     189                                { 
     190                                        $tmp[$info[$i]["mail"][0] . '%' . $info[$i]["telephonenumber"][0] . '%'. $info[$i]["mobile"][0] . '%' . $info[$i]["uid"][0] . '%' . $info[$i]["jpegphoto"]['count'] . '%' . $info[$i]["employeenumber"][0] . '%' . $info[$i]["ou"][0]] = utf8_decode($info[$i]["cn"][0]); 
     191                                } 
     192                                else 
     193                                { 
     194                                        if (preg_match("/$user_sector_dn/i", $info[$i]['dn'])) 
    181195                                        { 
    182                                         $tmp[$info[$i]["mail"][0] . '%' . $info[$i]["telephonenumber"][0] . '%'. $info[$i]["mobile"][0] . '%' . $info[$i]["uid"][0] . '%' . $info[$i]["jpegphoto"]['count'] . '%' . $info[$i]["employeenumber"][0] . '%' . $info[$i]["ou"][0]] = utf8_decode($info[$i]["cn"][0]); 
     196                                                $tmp_users_from_user_org[$info[$i]["mail"][0] . '%' . $info[$i]["telephonenumber"][0] . '%'. $info[$i]["mobile"][0] . '%' . $info[$i]["uid"][0] . '%' . $info[$i]["jpegphoto"]['count'] . '%' . $info[$i]["employeenumber"][0] . '%' . $info[$i]["ou"][0]] = utf8_decode($info[$i]["cn"][0]); 
    183197                                        } 
    184                                 else 
     198                                        else 
    185199                                        { 
    186                                         if (preg_match("/$user_sector_dn/i", $info[$i]['dn'])) 
    187                                                 { 
    188                                                 $tmp_users_from_user_org[$info[$i]["mail"][0] . '%' . $info[$i]["telephonenumber"][0] . '%'. $info[$i]["mobile"][0] . '%' . $info[$i]["uid"][0] . '%' . $info[$i]["jpegphoto"]['count'] . '%' . $info[$i]["employeenumber"][0] . '%' . $info[$i]["ou"][0]] = utf8_decode($info[$i]["cn"][0]); 
    189                                                 } 
    190                                         else 
    191                                                 { 
    192200                                                $tmp[$info[$i]["mail"][0] . '%' . $info[$i]["telephonenumber"][0] . '%'. $info[$i]["mobile"][0] . '%' . $info[$i]["uid"][0] . '%' . $info[$i]["jpegphoto"]['count'] . '%' . $info[$i]["employeenumber"][0] . '%' . $info[$i]["ou"][0]] = utf8_decode($info[$i]["cn"][0]); 
    193                                                 } 
    194201                                        } 
    195202                                } 
     203                        } 
    196204                        natcasesort($tmp_users_from_user_org); 
    197205                        natcasesort($tmp); 
     
    242250                                                        '<tr class="quicksearchcontacts_unselected">' . 
    243251                                                                '<td colspan="2" width="100%" align="center">' . 
    244                                                                         $functions->getLang('More than 200 results were found') . '.<br>' . 
    245                                                                         $functions->getLang('Showing only the results found in your organization') . '.'; 
     252                                                                        str_replace("%1", $this->max_result,$this->functions->getLang('More than %1 results were found')) . '.<br>' . 
     253                                                                        $this->functions->getLang('Showing only the results found in your organization') . '.'; 
    246254                                                                '</td>' . 
    247255                                                        '</tr>'; 
     
    263271                                                        '<tr class="quicksearchcontacts_unselected">' . 
    264272                                                                '<td colspan="2" width="100%" align="center" style="background:#EEEEEE"><B>' . 
    265                                                                         $functions->getLang('Users from your organization') . '.'; 
    266                                                                 '</B></td>' . 
     273                                                                        $this->functions->getLang('Users from your organization') . '</B> ['.count($tmp_users_from_user_org).']'; 
     274                                                                '</td>' . 
    267275                                                        '</tr>'; 
    268276 
     
    270278                                                        '<tr class="quicksearchcontacts_unselected">' . 
    271279                                                                '<td colspan="2" width="100%" align="center" style="background:#EEEEEE"><B>' . 
    272                                                                         $functions->getLang('Users from others organizations') . '.'; 
    273                                                                 '</B></td>' . 
     280                                                                        $this->functions->getLang('Users from others organizations') . '</B> ['.count($tmp).']'; 
     281                                                                '</td>' . 
    274282                                                        '</tr>'; 
    275283                                        } 
     
    299307                                         
    300308                if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_enabled'] && $phoneUser) { 
    301                         $phoneUser = '<a title="'.$functions->getLang("Call to Comercial Number").'" href="#" onclick="InfoContact.connectVoip(\''.$phoneUser.'\',\'com\')">'.$phoneUser.'</a>'; 
     309                        $phoneUser = '<a title="'.$this->functions->getLang("Call to Comercial Number").'" href="#" onclick="InfoContact.connectVoip(\''.$phoneUser.'\',\'com\')">'.$phoneUser.'</a>'; 
    302310                        if($contacts_result['mobile']){ 
    303                                 $phoneUser .= ' / <a title="'.$functions->getLang("Call to Mobile Number").'" href="#" onclick="InfoContact.connectVoip(\''.$contacts_result['mobile'].'\',\'mob\')">'.$contacts_result['mobile'].'</a>'; 
     311                                $phoneUser .= ' / <a title="'.$this->functions->getLang("Call to Mobile Number").'" href="#" onclick="InfoContact.connectVoip(\''.$contacts_result['mobile'].'\',\'mob\')">'.$contacts_result['mobile'].'</a>'; 
    304312                        } 
    305313                } 
     
    307315                        '<tr class="quicksearchcontacts_unselected">' . 
    308316                                '<td class="cc" width="1%">' . 
    309                                         '<a title="'.$functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\')">' . 
     317                                        '<a title="'.$this->functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\')">' . 
    310318                                                $photo_link . 
    311319                                        '</a>' . 
     
    313321                                '<td class="cc">' . 
    314322                                        '<span name="cn">' . $contacts_result['cn'] . '</span>' . '<br>' . 
    315                                         '<a title="'.$functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\')">' . 
     323                                        '<a title="'.$this->functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\')">' . 
    316324                                                '<font color=blue>' . 
    317325                                                        '<span name="mail">' . $contacts_result['mail'] . '</span>' . '<br>' . 
     
    324332        } 
    325333 
    326         function get_catalogs(){ 
    327                 include("../contactcenter/setup/external_catalogs.inc.php"); 
     334        function get_catalogs(){                 
    328335                $catalogs = array(); 
    329                 $catalogs[0] = "Catalogo geral";  
    330                 foreach ($external_srcs as $key => $valor ){ 
     336                $catalogs[0] = $this->functions->getLang("Global Catalog");              
     337                if($this->external_srcs)  
     338                        foreach ($this->external_srcs as $key => $valor ){ 
    331339                        $catalogs[$key] = $valor['name']; 
    332340                } 
     
    334342        } 
    335343        function get_organizations($params){ 
    336  
    337344                $organizations = array(); 
    338345                $params['referral']?$referral = $params['referral']:$referral = false; 
     
    344351                                $filter=$this->branch."=*"; 
    345352                                $justthese = array("$this->branch"); 
    346                                 $sr = ldap_list($this->ds, $this->ldap_context, $filter, $justthese); 
    347                                 $info = ldap_get_entries($this->ds, $sr); 
    348  
    349                                 for ($i=0; $i<$info["count"]; $i++) 
    350                                         $organizations[$i] = $info[$i]["ou"][0]; 
    351  
    352                                 ldap_close($this->ds); 
    353                                 sort($organizations); 
    354                                 return $organizations; 
     353                        $sr = ldap_list($this->ds, $this->ldap_context, $filter, $justthese); 
     354                        $info = ldap_get_entries($this->ds, $sr); 
     355                         
     356                        for ($i=0; $i<$info["count"]; $i++) 
     357                                $organizations[$i] = $info[$i]["ou"][0]; 
     358 
     359                        ldap_close($this->ds); 
     360                        sort($organizations);                                    
     361                return $organizations; 
    355362                        }else{ 
    356363                        return null; 
    357                 } 
     364        } 
    358365        } 
    359366        function get_organizations2($params){ 
     
    381388        function catalogsearch($params) 
    382389        {        
    383                 //$this->ldapConnect(true); 
    384                 include("../contactcenter/inc/external_catalogs.inc.php"); 
    385390                $cn     = $params['search_for'] ? "*".utf8_encode($params['search_for'])."*" : "*"; 
    386                 $max_result       = $params['max_result'] ? $params['max_result'] : '200'; 
     391                $max_result       = $params['max_result'] ? $params['max_result'] : $this->max_result;           
    387392                $catalog = $params['catalog']; 
    388393                $error = False; 
    389                          
     394                 
    390395                $this->ldapConnect(false,$catalog); 
    391396                 
    392                 $params['organization'] == 'todos'?$user_context = $this->ldap_context :$user_context = $this->branch."=".$params['organization'].",".$this->ldap_context;               
     397                $params['organization'] == 'all' ? $user_context = $this->ldap_context :$user_context = $this->branch."=".$params['organization'].",".$this->ldap_context;               
    393398                 
    394399                if ($this->ds) {                                                                                         
     
    405410                        } 
    406411                         
    407                         $sr=ldap_search($this->ds, $user_context, $filter, $justthese,0,200); 
     412                        $sr=@ldap_search($this->ds, $user_context, $filter, $justthese, 0, $this->max_result+1); 
     413                        if(!$sr) 
     414                                return null; 
    408415                        $count_entries = ldap_count_entries($this->ds,$sr); 
    409                         if ($count_entries > $max_result){ 
     416                        if ($count_entries > $this->max_result){ 
    410417                                $info = null; 
    411418                                $error = True;                                           
     
    429436                        natcasesort($u_tmp); 
    430437                        natcasesort($g_tmp); 
    431  
     438                         
    432439                        $i = 0; 
    433                         $users = array(); 
    434  
    435  
    436                         foreach ($u_tmp as $mail => $cn){ 
     440                        $users = array();                        
     441                         
     442                        foreach ($u_tmp as $mail => $cn){                                
    437443 
    438444                                $tmp = explode("%", $cn); //explode o cn pelo caracter "%" e joga em $tmp; 
     
    442448 
    443449                        } 
    444  
    445450                        unset($u_tmp); 
    446451                         
     
    479484        } 
    480485         
    481         //Busca usuï¿œrios de um contexto e jï¿œ retorna as options do select; 
     486        //Busca usuarios de um contexto e ja retorna as options do select; 
    482487        function get_available_users($params) 
    483488    { 
    484489        $this->ldapRootConnect(); 
    485         //Monta lista de Grupos e Usuï¿œrios 
     490        //Monta lista de Grupos e Usuarios 
    486491        $users = Array(); 
    487492        $groups = Array(); 
     
    535540    } 
    536541 
    537         //Busca usuï¿œrios de um contexto e jï¿œ retorna as options do select; 
     542        //Busca usuarios de um contexto e ja retorna as options do select; 
    538543        function get_available_users2($params) 
    539544        { 
     
    626631                if ($ds) 
    627632                {                        
    628                         $sr=ldap_search($ds, $ldap_context, $filter, $justthese); 
     633                        $sr=@ldap_search($ds, $ldap_context, $filter, $justthese); 
    629634                         
    630635                        if (!$sr) 
  • trunk/expressoMail1_2/js/QuickCatalogSearch.js

    r325 r342  
    139139                        Op.value = '"' + data[i].cn + '" ' + '<' + data[i].mail + '>'; 
    140140                        cmb.options.add(Op); 
    141  
    142141                } 
    143142                cmb.options[0].selected = true; 
     
    153152                                                         
    154153                if(! this.arrayWin[div.id]) { 
    155                         div.style.width = "700px"; //na comunidade valor eh 600px 
     154                        div.style.width = "700px"; 
    156155                        div.style.height = "230px"; 
    157156                        var title = get_lang('The results were found in the Global Catalog')+':'; 
     
    226225                el.style.visibility = "hidden"; 
    227226                el.style.position = "absolute"; 
    228                 el.style.width = "700px"; // na comunidade valor eh 495px 
     227                el.style.width = "700px"; 
    229228                el.style.height = is_ie ? "360px" : "375px";             
    230229                el.style.left = "0px"; 
     
    239238                                        '<tr><td><select style="width:150px" id="select_catalog" name="select_catalog" onchange="javascript:QuickCatalogSearch.update_organizations();"></select>&nbsp'+ 
    240239                                        '<select id="select_organization" style="width:100px" name="select_organization"></select>&nbsp;'+    
    241                                         '<input type="text" id="search_for" name="search_for" value="" size="10" maxlength="15"/>&nbsp;<input type="button" onclick="QuickCatalogSearch.searchCatalogList(true)" class="button" value="'+get_lang('Search')+'">&nbsp;<input style="display:none" type="button" onclick="QuickCatalogSearch.searchCatalogList(false)" class="button" value="'+get_lang('List All')+'"></td></tr>'+ 
    242                                            '<tr><td><input onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" id="type" type="radio" name="type" value="l"/>'+get_lang('Public Lists')+'&nbsp;&nbsp;<input type="radio" name="type" value="u" onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" checked/>'+get_lang('Users')+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+ 
     240                                        '<input type="text" id="search_for" name="search_for" value="" size="30" maxlength="20"/>&nbsp;<input type="button" onclick="QuickCatalogSearch.searchCatalogList(true)" class="button" value="'+get_lang('Search')+'">&nbsp;<input style="display:none" type="button" onclick="QuickCatalogSearch.searchCatalogList(false)" class="button" value="'+get_lang('List All')+'"></td></tr>'+ 
     241                                           //'<tr><td><input onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" id="type" type="radio" name="type" value="l"/>'+get_lang('Public Lists')+'&nbsp;&nbsp;<input type="radio" name="type" value="u" onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" checked/>'+get_lang('Users')+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+ 
    243242                                           '<span style="visibility:hidden;background:#cc4444" id=msg_search>&nbsp;&nbsp;<font face="Verdana" size="1" color="WHITE">'+get_lang('Search in Catalog')+'...</font>&nbsp;</span></td></tr>'+ 
    244243                                           '<tr><td>'+ 
     
    298297                        var user_catalog = "Catalogo Geral"; 
    299298 
    300                         for(i = 0; i < data.length; i++) { 
    301                          
    302                                 Element('select_catalog').options[i] = new Option(data[i],i); 
    303                                 if(user_catalog.toUpperCase() == data[i].toUpperCase()) 
    304                                         Element('select_catalog').options[i].selected = true; 
     299                        if(data.length <= 1)  
     300                                Element('select_catalog').style.display = 'none'; 
     301                        else { 
     302                                for(i = 0; i < data.length; i++) {               
     303                                        Element('select_catalog').options[i] = new Option(data[i],i); 
     304                                        if(user_catalog.toUpperCase() == data[i].toUpperCase()) 
     305                                                Element('select_catalog').options[i].selected = true; 
     306                                } 
    305307                        } 
    306308                } 
    307309                cExecute ("$this.ldap_functions.get_catalogs", handler_catalogs);                
    308  
     310                 
    309311                this.update_organizations(); 
    310312         
     
    383385                 
    384386                var handler_org = function(data){ 
    385                         Element('select_organization').options[0] = new Option('todos','todos'); 
     387                        Element('select_organization').options[0] = new Option(get_lang('all'),'all'); 
    386388                        if (data != null){ 
    387389                         
    388390                        for(x = 0; x < data.length; x++) { 
    389                                 Element('select_organization').options[x+1] = new Option(data[x],data[x]); 
     391                                Element('select_organization').options[x+1] = new Option(data[x].toUpperCase(),data[x]); 
    390392                                } 
    391393                        } 
     
    512514                                } 
    513515                                else{ 
    514  
     516         
    515517                                /*******************************************************************************************/ 
    516518                                /* O resultado pratico do bloco de codigo a seguir eh a exibicao dos valores em tela, 
Note: See TracChangeset for help on using the changeset viewer.