Changeset 1639 for trunk/calendar
- Timestamp:
- 11/13/09 13:40:27 (14 years ago)
- Location:
- trunk/calendar
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/calendar/inc/class.uicalendar.inc.php
r1626 r1639 835 835 $date = $cal_date ? $cal_date : 0; 836 836 $date = $date ? $date : (int)$_GET['date']; 837 837 838 838 // First, make sure they have permission to this entry 839 839 if ($cal_id < 1) … … 1695 1695 } 1696 1696 $str .= "\n"; 1697 1698 1697 } 1698 } 1699 1699 $str .= '</tr>' 1700 1700 . '<tr><td height="1" colspan="'.((11 * $interval) + 1).'" bgcolor="#999999"><img src="'.$pix.'"></td></tr>'; 1701 1701 } 1702 1702 $this->bo->owner = $owner; 1703 1703 $this->bo->so->owner = $owner; … … 5056 5056 '<td valign="bottom">'. 5057 5057 ' '.lang("Organization").': '. 5058 ' <select name="org_context" id="combo_org" onchange="javascript:get_available_users(\''.$module_name.'\', \''.$GLOBALS['phpgw_info']['server']['auto_search'].'\',\''.($recursive ? "" : "search").'\');">'.$combo_org.'</select>'.5058 ' <select name="org_context" id="combo_org" onchange="javascript:get_available_users(\''.$module_name.'\',this.value,\''.($recursive ? "" : "search").'\',\''.$GLOBALS['phpgw_info']['server']['auto_search'].'\');">'.$combo_org.'</select>'. 5059 5059 ' <br>'. 5060 5060 ' <font color="red"><span id="cal_span_searching"> </span></font>'. 5061 5061 ' <br>'.lang("Search for").':'. 5062 ' <input value="" id="cal_input_searchUser" size="35" autocomplete="off" onkeyup="javascript:optionFinderTimeout(this,'.$GLOBALS['phpgw_info']['server']['min_num_characters'].' )"><br>'.5062 ' <input value="" id="cal_input_searchUser" size="35" autocomplete="off" onkeyup="javascript:optionFinderTimeout(this,'.$GLOBALS['phpgw_info']['server']['min_num_characters'].',\''.($recursive ? "" : "search").'\',\''.$GLOBALS['phpgw_info']['server']['auto_search'].'\')"><br>'. 5063 5063 ' <b>'.lang("Available users and groups").'</b><br>'. 5064 5064 ' <select id="user_list_in" style="width: 300px" multiple size="13"></select>'. 5065 5066 5065 '</td>'. 5066 '</tr>'. 5067 5067 '<tr>'. 5068 5068 '<td width="25%">'. … … 5084 5084 "<script type='text/javascript'>var DEFAULT_URL = '".$module_name."/controller.php?action=';</script> ". 5085 5085 "<script type='text/javascript'>" . 5086 "var timeout_get_available_users = setTimeout('get_available_users(\"".$module_name."\",\'".$ GLOBALS['phpgw_info']['server']['auto_search']."\',\'".$user_context."\',\'".($recursive ? "" : "search")."\')',1000);".5086 "var timeout_get_available_users = setTimeout('get_available_users(\"".$module_name."\",\'".$user_context."\',\'".($recursive ? "" : "search")."\',\'".$GLOBALS['phpgw_info']['server']['auto_search']."\')',1000);". 5087 5087 "</script> " 5088 5088 ); -
trunk/calendar/templates/classic/js/edit.js
r1447 r1639 7 7 var select_in = document.getElementById('user_list'); 8 8 var select_out = document.getElementById('user_list_in'); 9 var users_out = select_out .cloneNode(true);9 var users_out = select_out ? select_out.cloneNode(true) : ''; 10 10 var finderTimeout = ''; 11 11 -
trunk/calendar/templates/classic/js/edit_exmail.js
r1587 r1639 21 21 var agt = navigator.userAgent.toLowerCase(); 22 22 var is_firefox_0 = agt.indexOf('firefox/1.0') != -1 && agt.indexOf('firefox/0.') ? true : false; 23 24 23 /* 25 24 Semelhante a função get_avaiable_users, porém trás apenas usuários, ignorando os grupos... … … 55 54 } 56 55 57 function get_available_users(filter,autoSearch) 58 //function get_available_users(path,context,type) 59 { 60 text= document.getElementById("cal_input_searchUser"); 61 62 var handler_get_available_users = function(data) 63 { 64 select_available_users = document.getElementById('user_list_in'); 56 var handler_get_available_users = function(data) 57 { 58 select_available_users = Element('user_list_in'); 59 60 for(var i=0; i<select_available_users.options.length; i++){ 61 select_available_users.options[i] = null; 62 i--; 63 } 64 var options = '###'; 65 if (data) { 66 if(data.groups && data.groups.length > 0) { 67 data.groups = '<option value="-1" disabled>------------------- '+Element("txt_groups").value+' ------------------ </option>' + data.groups; 68 } 69 if(data.users && data.users.length > 0) { 70 data.users = '<option value="-1" disabled>------------------- '+Element("txt_users").value+' ------------------ </option>' + data.users; 71 } 72 options += data.groups && data.groups.length > 0 ? data.groups : ''; 73 options += data.users && data.users.length > 0 ? data.users : ''; 65 74 66 for(var i=0; i<select_available_users.options.length; i++){ 67 select_available_users.options[i] = null; 68 i--; 69 } 70 var options = '###'; 71 if (data) { 72 if(data.groups && data.groups.length > 0) { 73 data.groups = '<option value="-1" disabled>------------------- '+document.getElementById("txt_groups").value+' ------------------ </option>' + data.groups; 74 } 75 76 if(data.users && data.users.length > 0) { 77 data.users = '<option value="-1" disabled>------------------- '+document.getElementById("txt_users").value+' ------------------ </option>' + data.users; 78 } 79 options += data.groups && data.groups.length > 0 ? data.groups : ''; 80 options += data.users && data.users.length > 0 ? data.users : ''; 81 82 if(is_firefox_0) 83 fixBugInnerSelect(select_available_users,options); 84 else 85 select_available_users.innerHTML = options; 86 87 select_available_users.outerHTML = select_available_users.outerHTML; 88 select_available_users.disabled = false; 89 select_available_users_clone = document.getElementById('user_list_in').cloneNode(true); 90 //document.getElementById('cal_input_searchUser').value = ''; 91 } 92 } 93 context = document.getElementById('combo_org').value; 94 cExecute ('expressoMail1_2'+'.ldap_functions.search_users&filter='+filter+'&context='+context+'&type=search', handler_get_available_users); 95 96 if((autoSearch == 'True') && (!text.value)){ 97 var search = " "; 98 get_available_users(search); 99 } 100 //cExecute (path+'.ldap_functions.get_available_users&context='+context+'&type='+type, handler_get_available_users); 101 } 102 103 function optionFinderTimeout(obj,numMin){ 104 var oWait = document.getElementById("cal_span_searching"); 105 clearTimeout(finderTimeout); 106 if (obj.value.length >= numMin){ 107 oWait.innerHTML = 'Buscando...'; 108 finderTimeout = setTimeout("optionFinder('"+obj.id+"','"+numMin+"')",500); 109 }else { 110 oWait.innerHTML = 'Mínimo de '+numMin+' letras para pesquisa'; 111 var select_available_users_tmp = document.getElementById('user_list_in'); 112 for(var i = 0;i < select_available_users_tmp.options.length; i++) 113 select_available_users_tmp.options[i--] = null; 114 } 115 } 116 117 function optionFinder(id,numMin){ 118 119 var oWait = document.getElementById("cal_span_searching"); 120 var oText = document.getElementById(id); 75 if(is_firefox_0) 76 fixBugInnerSelect(select_available_users,options); 77 else 78 select_available_users.innerHTML = options; 79 80 select_available_users.outerHTML = select_available_users.outerHTML; 81 select_available_users.disabled = false; 82 select_available_users_clone = Element('user_list_in').cloneNode(true); 83 } 84 } 85 86 function get_available_users(module,context,type, autoSearch){ 87 Element('cal_input_searchUser').value = ''; 88 if(autoSearch != 'True'){ 89 return true; 90 } 91 var context = document.getElementById('combo_org').value; 92 cExecute (module+'.ldap_functions.get_available_users&context='+context+'&type='+type, handler_get_available_users); 93 } 94 95 function optionFinderTimeout(obj, numMin, type, autoSearch){ 96 var oWait = Element("cal_span_searching"); 97 oWait.innerHTML = 'Buscando...'; 98 clearTimeout(finderTimeout); 99 100 if(autoSearch == "True"){ 101 finderTimeout = setTimeout("optionFinderLocal('"+obj.id+"')",500); 102 } 103 else if (obj.value.length >= numMin){ 104 finderTimeout = setTimeout("optionFinderLdap('"+obj.id+"','"+numMin+"','"+type+"')",500); 105 }else { 106 oWait.innerHTML = 'Mínimo de '+numMin+' letras para pesquisa'; 107 var select_available_users_tmp = document.getElementById('user_list_in'); 108 for(var i = 0;i < select_available_users_tmp.options.length; i++) 109 select_available_users_tmp.options[i--] = null; 110 } 111 } 112 // Pesquisa Javascript 113 function optionFinderLocal(id){ 114 var oText = Element(id); 115 var oWait = Element("cal_span_searching"); 116 var select_available_users_tmp = Element('user_list_in'); 117 for(var i = 0;i < select_available_users_tmp.options.length; i++) 118 select_available_users_tmp.options[i--] = null; 119 var RegExp_name = new RegExp("\\b"+oText.value, "i"); 120 121 for(i = 0; i < select_available_users_clone.length; i++){ 122 if (RegExp_name.test(select_available_users_clone[i].text) || select_available_users_clone[i].value =="-1") 123 { 124 sel = select_available_users_tmp.options; 125 option = new Option(select_available_users_clone[i].text,select_available_users_clone[i].value); 126 if( select_available_users_clone[i].value == "-1") option.disabled = true; 127 sel[sel.length] = option; 128 } 129 } 130 oWait.innerHTML = ' '; 131 } 132 133 // Pesquisa LDAP 134 function optionFinderLdap(id,numMin, type){ 135 var oWait = Element("cal_span_searching"); 136 var oText = Element(id); 121 137 122 138 if (oText.value.length < numMin) { … … 127 143 } 128 144 129 if (oText.value.length >= numMin) { 130 get_available_users(oText.value); 131 132 var select_available_users_tmp = document.getElementById('user_list_in'); 133 for(var i = 0;i < select_available_users_tmp.options.length; i++) 134 select_available_users_tmp.options[i--] = null; 135 var RegExp_name = new RegExp("\\b"+oText.value, "i"); 136 145 if (oText.value.length >= numMin){ 146 var context = document.getElementById('combo_org').value; 147 cExecute ('expressoMail1_2.ldap_functions.search_users&context='+(context)+'&type='+(type == '' ? 'list' : 'search')+'&filter='+oText.value, handler_get_available_users); 137 148 oWait.innerHTML = ' '; 138 149 } 139 150 } 140 function autoOptionFinder(){141 var oWait = document.getElementById("cal_span_searching");142 var oText = document.getElementById(id);143 var select_available_users_tmp = document.getElementById('user_list_in');144 for(var i = 0;i < select_available_users_tmp.options.length; i++)145 select_available_users_tmp.options[i--] = null;146 var RegExp_name = new RegExp("\\b ", "i");147 oWait.innerHTML = ' ';148 }149 151 150 152 function add_user() … … 427 429 } 428 430 }; 429
Note: See TracChangeset
for help on using the changeset viewer.