Ignore:
Timestamp:
04/06/10 18:13:32 (14 years ago)
Author:
alexandrecorreia
Message:

Ticket #986 - Adicao de contatos com resultados da busca do ldap e exclusao de contatos da lista.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/jabberit_messenger/trophy_expresso/js/AddUser.js

    r2421 r2437  
    44                var conn        = null;  
    55         
    6                 function addContacts() 
     6                function addContact() 
    77                { 
    88                        var jidFrom             = loadIM.getUserCurrent().jid; 
     
    1111                        var group               = document.getElementById('user_group_jabberIM').value; 
    1212                         
    13                         alert( jidFrom + "\n" + jidTo + "\n" + name + "\n" + group ); 
    14                          
    15                         //TrophyIM.addContacts( jidFrom, jidTo, name, group ); 
    16                          
     13                        TrophyIM.addContact( jidFrom, jidTo, name, group ); 
     14                         
     15                        _winBuild('add_user_info','remove'); 
    1716                } 
    1817                 
     
    7473                        var element             = ( Element.target ) ? Element.target : Element.srcElement; 
    7574                        var infoUser    = null;          
     75                        var img                 = document.createElement('img'); 
    7676                         
    7777                        if( element.getAttribute('value') ) 
     
    8585                                        'group'                         : element.getAttribute('ou'), 
    8686                                        'name'                          : element.getAttribute('name').substring( 0, element.getAttribute('name').indexOf(' ')), 
     87                                        'ou'                            : element.getAttribute('ou'), 
     88                                        'selectBoxOptions'      : "grupo1; grupo2; grupo3", 
    8789                                        'uid'                           : element.getAttribute('value').substring( element.getAttribute('value').indexOf(';') + 1 ) 
    8890                                }; 
     
    9799                                        'lang_name_contact'     : "Contato",                                     
    98100                                        'group'                         : element.parentNode.getAttribute('ou'), 
    99                                         'name'                          : element.parentNode.getAttribute('name').substring( 0, element.parentNode.getAttribute('name').indexOf(' ')),                                   
     101                                        'name'                          : element.parentNode.getAttribute('name').substring( 0, element.parentNode.getAttribute('name').indexOf(' ')), 
     102                                        'ou'                            : element.parentNode.getAttribute('ou'), 
     103                                        'selectBoxOptions'      : "grupo1; grupo2; grupo3", 
    100104                                        'uid'                           : element.parentNode.getAttribute('value').substring( element.parentNode.getAttribute('value').indexOf(';') + 1) 
    101105                                }; 
     
    105109                        {  
    106110                                        id_window        : "add_user_info", 
    107                                         width            : 355, 
     111                                        width            : 370, 
    108112                                        height           : 190, 
    109113                                        top                      : 85, 
     
    126130                                'lang2'                 : 'Fechar', 
    127131                                'onclickClose'  : '_winBuild("' + winAddUser.id_window + '","remove");', 
    128                                 'onclickSubmit' : 'loadIM.addContacts(this);' 
     132                                'onclickSubmit' : 'loadIM.addContact(this);' 
    129133                        };  
    130134 
    131                         document.getElementById('buttons_adduser').innerHTML = Xtools.parse(Xtools.xml('buttons_main'), 'buttons.xsl', _pButtons);  
     135                        // Add Buttons 
     136                        document.getElementById('buttons_adduser').innerHTML = Xtools.parse(Xtools.xml('buttons_main'), 'buttons.xsl', _pButtons); 
     137                         
     138                        // Select Editable 
     139                        loadIM.setSelectEditable(document.getElementById('user_group_jabberIM')); 
     140                         
     141                        if( element.style.backgroundImage ) 
     142                        { 
     143                                var _img = element.cloneNode( false ); 
     144                                _img.style.width        = '60px'; 
     145                                _img.style.height       = '80px'; 
     146                                _img.style.display      = 'block'; 
     147                                _img.style.backgroundRepeat = 'no-repeat'; 
     148                                                         
     149                        } 
     150                        else 
     151                        { 
     152                                var _img = document.createElement("img"); 
     153                                _img.style.width        = '60px'; 
     154                                _img.style.height       = '80px'; 
     155                                _img.style.display      = 'block'; 
     156                                _img.src                        = path_jabberit + "templates/default/images/photo.png"; 
     157                        } 
     158                         
     159                        with ( document.getElementById('photo_user_ldap_jabber') ) 
     160                        { 
     161                                if( hasChildNodes( ) ) 
     162                                        while( hasChildNodes( ) ) 
     163                                        { 
     164                                                removeNode( firstChild ); 
     165                                        } 
     166                                 
     167                                appendChild( _img ); 
     168                        } 
     169                         
    132170                } 
    133171                 
     
    160198                         
    161199                        _winBuild( windAddUser ); 
     200                         
    162201                } 
    163202         
     
    171210                } 
    172211 
    173                 loadAddUser.prototype.add               = addContacts; 
     212                loadAddUser.prototype.add               = addContact; 
    174213                loadAddUser.prototype.search    = search; 
    175214                loadAddUser.prototype.show              = showForm; 
Note: See TracChangeset for help on using the changeset viewer.