diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index d5ebae4..86a4aa0 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -157,9 +157,10 @@ public function filteredMemberOfGroups(array $conditions) { $this->initApi(); try { - $conditions['groupType'] = 'optouts'; + $memberOfGroups = $this->memberOfGroups($conditions); + $conditions['groupType'] = 'optouts'; // Determine which groups can be left by user, if want. $optOutGroups = $this->grouperAPI->getOptionalGroups($conditions); @@ -824,28 +825,10 @@ private function getFriendlyWorkingGroupName(array $groups, $method) { */ private function getFriendlyName(array $groups) { - //NOT fetching attributes now, just using name display name as friendly name, if different from name field -// foreach ($groups as &$group) { -// //$group['friendlyName'] = $group['displayName']; -// $nameSections = explode(':', $group['name']); -// $friendlySections = explode(':', $group['displayName']); -// $numberNameSections = count($nameSections); -// for ($x = 0; $x < $numberNameSections; $x++) { -// if ($nameSections[$x] == $friendlySections[$x]) { -// unset($friendlySections[$x]); -// } else { -// break; -// } -// } -// $group['friendlyName'] = implode(':', $friendlySections); -// if (strlen($group['friendlyName']) == 0) { -// $group['friendlyName'] = $group['name']; -// } -// } - - //TODO - For now just returning Display name as Friendly name, till determined by Bill K. + //According to Jira ICPCO-200, will only display the last section of the stem in UI and then hover over for rest. foreach ($groups as &$group) { - $group['friendlyName'] = $group['displayName']; + $friendlySections = explode(':', $group['displayName']); + $group['friendlyName'] = end($friendlySections); } return $groups;