Skip to content

Commit

Permalink
changes for ICPCO-200
Browse files Browse the repository at this point in the history
  • Loading branch information
axel committed Nov 11, 2021
1 parent 72aeace commit 01d79fa
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions Model/GrouperGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 01d79fa

Please sign in to comment.