Ignore:
Timestamp:
05/27/09 17:45:59 (15 years ago)
Author:
rafaelraymundo
Message:

Ticket #525 - Alteracoes para a busca Ajax. Adicionada a funcao search_users em class.ldap_functions.inc.php
do ExpressoMail? para realizar as buscas na adicao de participantes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/calendar/templates/celepar/js/edit_exmail.js

    r638 r925  
    2020var is_firefox_0 = agt.indexOf('firefox/1.0') != -1 && agt.indexOf('firefox/0.') ? true : false; 
    2121 
    22 function optionFinderTimeout(obj) 
    23 { 
    24         clearTimeout(finderTimeout);     
    25         var oWait = document.getElementById("cal_span_searching"); 
    26         oWait.innerHTML = document.getElementById("txt_searching").value + '...'; 
    27         var finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500); 
    28 } 
    29 function optionFinder(id) { 
    30         var oWait = document.getElementById("cal_span_searching"); 
    31         var oText = document.getElementById(id);                         
    32         var select_available_users_tmp = document.getElementById('user_list_in') 
    33         for(var i = 0;i < select_available_users_tmp.options.length; i++) 
    34                 select_available_users_tmp.options[i--] = null; 
    35  
    36         var RegExp_name = new RegExp("\\b"+oText.value, "i"); 
    37  
    38         for(i = 0; i < select_available_users_clone.length; i++){ 
    39                 if (RegExp_name.test(select_available_users_clone[i].text) || select_available_users_clone[i].value =="-1") 
    40                 { 
    41                         sel = select_available_users_tmp.options; 
    42                         option = new Option(select_available_users_clone[i].text,select_available_users_clone[i].value); 
    43                         if( select_available_users_clone[i].value == "-1") option.disabled = true; 
    44                         sel[sel.length] = option; 
    45                 } 
    46         }        
    47         oWait.innerHTML = '&nbsp;'; 
    48 }        
    49                  
    50 function get_available_users(path,context,type) 
     22function get_available_users(filter) 
    5123{ 
    5224        var handler_get_available_users = function(data) 
     
    7850                        select_available_users.disabled = false; 
    7951                        select_available_users_clone = document.getElementById('user_list_in').cloneNode(true); 
    80                         document.getElementById('cal_input_searchUser').value = ''; 
     52                        //document.getElementById('cal_input_searchUser').value = ''; 
    8153                } 
    8254        }        
    8355 
    84         document.getElementById('combo_org').value = context; 
    85         cExecute (path+'.ldap_functions.get_available_users&context='+context+'&type='+type, handler_get_available_users); 
    86 } 
     56        //document.getElementById('combo_org').value = context; 
     57        cExecute ('expressoMail1_2'+'.ldap_functions.search_users&filter='+filter+'&type=search', handler_get_available_users); 
     58} 
     59 
     60function optionFinderTimeout(obj){ 
     61                if (obj.value.length >= 4){ 
     62                        clearTimeout(finderTimeout);     
     63                        var oWait = document.getElementById("cal_span_searching"); 
     64                        oWait.innerHTML = 'Buscando...'; 
     65                        var finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500); 
     66                }else { 
     67                        oWait.innerHTML = 'Mínimo de 4 letras para pesquisa'; 
     68                        var select_available_users_tmp = document.getElementById('user_list_in'); 
     69                        for(var i = 0;i < select_available_users_tmp.options.length; i++) 
     70                        select_available_users_tmp.options[i--] = null; 
     71                } 
     72} 
     73         
     74function optionFinder(id){ 
     75         
     76                var oWait = document.getElementById("cal_span_searching"); 
     77                var oText = document.getElementById(id); 
     78                 
     79                         
     80                if (oText.value.length < 4) { 
     81                                oWait.innerHTML = ''; 
     82                                var select_available_users_tmp = document.getElementById('user_list_in'); 
     83                                for(var i = 0;i < select_available_users_tmp.options.length; i++) 
     84                                        select_available_users_tmp.options[i--] = null; 
     85                } 
     86                 
     87                if (oText.value.length >= 4) { 
     88                        get_available_users(oText.value); 
     89                 
     90                        var select_available_users_tmp = document.getElementById('user_list_in'); 
     91                        for(var i = 0;i < select_available_users_tmp.options.length; i++) 
     92                                select_available_users_tmp.options[i--] = null; 
     93                        var RegExp_name = new RegExp("\\b"+oText.value, "i"); 
     94         
     95                        oWait.innerHTML = '&nbsp;'; 
     96                } 
     97} 
     98 
    8799function add_user() 
    88100{ 
Note: See TracChangeset for help on using the changeset viewer.