Changeset 925 for trunk/calendar


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.

Location:
trunk/calendar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/calendar/inc/class.uicalendar.inc.php

    r924 r925  
    813813                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']); 
    814814                        $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('View'); 
     815                        $GLOBALS['phpgw_info']['flags']['noappheader'] = True; 
    815816                        $GLOBALS['phpgw']->common->phpgw_header(); 
    816817 
     
    46794680                                                                $footer_ext_participantes = lang("Tip: To search in the <b>Global Catalog</b>, type the <b>F9</b> key, like the ExpressoMail."); 
    46804681 
    4681                                                                 if ($param['plain'] != "True"){ 
     4682                                                                /*if ($param['plain'] != "True"){ 
    46824683 
    46834684                                                                        // Begin load array lang 
     
    46874688                                                                        ob_end_clean(); 
    46884689                                                                        // End load array_lang 
    4689                                                                 } 
     4690                                                                }*/ 
    46904691 
    46914692                                                                $var['participants'] = array 
     
    47074708                                                                                        '</td>'. 
    47084709                                                                                        '<td valign="bottom">'. 
    4709                                                                                         '       '.lang("Organization").': '. 
    4710                                                                                         '       <select name="org_context" id="combo_org" onchange="javascript:get_available_users(\''.$module_name.'\',this.value,\''.($recursive ? "" : "search").'\');">'.$combo_org.'</select>'. 
     4710                                                                                //      '       '.lang("Organization").': '. 
     4711                                                                                //      '       <select name="org_context" id="combo_org" onchange="javascript:get_available_users(\''.$module_name.'\',this.value,\''.($recursive ? "" : "search").'\');">'.$combo_org.'</select>'. 
    47114712                                                                                        '       <br>'. 
    47124713                                                                                        '       <font color="red"><span id="cal_span_searching">&nbsp;</span></font>'.                                                                   
     
    47254726                                                                                        "<script type='text/javascript'>var DEFAULT_URL = '".$module_name."/controller.php?action=';</script> ".                                                                                         
    47264727                                                                                        "<script type='text/javascript'>" . 
    4727                                                                                         "var timeout_get_available_users = setTimeout('get_available_users(\"".$module_name."\",\'".$user_context."\',\'".($recursive ? "" : "search")."\')',1000);".  
     4728                                                                                //      "var timeout_get_available_users = setTimeout('get_available_users(\"".$module_name."\",\'".$user_context."\',\'".($recursive ? "" : "search")."\')',1000);".  
    47284729                                                                                        "</script> " 
    47294730                                                                ); 
  • 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.