Ignore:
Timestamp:
11/03/11 13:24:14 (12 years ago)
Author:
wmerlotto
Message:

Ticket #2305 - Enviando alteracoes, desenvolvidas internamente na Prognus, do modulo ExpressoAdmin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoAdmin1_2/js/jscode/groups.js

    r640 r5133  
    7979} 
    8080 
     81function Element( id ) 
     82{ 
     83    return document.getElementById( id ); 
     84} 
     85 
    8186// HANDLER CREATE 
    8287// É necessário 2 funcões de retorno por causa do cExecuteForm. 
     
    113118} 
    114119 
    115 function sinc_combos_org(context, recursive) 
     120function sinc_combos_org() 
    116121{ 
    117122        combo_org_groups = document.getElementById('ea_combo_org_groups'); 
     
    122127                { 
    123128                        combo_org_groups.options[i].selected = true; 
    124                         get_available_users(context, recursive); 
     129                        get_available_users(); 
    125130                        break; 
    126131                } 
     
    128133} 
    129134 
    130 function get_available_users(context, recursive) 
    131 { 
    132         var handler_get_available_users = function(data) 
    133         { 
    134                 select_available_users = document.getElementById('ea_select_available_users'); 
     135function get_available_users() 
     136{ 
     137/*      var sentence = Element('ea_input_searchUser').value; 
    135138                 
    136                 //Limpa o select 
    137                 for(var i=0; i<select_available_users.options.length; i++) 
    138                 { 
    139                         select_available_users.options[i] = null; 
    140                         i--; 
    141                 } 
    142  
    143                 if ((data) && (data.length > 0)) 
    144                 { 
    145                         // Necessario, pois o IE6 tem um bug que retira o primeiro options se o innerHTML estiver vazio. 
    146                         select_available_users.innerHTML = '&nbsp;' + data; 
    147                         select_available_users.outerHTML = select_available_users.outerHTML; 
     139        var url = '$this.ldap_functions.get_available_users_and_shared_acounts&context=' 
     140                    + Element('ea_combo_org_info').value 
     141                    + '&sentence=' + sentence; 
     142 
     143        var fillHandler = function( fill ){ 
    148144                         
    149                         select_available_users.disabled = false; 
    150                         select_available_users_clone = document.getElementById('ea_select_available_users').cloneNode(true); 
    151                         document.getElementById('ea_input_searchUser').value = ''; 
    152                 } 
    153         } 
    154          
    155         //Impede chamada recursiva na raiz das organizações 
    156         if ((recursive) && (document.forms[0].ldap_context.value == document.getElementById('ea_combo_org_groups').value)) 
    157         { 
    158                 alert(get_lang('It is not allow select all users from the root organization') + '.'); 
    159                 document.getElementById('ea_check_allUsers').checked = false; 
    160  
    161                 // Limpa select 
    162                 select_available_users = document.getElementById('ea_select_available_users'); 
    163                 select_available_users.innerHTML = '&nbsp;'; 
    164                 select_available_users.outerHTML = select_available_users.outerHTML; 
    165                 return; 
    166         } 
    167         cExecute ('$this.ldap_functions.get_available_users&context='+context+'&recursive='+recursive, handler_get_available_users); 
     145        Element('ea_select_available_users').innerHTML = fill; 
     146 
     147        return( fill !== "" ); 
     148        } 
     149         
     150        userFinder( sentence, fillHandler, url, 'ea_span_searching' );*/ 
     151 
     152        optionFind( 'ea_input_searchUser', 'ea_select_available_users', 
     153                    '$this.ldap_functions.get_available_users_and_shared_acounts', 
     154                    'ea_combo_org_groups', 'ea_span_searching' ); 
    168155} 
    169156 
     
    237224 
    238225// Funcoes                                                                                       
    239 function optionFinderTimeout(obj) 
    240 { 
    241         clearTimeout(finderTimeout);     
    242         var oWait = document.getElementById("ea_span_searching"); 
    243         oWait.innerHTML = get_lang('Searching') + '...'; 
    244         var finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500); 
    245 } 
    246 function optionFinder(id) { 
    247         var oWait = document.getElementById("ea_span_searching"); 
    248         var oText = document.getElementById(id); 
    249                          
    250         //Limpa todo o select 
    251         var select_available_users_tmp = document.getElementById('ea_select_available_users') 
    252         for(var i = 0;i < select_available_users_tmp.options.length; i++) 
    253                 select_available_users_tmp.options[i--] = null; 
    254  
    255         var RegExp_name = new RegExp("\\b"+oText.value, "i"); 
    256  
    257         //Inclui usuário começando com a pesquisa 
    258         for(i = 0; i < select_available_users_clone.length; i++){ 
    259                 if (RegExp_name.test(select_available_users_clone[i].text)) 
    260                 { 
    261                         sel = select_available_users_tmp.options; 
    262                         option = new Option(select_available_users_clone[i].text,select_available_users_clone[i].value);                                 
    263                         sel[sel.length] = option; 
    264                 } 
    265         } 
    266          
    267         oWait.innerHTML = '&nbsp;'; 
     226function optionFinderTimeout(obj, event) 
     227{ 
     228 
     229        if( event.keyCode == 13 ) 
     230                { 
     231            limit = 0; 
     232            optionFinder(obj.id); 
     233                } 
     234} 
     235function optionFinder(id) 
     236{ 
     237        get_available_users(); 
    268238}                        
    269239 
Note: See TracChangeset for help on using the changeset viewer.