diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index 7558152..d286cf3 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -59,7 +59,7 @@ class GrouperGroup extends GrouperLiteAppModel 'app:sympa:internet2', 'app:sympa:incommon', 'ref:incommon-collab', - 'ref:Internet2-collab' + 'ref:internet2-collab' ); //Stem for email groups, only email groups using this stem are viewable @@ -622,10 +622,9 @@ private function getFriendlyWorkingGroupName(array $groups, $method) $len = strlen($stem); if (substr(strtolower($group['name']), 0, $len) === $stem) { $stemSections = explode(':', $group['name']); - //Get second to last stem section - $sectionCount = count($stemSections) - 2; - if (in_array($stemSections[$sectionCount], $topLevelWG) === false) { - $topLevelWG[] = $stemSections[$sectionCount]; + //Get third section, since will always by after ref:something:here + if (in_array($stemSections[2], $topLevelWG) === false) { + $topLevelWG[] = $stemSections[2]; } } } @@ -638,13 +637,15 @@ private function getFriendlyWorkingGroupName(array $groups, $method) // if match to name of group within WG mapping then start making a WG group array if (substr(strtolower($group['name']), 0, $len) === $stem) { $stemSections = explode(':', $group['name']); + $displaySections = explode(':', $group['displayName']); //Get second to last stem section - $sectionCount = count($stemSections) - 2; + $sectionCount = 2; //If group not part of a top level WG, then do not show! if (in_array($stemSections[$sectionCount], $topLevelWG) === false) { break; } $group['WGName'] = $stemSections[$sectionCount]; + $group['WGShowName'] = $displaySections[$sectionCount]; //Get user type, which is after the WG name if (isset($stemSections[$sectionCount + 1])) { $group['WGRole'] = $stemSections[$sectionCount + 1]; @@ -693,17 +694,26 @@ private function getFriendlyWorkingGroupName(array $groups, $method) foreach ($workingGroups as $workingGroup) { //Need to set first group in final Working Group array if (count($finalWorkingGroups) == 0) { - $finalWorkingGroups[] = array('WGName' => $workingGroup['WGName'], 'Groups' => array($workingGroup)); + $finalWorkingGroups[] = array( + 'WGName' => $workingGroup['WGName'], + 'WGShowName' => $workingGroup['WGShowName'], + 'Groups' => array($workingGroup) + ); } else { $foundMatch = false; foreach ($finalWorkingGroups as &$finalWorkingGroup) { if ($finalWorkingGroup['WGName'] == $workingGroup['WGName']) { + $finalWorkingGroup['WGShowName'] = $workingGroup['WGShowName']; $finalWorkingGroup['Groups'][] = $workingGroup; $foundMatch = true; } } if (!$foundMatch) { - $finalWorkingGroups[] = array('WGName' => $workingGroup['WGName'], 'Groups' => array($workingGroup)); + $finalWorkingGroups[] = array( + 'WGName' => $workingGroup['WGName'], + 'WGShowName' => $workingGroup['WGShowName'], + 'Groups' => array($workingGroup) + ); } } } diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index d180ebc..da4477d 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -104,7 +104,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index 00be779..9560043 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -77,7 +77,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; $wgoptin) : ?> - + diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 3eeb0ea..28c843b 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -113,7 +113,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false;