Skip to content

Commit

Permalink
Merged feature/ICPCO-91 into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
axel committed Feb 5, 2021
2 parents c1858fa + 9bbb1c0 commit f6e2716
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions Model/GrouperGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ public function groupDescriptions($groupName) {
$args = array();
$args['conditions']['groupName'] = $groupName;


$groupDescription = $this->grouperAPI->getGrouperGroupDescription($args);
//make call to get attributes for group
$grouperAtt = new GrouperAttribute();
Expand Down Expand Up @@ -276,11 +275,30 @@ public function getSearchedGroups($userId, $searchCriteria, $page) {
*
* @param array $groups Current result set of Groups
* @return array Same result set with added param for friendly name
* @throws GrouperLiteException
*
*/
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]);
}
}
$group['friendlyName'] = implode(':', $friendlySections);
if(strlen($group['friendlyName']) == 0 ){
$group['friendlyName'] = $group['name'];
}
}

return $groups;

/* Old Process, keeping in case changes back!
foreach ($groups as &$group) {
$group['friendlyName'] = $group['displayName'];
$attributes = $this->grouperAPI->getGroupAttributes(array('conditions' => array('groupName' => $group['displayName'])));
Expand All @@ -292,8 +310,7 @@ private function getFriendlyName(array $groups) {
break;
}
}
}
return $groups;
}*/
}

}

0 comments on commit f6e2716

Please sign in to comment.