Index: branches/2.2/phpgwapi/inc/class.acl.inc.php
===================================================================
--- branches/2.2/phpgwapi/inc/class.acl.inc.php	(revision 1280)
+++ branches/2.2/phpgwapi/inc/class.acl.inc.php	(revision 3335)
@@ -634,4 +634,30 @@
 		}
 		
+		function get_rights_and_owners($user,$appname = False)
+		{
+			
+			if (!$appname) $appname = $GLOBALS['phpgw_info']['flags']['currentapp'];
+
+			if (!count($this->data) && $GLOBALS['phpgw_info']['server']['acl_default'] != 'deny')
+			{
+				return True;
+			}
+			
+			$db2 = clone($this->db);
+			$db2->select($this->table_name,array('acl_account','acl_rights'),array(
+				'acl_appname'  => $appname,
+				'acl_location' => $user,
+			),__LINE__,__FILE__);
+			$return = array();
+			while ($db2->next_record())
+			{
+				$return[] = array(
+					'acl_rights' => $db2->f('acl_rights'),
+					'acl_account' =>  $db2->f('acl_account')
+					);				
+			}
+			return $return;
+		}
+		
 		/**
 		 * Deletes all ACL entries for an account (user or group)
Index: branches/2.2/contactcenter/inc/class.ui_data.inc.php
===================================================================
--- branches/2.2/contactcenter/inc/class.ui_data.inc.php	(revision 3334)
+++ branches/2.2/contactcenter/inc/class.ui_data.inc.php	(revision 3335)
@@ -440,4 +440,7 @@
 				case 'get_qtds_compartilhado':
 					return $this->get_qtds_compartilhado();
+				case 'get_list_owners_perms_add':
+					echo $this->get_list_owners_perms_add();
+					return;
 
 			}
@@ -1589,4 +1592,34 @@
 			echo serialize($final);
 		}
+		
+		
+		function get_list_owners_perms_add(){
+			$acl = CreateObject('phpgwapi.acl');
+			$find_result = $acl->get_rights_and_owners($GLOBALS['phpgw_info']['user']['account_id'],'contactcenter');
+			if($find_result){
+				$owner_names = array();
+				$filter = "(|";
+				foreach($find_result as $owner) {
+					if(($owner['acl_rights'] & PHPGW_ACL_ADD) == PHPGW_ACL_ADD){
+						$filter .= "(uidNumber=".$owner['acl_account'].")";
+					}
+				}
+				if(!$this->bo->catalog->src_info) {
+					$ldap = CreateObject('contactcenter.bo_ldap_manager');
+					$this->bo->catalog->src_info = $ldap->srcs[1];
+				}
+				$ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], false);
+				$filter .= ")";
+				$dn=$this->bo->catalog->src_info['dn'];
+				$justThese = array("cn","uidnumber","uid");
+				$sr = ldap_search($ds,$dn, $filter,$justThese);
+				$info = ldap_get_entries($ds, $sr);
+				for($z = 0; $z < $info['count']; $z++) {
+					$owner_names[$info[$z]['uidnumber'][0]] = array("cn" => $info[$z]['cn'][0], "uid" => $info[$z]['uid'][0]);
+				}
+				ldap_close($ds);
+			}
+			echo serialize ($owner_names);	
+		}
 
 		function get_visible_all_ldap()
Index: branches/2.2/contactcenter/js/cc.js
===================================================================
--- branches/2.2/contactcenter/js/cc.js	(revision 3315)
+++ branches/2.2/contactcenter/js/cc.js	(revision 3335)
@@ -261,37 +261,25 @@
         var handler = function(responseText)
         {
-                var data = unserialize(responseText);
-		var sharers = Element('cc_contact_shared_types');
+        	var data = unserialize(responseText);
+			var sharers = Element('cc_contact_shared_types');
 
 	        if (typeof(data) != 'object')
-                {
-                        showMessage(Element('cc_msg_err_contacting_server').value);
-                        return;
-                }
-
-		if (typeof(data[3]) == 'object')
-                {
-			sharers.disabled = false;
-			var i = 1;
-			if (data[6].length != 0)
-			{
-				for (var j in data[6])
+            {
+                showMessage(Element('cc_msg_err_contacting_server').value);
+                fullAddWin.close();
+				return;
+            }else{
+				sharers.disabled = false;
+				j = 1;
+				for (var i in data)
 				{
-					sharers.options[i] = new Option(data[6][j]['cn'], j);
-					owners[i] = j;
-					i++;
+						sharers.options[j] = new Option(data[i]['cn'], i);
+						owners[j] = i;
+						j++;
 				}
-			} else
-				sharers.disabled = true;
-			return;
-                } else
-		{
-			showMessage(Element('cc_msg_err_contacting_server').value);
-			fullAddWin.close();
-			return;
-		}
-
+				return;
+	         }
         };
-	Connector.newRequest('populateSharingSelect', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cards_data', 'POST', handler);
+	Connector.newRequest('populateSharingSelect', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_list_owners_perms_add', 'POST', handler);
 }
 
