diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 9ca510f..a30fac3 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -410,10 +410,7 @@ public function groupOwner() $data = $this->Paginator->paginate('GrouperGroup', $scope); - $finalData = $this->breakoutGroups($data, 'admin'); - - $this->set('groupsowners', $finalData['adHocGroups']); - $this->set('wgowners', $finalData['workingGroups']); + $this->set('groupsowners', $data); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ' Search: ' . var_export($e->getMessage(), true)); @@ -428,10 +425,7 @@ public function groupOwner() $data = $this->Paginator->paginate('GrouperGroup', $scope); - $finalData = $this->breakoutGroups($data, 'admin'); - - $this->set('groupsowners', $finalData['adHocGroups']); - $this->set('wgowners', $finalData['workingGroups']); + $this->set('groupsowners', $data); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); @@ -483,6 +477,7 @@ public function groupMember() $scope['method'] = 'getSearchedGroups'; $scope['searchcriteria'] = $searchCriteria; $scope['searchpage'] = 'filteredMemberOfGroups'; + $scope['ContainsWG'] = true; $data = $this->Paginator->paginate('GrouperGroup', $scope); @@ -559,12 +554,8 @@ public function groupOptin() $scope['searchpage'] = 'optinGroups'; $data = $this->Paginator->paginate('GrouperGroup', $scope); - //$this->set('groupoptin', $data); - - $finalData = $this->breakoutGroups($data, 'optin'); - $this->set('groupoptins', $finalData['adHocGroups']); - $this->set('wgoptins', $finalData['workingGroups']); + $this->set('groupoptins', $data); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . 'Search: ' . var_export($e->getMessage(), true)); @@ -580,12 +571,8 @@ public function groupOptin() $scope['method'] = 'optinGroups'; $data = $this->Paginator->paginate('GrouperGroup', $scope); - //$this->set('groupoptin', $data); - $finalData = $this->breakoutGroups($data, 'optin'); - - $this->set('groupoptins', $finalData['adHocGroups']); - $this->set('wgoptins', $finalData['workingGroups']); + $this->set('groupoptins', $data); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); @@ -1011,35 +998,6 @@ private function breakoutGroups(array $recordSet, $type = 'basic') } } - if ($type == 'basic' || $type == 'admin') { - //Need to surface Optout flag to top level of a Working Group - foreach ($wgData as &$wgRec) { - $subCount = 0; - foreach ($wgRec['Groups'] as $rec) { - if (isset($rec['optOut'])) { - $wgRec['optOut'] = true; - } - $wgRec['workingGroupId'] = $rec['name']; - $wgRec['workingGroupUUID'] = $rec['uuid']; - $wgRec['workingDesc'] = $this->hackDescription($rec['description']); - //Capturing record for incommon-collab since deleting a few lines below. - if ($rec['WGApp'] == 'incommon-collab') { - unset($wgRec['Groups'][$subCount]); - } - $subCount += 1; - } - - } - } elseif ($type == 'optin') { - //Working Groups that will show up on the Optin Page - foreach ($wgData as &$wgRec) { - $wgRec['workingGroupId'] = $wgRec['Groups'][0]['name']; - $wgRec['workingGroupUUID'] = $wgRec['Groups'][0]['uuid']; - $wgRec['workingDesc'] = $this->hackDescription($wgRec['Groups'][0]['description']); - unset($wgRec['Groups']); - } - } - return array( 'adHocGroups' => $notWGData, 'workingGroups' => $wgData diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index 86381ab..69e3a7c 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -632,10 +632,12 @@ public function paginate($conditions) } } else { - if ($method == 'getSearchedGroups' || $method == 'filteredMemberOfGroups') { + if (isset($conditions['ContainsWG']) && $method == 'getSearchedGroups') { + $friendlyResults = $this->getFriendlyWorkingGroupName($resultSet, 'member'); + } elseif ($method == 'filteredMemberOfGroups') { $friendlyResults = $this->getFriendlyWorkingGroupName($resultSet, 'member'); } else { - $friendlyResults = $this->getFriendlyWorkingGroupName($resultSet, ''); + $friendlyResults = $this->getFriendlyName(array_values($resultSet)); } } @@ -661,7 +663,6 @@ public function paginate($conditions) */ private function getFriendlyWorkingGroupName(array $groups, $method) { - $arrayIndex = 0; $workingGroups = array(); @@ -686,6 +687,12 @@ private function getFriendlyWorkingGroupName(array $groups, $method) $len = strlen($stem); // if match to name of group within WG mapping then start making a WG group array if (substr(strtolower($group['name']), 0, $len) === $stem) { + $tempGroup = $group; + if ($stem == 'ref:incommon-collab' || $stem == 'ref:internet2-collab') { + $mainGroup = true; + } else { + $mainGroup = false; + } $stemSections = explode(':', $group['name']); $displaySections = explode(':', $group['displayName']); //Get second to last stem section @@ -694,13 +701,13 @@ private function getFriendlyWorkingGroupName(array $groups, $method) 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 + $tempGroup['WGName'] = $stemSections[$sectionCount]; + $tempGroup['WGShowName'] = $displaySections[$sectionCount]; + // Get user type, which is after the WG name if (isset($stemSections[$sectionCount + 1])) { - $group['WGRole'] = $stemSections[$sectionCount + 1]; + $tempGroup['WGRole'] = $stemSections[$sectionCount + 1]; } else { - $group['WGRole'] = ''; + $tempGroup['WGRole'] = ''; } $appCount = 0; $appName = ''; @@ -720,21 +727,26 @@ private function getFriendlyWorkingGroupName(array $groups, $method) //changed the way email list are displayed to actually show lists email address. if ($appName == 'sympa - internet2' || $appName == 'sympa - incommon') { if ($appName == 'sympa - internet2') { - $appName = $group['WGName'] . '@lists.' . 'internet2.edu'; + $appName = $tempGroup['WGName'] . '@lists.' . 'internet2.edu'; } else { - $appName = $group['WGName'] . '@lists.' . 'incommon.org'; + $appName = $tempGroup['WGName'] . '@lists.' . 'incommon.org'; } } - $group['WGApp'] = $appName; + $tempGroup['WGApp'] = $appName; if ($method == 'member') { - if ($group['WGRole'] !== 'admins' && $group['WGRole'] !== 'owner') { - $workingGroups[] = $group; + // Screening out groups owned since this page show memberships not ownership! +// if ($tempGroup['WGRole'] !== 'admin' && $tempGroup['WGRole'] !== 'owner' && !$mainGroup ) { +// $workingGroups[] = $tempGroup; +// } + if(!$mainGroup) { + $workingGroups[] = $tempGroup; + unset($groups[$arrayIndex]); } } else { - $workingGroups[] = $group; + $workingGroups[] = $tempGroup; + unset($groups[$arrayIndex]); } - unset($groups[$arrayIndex]); } } $arrayIndex += 1; diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 333e617..33859eb 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -116,7 +116,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; - + diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index 9560043..de618d2 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -20,7 +20,7 @@ $numColumns = count($columns); $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; ?> - 0 || count($wgoptins) > 0) : ?> + 0) : ?>
element("pagination", array( 'goto' => false, @@ -65,34 +65,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; - - - - - - - $wgoptin) : ?> - - - - - - - - - element('GrouperLite.Components/optAction', array( - 'member' => false, - 'action' => 'joingroup', - 'group' => $wgoptin['workingGroupId'], - 'idx' => $key - )); ?> - - - - + element("pagination", array( 'goto' => false, @@ -108,7 +81,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; }); - +

diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 694e72f..06e0f9c 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -20,7 +20,7 @@ $numColumns = count($columns); $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; ?> - 0 || count($wgowners) > 0) : ?> + 0) : ?>
element("pagination", array( 'goto' => false, @@ -95,110 +95,6 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; - - - - - - - - - None - - - - - - - - - - - - - element('GrouperLite.Components/optAction', array( - 'member' => $wggroup['optOut'], - 'action' => 'leavegroup', - 'group' => $wggroup['workingGroupId'], - 'idx' => $key - )) : ''; ?> - - - - -   - - - - - - - - $group) : ?> - - - - - - - - element('GrouperLite.Components/optAction', array( - 'member' => $group['optOut'], - 'action' => 'leavegroup', - 'group' => $group['name'], - 'idx' => $key - )) : ''; ?> - - - - -   - - - - - - - - $group) : ?> - - - - - - - - - - - - - - - - element("pagination", array( 'goto' => false, @@ -214,7 +110,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; }); - +