Changeset 752 for trunk/contactcenter/js


Ignore:
Timestamp:
04/17/09 16:34:36 (15 years ago)
Author:
niltonneto
Message:

Resolve #453 e #454 (duplicado).

File:
1 edited

Legend:

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

    r503 r752  
    188188function editSharedContact (id){ 
    189189        openFullAdd(); 
    190         populateFullEdit(id,'bo_shared_catalog_manager'); 
     190        populateFullEdit(id,'bo_shared_people_manager'); 
    191191} 
    192192/************ Edit Group *************/ 
     
    194194        populateEditGroup(id);   
    195195} 
     196 
     197function editSharedGroup(id){ 
     198        populateEditGroup(id, 'shared');         
     199} 
     200 
    196201/* 
    197202        Updates all the constant fields in the 
     
    317322                options_contact_list.innerHTML = select_contact_list; 
    318323 
    319                 if(data['id_group']) { 
    320                  
     324                if(data['id_group']) {           
     325                        Element('title').value =  data['title']; 
    321326                        if(data['contact_in_list']) {                                    
    322327                                for(i = 0; i < data['contact_in_list'].length; i++) {                            
     
    325330                                        option.text = data['contact_in_list'][i]['names_ordered']+' ('+data['contact_in_list'][i]['connection_value']+')';                               
    326331                                        Element('contact_in_list').options[Element('contact_in_list').options.length] = option; 
    327                                 } 
    328                         }                
    329                          
    330                         Element('title').value =  data['title']; 
     332                                }                
     333                        } 
    331334                } 
    332335                                 
     
    341344        id = typeof(id) == 'undefined' ? id = 0 :  id; 
    342345         
    343         ccAddGroup.clear(true);                  
     346        ccAddGroup.clear(true);                          
    344347        Connector.newRequest('populateEditGroup', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_group&id='+id, 'GET', handler); 
    345348} 
     
    18501853        } 
    18511854         
    1852         if(type == 'groups') 
    1853                 return populateGroupsInCards(data); 
     1855        if(type == 'groups' || type == 'shared_groups') 
     1856                return populateGroupsInCards(data,type); 
    18541857         
    18551858        var pos = 0; 
     
    19041907                                                                        Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 
    19051908                                                                } 
     1909                                                                if(data[3][pos][9]) 
     1910                                                                        Element(id+':'+data[2][k]).innerHTML += "<br><span style='margin-left:30px'><font size='-2' color='#808080'><i>"+data[3][pos][9]+"</i></font></span>";   
    19061911                                                                break; 
    19071912                                                         
     
    19731978                                                } 
    19741979                                        } 
    1975                                 } 
    1976                                 if (type == "shared") { 
     1980                                }                                
     1981                                if (type == "shared_contacts") { 
    19771982                                        if (data[3][pos][8] & 4)  
    19781983                                                eval("document.getElementById(id + ':cc_card_edit').onclick = function(){editSharedContact(Element('"+id+"' + ':cc_id').value);};"); 
     
    19881993                                                }; 
    19891994                                } 
     1995                                 
     1996                                 
     1997                                 
    19901998                                if (--ncards == 0) 
    19911999                                { 
     
    20002008} 
    20012009 
    2002 function populateGroupsInCards(data) 
     2010function populateGroupsInCards(data,type) 
    20032011{        
    20042012        var pos = 0; 
     
    20322040                                                                        Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 
    20332041                                                                } 
     2042                                                                if(data[3][pos][5]) 
     2043                                                                        Element(id+':'+data[2][k]).innerHTML += "<br><span style='margin-left:30px'><font size='-2' color='#808080'><i>"+data[3][pos][5]+"</i></font></span>"; 
    20342044                                                                break; 
    20352045                                                         
     
    20372047                                                                if (data[3][pos][k].length > (CC_visual == 'table'  ? 50 : 20)) 
    20382048                                                                { 
    2039                                                                         Element(id+':'+data[2][k]).innerHTML = data[5] + ''+data[3][pos][k] +'\')">'+adjustString(data[3][pos][k], (CC_visual == 'table'  ? 50 : 20))+'</span>'; 
     2049                                                                        Element(id+':'+data[2][k]).innerHTML = data[5] + ''+data[3][pos][k]+'::'+data[3][pos][6] +'\')">'+adjustString(data[3][pos][k], (CC_visual == 'table'  ? 50 : 20))+'</span>'; 
    20402050                                                                        Element(id+':'+data[2][k]).title = data[3][pos][k]; 
    20412051                                                                } 
    20422052                                                                else 
    20432053                                                                { 
    2044                                                                         Element(id+':'+data[2][k]).innerHTML = data[5] + ''+data[3][pos][k] + '\')">'+data[3][pos][k]+'</span>'; 
     2054                                                                        Element(id+':'+data[2][k]).innerHTML = data[5] + ''+data[3][pos][k]+(data[3][pos][6] ? '::'+data[3][pos][6] : "") + '\')">'+data[3][pos][k]+'</span>'; 
    20452055                                                                } 
    20462056                                                                break; 
     
    20732083                                } 
    20742084         
     2085                                if (type == "shared_groups") { 
     2086                                        /* Edição de grupos compartilhados está com problema. Desabilitado temporariamente. 
     2087                                        if (data[3][pos][4] & 4) 
     2088                                                eval("document.getElementById(id + ':cc_card_edit').onclick = function(){editSharedGroup(Element('"+id+"' + ':cc_id').value);};"); 
     2089                                        else 
     2090                                        */  
     2091                                        document.getElementById(id + ':cc_card_edit').onclick = function(){     alert(Element('cc_msg_unavailable').value); }; 
     2092                                         
     2093                                        if (data[3][pos][4] & 8)  
     2094                                                eval("document.getElementById(id + ':cc_card_remove').onclick = function(){removeEntry(Element('" + id + "' + ':cc_id').value,'groups');};"); 
     2095                                        else  
     2096                                                document.getElementById(id + ':cc_card_remove').onclick = function(){ 
     2097                                                        alert(Element('cc_msg_not_allowed').value); 
     2098                                                }; 
     2099                                }                                
     2100                                 
     2101                                 
    20752102                                if (--ncards == 0) 
    20762103                                { 
     
    21392166function getCardHTML (id, type) 
    21402167{ 
    2141                 if(type == 'groups') { 
     2168                if(type == 'groups' || type == 'shared_groups') { 
    21422169                        html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 
    21432170            '<div style="border: 0px solid #999; position: relative;">' +  
     
    21472174                                '<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>' + 
    21482175                                '<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>' + 
     2176                                '<span onMouseOver="this.title = \''+Element('cc_send_mail').value+'\'" 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>' + 
    21502177                                '<input id="' + id + ':cc_id" type="hidden">' + 
    21512178                        '</div>' + '</td>'; 
     
    21842211                        else 
    21852212                                bg = "this.style.background=\'#EEEEEE\'"; 
    2186                         if(type == 'groups') { 
     2213                        if(type == 'groups' || type == 'shared_groups') { 
    21872214                                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;">' + 
    21882215                                        '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1"></span>' + 
    21892216                                        '<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>' + 
     2217                                        '<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+'\'"  id="' + id + ':cc_short_name"></span></td>' + 
    21912218                                        '<td align="left" width="55px">'+ 
    21922219                                        '<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">' + 
     
    22012228                                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;">' +                                        
    22022229                                        '<span valign="bottom" id="' + id + ':cc_icon_group">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="' + id + ':cc_name"></span></td>' + 
    2203                                         '<td 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_name\').innerHTML" id="' + id + ':cc_mail"></span></td>' + 
     2230                                        '<td style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+'\'" id="' + id + ':cc_mail"></span></td>' + 
    22042231                                        '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' +          
    22052232                                        ( ccTree.catalog_perms == 1 ? 
     
    22452272                        html_cards += ''; 
    22462273                } 
    2247                 if((ccTree.catalog_perms & 2) && type != 'groups' && type!='shared') 
     2274                if((ccTree.catalog_perms & 2) && type != 'groups' && type !='shared_contacts' && type !='shared_groups') 
    22482275                        html_cards += '<tr><td colspan=4 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 
    22492276        }        
     
    22842311                        html_cards += '</tr>'; 
    22852312                } 
    2286                 if((ccTree.catalog_perms & 2) && type != 'groups' && type!='shared') 
     2313                if((ccTree.catalog_perms & 2) && type != 'groups' && type !='shared_contacts' && type !='shared_groups') 
    22872314                        html_cards += '<tr><td colspan=3 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 
    22882315        }        
Note: See TracChangeset for help on using the changeset viewer.