Ignore:
Timestamp:
10/01/08 16:46:55 (16 years ago)
Author:
niltonneto
Message:

Implementação para trazer os contatos compartilhados.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/contactcenter/js/cc.js

    r294 r503  
    184184function editContact (id){ 
    185185        openFullAdd(); 
    186         populateFullEdit(id); 
     186        populateFullEdit(id,'bo_people_catalog'); 
     187} 
     188function editSharedContact (id){ 
     189        openFullAdd(); 
     190        populateFullEdit(id,'bo_shared_catalog_manager'); 
    187191} 
    188192/************ Edit Group *************/ 
     
    277281} 
    278282 
    279 function populateFullEdit (id) 
     283function populateFullEdit (id,catalog) 
    280284{ 
    281285        var handler = function(responseText) 
     
    298302        }; 
    299303 
    300         Connector.newRequest('populateFullEdit', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_full_data&id=' + id, 'GET', handler); 
     304        Connector.newRequest('populateFullEdit', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_full_data&id=' + id + "&catalog="+catalog, 'GET', handler); 
    301305} 
    302306 
     
    19701974                                        } 
    19711975                                } 
    1972          
     1976                                if (type == "shared") { 
     1977                                        if (data[3][pos][8] & 4)  
     1978                                                eval("document.getElementById(id + ':cc_card_edit').onclick = function(){editSharedContact(Element('"+id+"' + ':cc_id').value);};"); 
     1979                                        else  
     1980                                                document.getElementById(id + ':cc_card_edit').onclick = function(){ 
     1981                                                        alert(Element('cc_msg_not_allowed').value); 
     1982                                                }; 
     1983                                        if (data[3][pos][8] & 8)  
     1984                                                eval("document.getElementById(id + ':cc_card_remove').onclick = function(){removeEntry(Element('" + id + "' + ':cc_id').value);};"); 
     1985                                        else  
     1986                                                document.getElementById(id + ':cc_card_remove').onclick = function(){ 
     1987                                                        alert(Element('cc_msg_not_allowed').value); 
     1988                                                }; 
     1989                                } 
    19731990                                if (--ncards == 0) 
    19741991                                { 
     
    21222139function getCardHTML (id, type) 
    21232140{ 
    2124                 if(type != 'groups') { 
    2125                  
     2141                if(type == 'groups') { 
     2142                        html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 
     2143            '<div style="border: 0px solid #999; position: relative;">' +  
     2144                                '<img src="templates/default/images/card.png" border="0" width="' + CC_card_image_width +'" height="' + CC_card_image_height + '"i ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 
     2145                                '<img title="'+Element('cc_msg_group_edit').value+'" id="' + id + ':cc_card_edit" style="position: absolute; top: 35px; left: 222px; width: 18px; height: 18px; cursor: pointer; cursor: hand; z-index: 1" onclick="editGroup(Element(\'' + id + ':cc_id\').value);" onmouseover="resizeIcon(\''+id+':cc_card_edit\',0)" onmouseout="resizeIcon(\''+id+':cc_card_edit\',1)" src="templates/default/images/cc_card_edit.png">' + 
     2146                                '<img title="'+Element('cc_msg_group_remove').value+'" id="' + id + ':cc_card_remove" style="position: absolute; top: 78px; left: 223px; width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value,\'groups\');" onmouseover="resizeIcon(\''+id+':cc_card_remove\',0)" onmouseout="resizeIcon(\''+id+':cc_card_remove\',1)" src="templates/default/images/cc_x.png">' +  
     2147                                '<span id="' + id + ':cc_title" style="position: absolute; top: 30px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 10px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_name_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_name_full\').style.visibility=\'hidden\'"></span>' + 
     2148                                '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 15px; left: 15px"></span>' + 
     2149                                '<span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_title\').innerHTML" id="' + id + ':cc_short_name" style="position: absolute; top: 105px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 
     2150                                '<input id="' + id + ':cc_id" type="hidden">' + 
     2151                        '</div>' + '</td>'; 
     2152                 
     2153                } 
     2154                else { 
    21262155                        html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 
    21272156                                '<div style="border: 0px solid #999; position: relative;">' + 
     
    21422171                                        '<input id="' + id + ':cc_id" type="hidden">' + 
    21432172                                '</div>' + '</td>'; 
    2144                  
    2145                 } else { 
    2146                         html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 
    2147             '<div style="border: 0px solid #999; position: relative;">' +  
    2148                                 '<img src="templates/default/images/card.png" border="0" width="' + CC_card_image_width +'" height="' + CC_card_image_height + '"i ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 
    2149                                 '<img title="'+Element('cc_msg_group_edit').value+'" id="' + id + ':cc_card_edit" style="position: absolute; top: 35px; left: 222px; width: 18px; height: 18px; cursor: pointer; cursor: hand; z-index: 1" onclick="editGroup(Element(\'' + id + ':cc_id\').value);" onmouseover="resizeIcon(\''+id+':cc_card_edit\',0)" onmouseout="resizeIcon(\''+id+':cc_card_edit\',1)" src="templates/default/images/cc_card_edit.png">' + 
    2150                                 '<img title="'+Element('cc_msg_group_remove').value+'" id="' + id + ':cc_card_remove" style="position: absolute; top: 78px; left: 223px; width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value,\'groups\');" onmouseover="resizeIcon(\''+id+':cc_card_remove\',0)" onmouseout="resizeIcon(\''+id+':cc_card_remove\',1)" src="templates/default/images/cc_x.png">' +  
    2151                                 '<span id="' + id + ':cc_title" style="position: absolute; top: 30px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 10px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_name_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_name_full\').style.visibility=\'hidden\'"></span>' + 
    2152                                 '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 15px; left: 15px"></span>' + 
    2153                                 '<span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_title\').innerHTML" id="' + id + ':cc_short_name" style="position: absolute; top: 105px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 
    2154                                 '<input id="' + id + ':cc_id" type="hidden">' + 
    2155                         '</div>' + '</td>'; 
    21562173                } 
    21572174         
     
    21672184                        else 
    21682185                                bg = "this.style.background=\'#EEEEEE\'"; 
     2186                        if(type == 'groups') { 
     2187                                html_card = '<tr width="40%" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE"><td width="auto" style="font-weight: normal; font-size: 10px; text-align: left; height: 10px;">' + 
     2188                                        '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1"></span>' + 
     2189                                        '<span id="' + id + ':cc_title"></span></td>' + 
     2190                                        '<td width="40%" style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_title\').innerHTML"  id="' + id + ':cc_short_name"></span></td>' + 
     2191                                        '<td align="left" width="55px">'+ 
     2192                                        '<img  title="'+Element('cc_msg_group_edit').value+'" id="' + id + ':cc_card_edit" style=" cursor: pointer; cursor: hand; z-index: 1;width: 18px; height: 18px;"  onclick="editGroup(Element(\'' + id + ':cc_id\').value);" src="templates/default/images/cc_card_edit.png">' + 
     2193                                        '&nbsp;&nbsp;|&nbsp;&nbsp;'+ 
     2194                                        '<img  title="'+Element('cc_msg_group_remove').value+'" id="' + id + ':cc_card_remove" style="width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value,\'groups\');" src="templates/default/images/cc_x.png">'  + 
     2195                                        '<input id="' + id + ':cc_id" type="hidden">'+                                                                           
     2196                                        '</td></tr>'; 
    21692197                                                 
    2170                         if(type != 'groups') { 
    21712198                         
     2199                        } 
     2200                        else { 
    21722201                                html_card = '<tr  style="height:20px" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE"><td width="auto" style="font-weight: normal; font-size: 10px; text-align: left; height: 10px;">' +                                        
    21732202                                        '<span valign="bottom" id="' + id + ':cc_icon_group">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="' + id + ':cc_name"></span></td>' + 
     
    21892218                                        '</td></tr>'; 
    21902219                        } 
    2191                         else { 
    2192                                 html_card = '<tr width="40%" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE"><td width="auto" style="font-weight: normal; font-size: 10px; text-align: left; height: 10px;">' + 
    2193                                         '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1"></span>' + 
    2194                                         '<span id="' + id + ':cc_title"></span></td>' + 
    2195                                         '<td width="40%" style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_title\').innerHTML"  id="' + id + ':cc_short_name"></span></td>' + 
    2196                                         '<td align="left" width="55px">'+ 
    2197                                         '<img  title="'+Element('cc_msg_group_edit').value+'" id="' + id + ':cc_card_edit" style=" cursor: pointer; cursor: hand; z-index: 1;width: 18px; height: 18px;"  onclick="editGroup(Element(\'' + id + ':cc_id\').value);" src="templates/default/images/cc_card_edit.png">' + 
    2198                                         '&nbsp;&nbsp;|&nbsp;&nbsp;'+ 
    2199                                         '<img  title="'+Element('cc_msg_group_remove').value+'" id="' + id + ':cc_card_remove" style="width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value,\'groups\');" src="templates/default/images/cc_x.png">'  + 
    2200                                         '<input id="' + id + ':cc_id" type="hidden">'+                                                                           
    2201                                         '</td></tr>'; 
    2202                         } 
    22032220 
    22042221        return html_card; 
     
    22282245                        html_cards += ''; 
    22292246                } 
    2230                 if((ccTree.catalog_perms & 2) && type != 'groups') 
     2247                if((ccTree.catalog_perms & 2) && type != 'groups' && type!='shared') 
    22312248                        html_cards += '<tr><td colspan=4 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 
    22322249        }        
     
    22672284                        html_cards += '</tr>'; 
    22682285                } 
    2269                 if((ccTree.catalog_perms & 2) && type != 'groups') 
     2286                if((ccTree.catalog_perms & 2) && type != 'groups' && type!='shared') 
    22702287                        html_cards += '<tr><td colspan=3 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 
    22712288        }        
Note: See TracChangeset for help on using the changeset viewer.