Ignore:
Timestamp:
06/21/07 08:32:34 (17 years ago)
Author:
niltonneto
Message:

* empty log message *

Location:
trunk/expressoAdmin1_2/js/jscode
Files:
2 edited

Legend:

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

    r2 r33  
    277277        } 
    278278} 
     279 
     280function use_samba_attrs(value) 
     281{ 
     282        document.forms[0].sambadomain.disabled = !value; 
     283} 
     284 
     285function get_available_sambadomains(context, type) 
     286{ 
     287        if ((type == 'create_group') && (document.getElementById('ea_div_display_samba_options').style.display != 'none')) 
     288        { 
     289                var handler_get_available_sambadomains = function(data) 
     290                { 
     291                        document.forms[0].use_attrs_samba.checked = data.status; 
     292                        use_samba_attrs(data.status); 
     293                         
     294                        if (data.status) 
     295                        { 
     296                                combo_sambadomains = document.getElementById('ea_combo_sambadomains'); 
     297                                for (i=0; i<data.sambaDomains.length; i++) 
     298                                { 
     299                                        for (j=0; j<combo_sambadomains.length; j++) 
     300                                        { 
     301                                                if (combo_sambadomains.options[j].text == data.sambaDomains[i]) 
     302                                                { 
     303                                                        combo_sambadomains.options[j].selected = true; 
     304                                                        break; 
     305                                                } 
     306                                        } 
     307                                } 
     308                                 
     309                        } 
     310                } 
     311                cExecute ('$this.ldap_functions.exist_sambadomains_in_context&context='+context, handler_get_available_sambadomains); 
     312        } 
     313} 
  • trunk/expressoAdmin1_2/js/jscode/users.js

    r32 r33  
    199199} 
    200200 
    201 /* 
    202 function get_sectors(organization, user_context, user_sector) 
    203 { 
    204         return; 
    205         var handler_get_sectors = function(data) 
    206         { 
    207                 select_sector = document.getElementById('ea_select_sectors'); 
    208                 //Limpa o select 
    209                 for(var i=0; i<select_sector.options.length; i++) 
    210                 { 
    211                         if(select_sector.options[i].selected == true) 
    212                         { 
    213                                 select_sector.options[i] = null; 
    214                                 i--; 
    215                         } 
    216                 } 
    217                  
    218                 if (data.length > 0) 
    219                 { 
    220                         option_seleted = false; 
    221  
    222                         new_option = new Option('Sem Setor','',false,false); 
    223                         select_sector.options[0] = new_option; 
    224  
    225                         for (i=0; i<data.length; i++) 
    226                         { 
    227                                 new_option = new Option(data[i].sector,data[i].sector,false,false); 
    228                                 select_sector.options[i+1] = new_option; 
    229                                 if ((user_sector == data[i].sector) && (user_context == organization)) 
    230                                 { 
    231                                         select_sector.options[i+1].selected = true; 
    232                                         option_seleted = true; 
    233                                 } 
    234                         } 
    235                         select_sector.disabled = false; 
    236                         if (!option_seleted) 
    237                                 select_sector.options[0].selected = true; 
    238                 } 
    239                 else 
    240                 { 
    241                         new_option = new Option('Nenhum setor cadastrado para esta organização.','',false,false); 
    242                         select_sector.options[0] = new_option; 
    243                         select_sector.options[0].selected = true; 
    244                 }        
    245         } 
    246         cExecute ('$this.db_functions.get_sectors&organization='+organization, handler_get_sectors); 
    247 } 
    248 */ 
    249  
    250201function get_available_groups(context) 
    251202{ 
     
    253204        { 
    254205                select_available_groups = document.getElementById('ea_select_available_groups'); 
    255                 //Limpa o select 
    256                 for(var i=0; i<select_available_groups.options.length; i++) 
    257                 { 
    258                         select_available_groups.options[i] = null; 
    259                         i--; 
    260                 } 
    261  
    262                 if (data.length > 0) 
    263                 { 
    264                         for (i=0; i<data.length; i++) 
    265                         { 
    266                                 new_option = new Option(data[i].cn[0],data[i].gidnumber[0],false,false); 
    267                                 select_available_groups.options[i] = new_option; 
    268                         } 
    269                         //select_available_groups.disabled = false; 
    270                         select_available_groups.options[0].selected = true; 
     206 
     207                if ((data) && (data.length > 0)) 
     208                { 
     209                        // Necessario, pois o IE6 tem um bug que retira o primeiro options se o innerHTML estiver vazio. 
     210                        select_available_groups.innerHTML = '#' + data; 
     211                        select_available_groups.outerHTML = select_available_groups.outerHTML; 
    271212                        select_available_groups_clone = select_available_groups.cloneNode(true); 
    272213                        document.getElementById('ea_input_searchGroup').value = ''; 
    273                          
     214                } 
     215                else 
     216                { 
     217                        // Necessario, pois o IE6 tem um bug que retira o primeiro options se o innerHTML estiver vazio. 
     218                        select_available_groups.innerHTML = '#'; 
     219                        select_available_groups.outerHTML = select_available_groups.outerHTML; 
    274220                } 
    275221        }        
    276222                 
    277 cExecute ('$this.ldap_functions.get_available_groups&context='+context, handler_get_available_groups); 
    278 } 
    279          
    280  
     223        cExecute ('$this.ldap_functions.get_available_groups&context='+context, handler_get_available_groups); 
     224} 
     225         
    281226function add_user2group() 
    282227{ 
     
    348293                } 
    349294        } 
    350          
    351         //return; 
    352         /* 
    353         //Refaz combo do primary group 
    354         for(var i=0; i<combo_primary_user_group.options.length; i++) 
    355         { 
    356                 if(combo_primary_user_group.options[i].selected == true) 
    357                 { 
    358                         var user_primary_group = combo_primary_user_group.options[i].value; 
    359                         alert(user_primary_group); 
    360                 } 
    361                  
    362                 combo_primary_user_group.options[i] = null; 
    363                 i--; 
    364         } 
    365          
    366         for(var i = 0;i < select_user_groups.options.length; i++) 
    367         { 
    368                 new_option = document.createElement('option'); 
    369                 new_option.value= select_user_groups.options[i].value; 
    370                 new_option.text = select_user_groups.options[i].text; 
    371                  
    372                 if (user_primary_group == select_user_groups.options[i].value) 
    373                         new_option.selected = true; 
    374                  
    375                 combo_primary_user_group.options[i] = new_option; 
    376         }*/ 
    377295} 
    378296         
     
    382300        { 
    383301                select_available_maillists = document.getElementById('ea_select_available_maillists'); 
    384                 //Limpa o select 
    385                 for(var i=0; i<select_available_maillists.options.length; i++) 
    386                 { 
    387                         select_available_maillists.options[i] = null; 
    388                         i--; 
    389                 } 
    390  
    391                 if (data.length > 0) 
    392                 { 
    393                         for (i=0; i<data.length; i++) 
    394                         { 
    395                                 new_option = new Option(data[i].uid[0]+' ('+data[i].mail[0]+')', data[i].uidnumber[0], false, false); 
    396                                 select_available_maillists.options[i] = new_option; 
    397                         } 
    398                         select_available_maillists.disabled = false; 
    399                         select_available_maillists.options[0].selected = true; 
     302 
     303                if ((data) && (data.length > 0)) 
     304                { 
     305                        // Necessario, pois o IE6 tem um bug que retira o primeiro options se o innerHTML estiver vazio. 
     306                        select_available_maillists.innerHTML = '#' + data; 
     307                        select_available_maillists.outerHTML = select_available_maillists.outerHTML; 
    400308                        select_available_maillists_clone = select_available_maillists.cloneNode(true); 
    401309                        document.getElementById('ea_input_searchMailList').value = ''; 
    402310                } 
    403         }        
    404                  
     311                else 
     312                { 
     313                        // Necessario, pois o IE6 tem um bug que retira o primeiro options se o innerHTML estiver vazio. 
     314                        select_available_maillists.innerHTML = '#'; 
     315                        select_available_maillists.outerHTML = select_available_maillists.outerHTML; 
     316                } 
     317        } 
    405318        cExecute ('$this.ldap_functions.get_available_maillists&context='+context, handler_get_available_maillists); 
    406319} 
     
    663576        } 
    664577        oWait.innerHTML = '&nbsp;'; 
    665 }                        
     578} 
     579 
     580function get_available_sambadomains(context, type) 
     581{ 
     582        if ((type == 'create_user') && (document.getElementById('tabcontent6').style.display != 'none')) 
     583        { 
     584                var handler_get_available_sambadomains = function(data) 
     585                { 
     586                        document.forms[0].use_attrs_samba.checked = data.status; 
     587                        use_samba_attrs(data.status); 
     588                         
     589                        if (data.status) 
     590                        { 
     591                                combo_sambadomains = document.getElementById('ea_combo_sambadomains'); 
     592                                for (i=0; i<data.sambaDomains.length; i++) 
     593                                { 
     594                                        for (j=0; j<combo_sambadomains.length; j++) 
     595                                        { 
     596                                                if (combo_sambadomains.options[j].text == data.sambaDomains[i]) 
     597                                                { 
     598                                                        combo_sambadomains.options[j].selected = true; 
     599                                                        break; 
     600                                                } 
     601                                        } 
     602                                } 
     603                                 
     604                        } 
     605                } 
     606                cExecute ('$this.ldap_functions.exist_sambadomains_in_context&context='+context, handler_get_available_sambadomains); 
     607        } 
     608} 
Note: See TracChangeset for help on using the changeset viewer.