Ignore:
Timestamp:
10/14/10 11:10:26 (14 years ago)
Author:
eduardoalex
Message:

Ticket #1232 - e Ticket #1001. Feitas as correcoes referentes aos tickets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/expressoAdmin1_2/js/jscode/maillists.js

    r482 r3351  
    157157} 
    158158 
    159 function get_available_users(context, recursive) 
    160 { 
    161         var handler_get_available_users = function(data) 
    162         { 
    163                 select_available_users = document.getElementById('ea_select_available_users'); 
    164                  
    165                 //Limpa o select 
    166                 for(var i=0; i<select_available_users.options.length; i++) 
    167                 { 
    168                         select_available_users.options[i] = null; 
    169                         i--; 
    170                 } 
    171  
    172                 if ((data) && (data.length > 0)) 
    173                 { 
    174                         // Necessario, pois o IE6 tem um bug que retira o primeiro options se o innerHTML estiver vazio. 
    175                         select_available_users.innerHTML = '&nbsp;' + data; 
     159function get_available_users(context, recursive,listSearch) 
     160{ 
     161        //Impede chamada recursiva na raiz das organizações 
     162        if(document.getElementById("autosearch").value == "true"){ 
     163                if ((recursive) && (document.forms[0].ldap_context.value == document.getElementById('ea_combo_org_maillists').value)) 
     164                { 
     165                        alert(get_lang('It is not allow select all users from the root organization') + '.'); 
     166                        document.getElementById('ea_check_allUsers').checked = false; 
     167                         
     168                        // Limpa select 
     169                        select_available_users = document.getElementById('ea_select_available_users'); 
     170                        select_available_users.innerHTML = '&nbsp;'; 
    176171                        select_available_users.outerHTML = select_available_users.outerHTML; 
    177                          
    178                         select_available_users.disabled = false; 
    179                         select_available_users_clone = document.getElementById('ea_select_available_users').cloneNode(true); 
    180                         document.getElementById('ea_input_searchUser').value = ''; 
    181                 } 
    182         } 
    183          
    184         //Impede chamada recursiva na raiz das organizações 
    185         if ((recursive) && (document.forms[0].ldap_context.value == document.getElementById('ea_combo_org_maillists').value)) 
    186         { 
    187                 alert(get_lang('It is not allow select all users from the root organization') + '.'); 
    188                 document.getElementById('ea_check_allUsers').checked = false; 
    189                  
    190                 // Limpa select 
    191                 select_available_users = document.getElementById('ea_select_available_users'); 
    192                 select_available_users.innerHTML = '&nbsp;'; 
    193                 select_available_users.outerHTML = select_available_users.outerHTML; 
    194                 return; 
    195         } 
    196         cExecute ('$this.ldap_functions.get_available_users_and_maillist&context='+context+'&recursive='+recursive+'&denied_uidnumber='+document.forms[0].uidnumber.value, handler_get_available_users); 
     172                        return; 
     173                } 
     174        cExecute ('$this.ldap_functions.get_available_users_and_maillist&context='+context+'&recursive='+recursive+'&denied_uidnumber='+document.forms[0].uidnumber.value+'&listSearch='+listSearch, handler_get_available_users); 
     175        }else 
     176                document.getElementById('ea_input_searchUser').value = ''; 
    197177} 
    198178 
     
    321301 
    322302// Funcoes 
    323 function optionFinderTimeout(obj) 
     303/*function optionFinderTimeout(obj) 
    324304{ 
    325305        clearTimeout(finderTimeout);     
     
    327307        oWait.innerHTML = get_lang('Searching') + '...'; 
    328308        finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500); 
    329 } 
    330 function optionFinder(id) { 
     309}*/ 
     310 
     311function optionFinderTimeout(obj, numMin, type, autoSearch,listSearch){ 
     312        var oWait = document.getElementById("ea_span_searching"); 
     313        oWait.innerHTML = 'Buscando...'; 
     314        clearTimeout(finderTimeout);             
     315         
     316        if(autoSearch == "True"){ 
     317                finderTimeout = setTimeout("optionFinderLocal('"+obj.id+"')",600); 
     318        } 
     319        else if (obj.value.length >= numMin){ 
     320                finderTimeout = setTimeout("optionFinderLdap('"+obj.id+"','"+numMin+"','"+type+"','"+listSearch+"')",600); 
     321        }else { 
     322                oWait.innerHTML = 'Mínimo de '+numMin+' letras para pesquisa'; 
     323                var select_available_users_tmp = document.getElementById('ea_select_available_users'); 
     324                for(var i = 0;i < select_available_users_tmp.options.length; i++) 
     325                select_available_users_tmp.options[i--] = null; 
     326        } 
     327} 
     328var handler_get_available_users = function(data) 
     329        { 
     330                select_available_users = document.getElementById('ea_select_available_users'); 
     331                 
     332                //Limpa o select 
     333                for(var i=0; i<select_available_users.options.length; i++) 
     334                { 
     335                        select_available_users.options[i] = null; 
     336                        i--; 
     337                } 
     338 
     339                if ((data) && (data.length > 0)) 
     340                { 
     341                        // Necessario, pois o IE6 tem um bug que retira o primeiro options se o innerHTML estiver vazio. 
     342                        select_available_users.innerHTML = '&nbsp;' + data; 
     343                        select_available_users.outerHTML = select_available_users.outerHTML; 
     344                         
     345                        select_available_users.disabled = false; 
     346                        select_available_users_clone = document.getElementById('ea_select_available_users').cloneNode(true); 
     347                        //document.getElementById('ea_input_searchUser').value = ''; 
     348                } 
     349         
     350        } 
     351// Pesquisa LDAP 
     352function optionFinderLdap(id,numMin, type,listSearch){ 
     353        var oWait = document.getElementById("ea_span_searching"); 
     354        var oText = document.getElementById(id); 
     355         
     356        if (oText.value.length < numMin) { 
     357                oWait.innerHTML = ''; 
     358                var select_available_users_tmp = document.getElementById('ea_select_available_users'); 
     359                for(var i = 0;i < select_available_users_tmp.options.length; i++) 
     360                        select_available_users_tmp.options[i--] = null; 
     361        } 
     362         
     363        if (oText.value.length >= numMin){ 
     364                var context = document.getElementById('ea_combo_org_maillists').value; 
     365                recursive = document.getElementById("ea_check_allUsers").checked; 
     366                cExecute ('$this.ldap_functions.search_available_users_and_maillist&context='+(context)+'&recursive='+(recursive)+'&type='+(type == '' ? 'list' : 'search')+'&filter='+oText.value+'&listSearch='+listSearch, handler_get_available_users); 
     367                oWait.innerHTML = '&nbsp;'; 
     368        } 
     369} 
     370 
     371function optionFinderLocal(id) { 
    331372        var oWait = document.getElementById("ea_span_searching"); 
    332373        var oText = document.getElementById(id); 
Note: See TracChangeset for help on using the changeset viewer.