Index: trunk/contactcenter/js/cc.js
===================================================================
--- trunk/contactcenter/js/cc.js	(revision 503)
+++ trunk/contactcenter/js/cc.js	(revision 752)
@@ -188,5 +188,5 @@
 function editSharedContact (id){
 	openFullAdd();
-	populateFullEdit(id,'bo_shared_catalog_manager');
+	populateFullEdit(id,'bo_shared_people_manager');
 }
 /************ Edit Group *************/
@@ -194,4 +194,9 @@
 	populateEditGroup(id);	
 }
+
+function editSharedGroup(id){
+	populateEditGroup(id, 'shared');	
+}
+
 /*
 	Updates all the constant fields in the
@@ -317,6 +322,6 @@
 		options_contact_list.innerHTML = select_contact_list;
 
-		if(data['id_group']) {
-		
+		if(data['id_group']) {		
+			Element('title').value =  data['title'];
 			if(data['contact_in_list']) {					
 				for(i = 0; i < data['contact_in_list'].length; i++) {				
@@ -325,8 +330,6 @@
 					option.text = data['contact_in_list'][i]['names_ordered']+' ('+data['contact_in_list'][i]['connection_value']+')';				
 					Element('contact_in_list').options[Element('contact_in_list').options.length] = option;
-				}
-			}		
-			
-			Element('title').value =  data['title'];
+				}		
+			}
 		}
 				
@@ -341,5 +344,5 @@
 	id = typeof(id) == 'undefined' ? id = 0 :  id;
 	
-	ccAddGroup.clear(true);			
+	ccAddGroup.clear(true);				
 	Connector.newRequest('populateEditGroup', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_group&id='+id, 'GET', handler);
 }
@@ -1850,6 +1853,6 @@
 	}
 	
-	if(type == 'groups')
-		return populateGroupsInCards(data);
+	if(type == 'groups' || type == 'shared_groups')
+		return populateGroupsInCards(data,type);
 	
 	var pos = 0;
@@ -1904,4 +1907,6 @@
 									Element(id+':'+data[2][k]).innerHTML = data[3][pos][k];
 								}
+								if(data[3][pos][9])
+									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>";	
 								break;
 							
@@ -1973,6 +1978,6 @@
 						}
 					}
-				}
-				if (type == "shared") {
+				}				
+				if (type == "shared_contacts") {
 					if (data[3][pos][8] & 4) 
 						eval("document.getElementById(id + ':cc_card_edit').onclick = function(){editSharedContact(Element('"+id+"' + ':cc_id').value);};");
@@ -1988,4 +1993,7 @@
 						};
 				}
+				
+				
+				
 				if (--ncards == 0)
 				{
@@ -2000,5 +2008,5 @@
 }
 
-function populateGroupsInCards(data)
+function populateGroupsInCards(data,type)
 {	
 	var pos = 0;
@@ -2032,4 +2040,6 @@
 									Element(id+':'+data[2][k]).innerHTML = data[3][pos][k];
 								}
+								if(data[3][pos][5])
+									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>";
 								break;
 							
@@ -2037,10 +2047,10 @@
 								if (data[3][pos][k].length > (CC_visual == 'table'  ? 50 : 20))
 								{
-									Element(id+':'+data[2][k]).innerHTML = data[5] + ''+data[3][pos][k] +'\')">'+adjustString(data[3][pos][k], (CC_visual == 'table'  ? 50 : 20))+'</span>';
+									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>';
 									Element(id+':'+data[2][k]).title = data[3][pos][k];
 								}
 								else
 								{
-									Element(id+':'+data[2][k]).innerHTML = data[5] + ''+data[3][pos][k] + '\')">'+data[3][pos][k]+'</span>';
+									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>';
 								}
 								break;
@@ -2073,4 +2083,21 @@
 				}
 	
+				if (type == "shared_groups") {
+					/* Edição de grupos compartilhados está com problema. Desabilitado temporariamente.
+					if (data[3][pos][4] & 4)
+						eval("document.getElementById(id + ':cc_card_edit').onclick = function(){editSharedGroup(Element('"+id+"' + ':cc_id').value);};");
+					else
+					*/ 
+					document.getElementById(id + ':cc_card_edit').onclick = function(){	alert(Element('cc_msg_unavailable').value); };
+					
+					if (data[3][pos][4] & 8) 
+						eval("document.getElementById(id + ':cc_card_remove').onclick = function(){removeEntry(Element('" + id + "' + ':cc_id').value,'groups');};");
+					else 
+						document.getElementById(id + ':cc_card_remove').onclick = function(){
+							alert(Element('cc_msg_not_allowed').value);
+						};
+				}				
+				
+				
 				if (--ncards == 0)
 				{
@@ -2139,5 +2166,5 @@
 function getCardHTML (id, type)
 {
-		if(type == 'groups') {
+		if(type == 'groups' || type == 'shared_groups') {
 			html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' +
             '<div style="border: 0px solid #999; position: relative;">' + 
@@ -2147,5 +2174,5 @@
 				'<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>' +
 				'<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 15px; left: 15px"></span>' +
-				'<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>' +
+				'<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>' +
 				'<input id="' + id + ':cc_id" type="hidden">' +
 			'</div>' + '</td>';
@@ -2184,9 +2211,9 @@
 			else
 				bg = "this.style.background=\'#EEEEEE\'";
-			if(type == 'groups') {
+			if(type == 'groups' || type == 'shared_groups') {
 				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;">' +
 					'<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1"></span>' +
 					'<span id="' + id + ':cc_title"></span></td>' +
-					'<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>' +
+					'<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>' +
 					'<td align="left" width="55px">'+
 					'<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">' +
@@ -2201,5 +2228,5 @@
 				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;">' +					
 					'<span valign="bottom" id="' + id + ':cc_icon_group">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="' + id + ':cc_name"></span></td>' +
-					'<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>' +
+					'<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>' +
 					'<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' +		
 					( ccTree.catalog_perms == 1 ?
@@ -2245,5 +2272,5 @@
 			html_cards += '';
 		}
-		if((ccTree.catalog_perms & 2) && type != 'groups' && type!='shared')
+		if((ccTree.catalog_perms & 2) && type != 'groups' && type !='shared_contacts' && type !='shared_groups')
 			html_cards += '<tr><td colspan=4 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>';
 	}	
@@ -2284,5 +2311,5 @@
 			html_cards += '</tr>';
 		}
-		if((ccTree.catalog_perms & 2) && type != 'groups' && type!='shared')
+		if((ccTree.catalog_perms & 2) && type != 'groups' && type !='shared_contacts' && type !='shared_groups')
 			html_cards += '<tr><td colspan=3 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>';
 	}	
