Changeset 5133 for trunk/expressoAdmin1_2/js/jscode/groups.js
- Timestamp:
- 11/03/11 13:24:14 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/js/jscode/groups.js
r640 r5133 79 79 } 80 80 81 function Element( id ) 82 { 83 return document.getElementById( id ); 84 } 85 81 86 // HANDLER CREATE 82 87 // É necessário 2 funcões de retorno por causa do cExecuteForm. … … 113 118 } 114 119 115 function sinc_combos_org( context, recursive)120 function sinc_combos_org() 116 121 { 117 122 combo_org_groups = document.getElementById('ea_combo_org_groups'); … … 122 127 { 123 128 combo_org_groups.options[i].selected = true; 124 get_available_users( context, recursive);129 get_available_users(); 125 130 break; 126 131 } … … 128 133 } 129 134 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'); 135 function get_available_users() 136 { 137 /* var sentence = Element('ea_input_searchUser').value; 135 138 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 = ' ' + 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 ){ 148 144 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 = ' '; 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' ); 168 155 } 169 156 … … 237 224 238 225 // 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 = ' '; 226 function optionFinderTimeout(obj, event) 227 { 228 229 if( event.keyCode == 13 ) 230 { 231 limit = 0; 232 optionFinder(obj.id); 233 } 234 } 235 function optionFinder(id) 236 { 237 get_available_users(); 268 238 } 269 239
Note: See TracChangeset
for help on using the changeset viewer.