Skip to content

Commit

Permalink
Fixed issue with groups i manage page
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Mar 22, 2022
1 parent e6857fb commit 030259a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 15 deletions.
3 changes: 0 additions & 3 deletions View/Elements/Components/subscriberList.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@
var field = $(ev.target).find('#addUser');
var user = field.val();
onAddUser(user, group, field);

console.log('onAddUserSubmit', ev);
}

function loadModalData(id) {
Expand Down Expand Up @@ -165,7 +163,6 @@
}

function onAddUser(user, group, field) {
console.log('onAddUser', user, group.field);
$.ajax({
method: 'POST',
url: addUrl + '?group=' + group + '&userId=' + user,
Expand Down
53 changes: 41 additions & 12 deletions View/GrouperGroups/groupowner.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,47 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false;
<td colspan="<?php echo $numColumns; ?>" class="text-center">No working groups.</td>
</tr>
<?php endif; ?>
<?php foreach ($wgowners as $wgowner) : ?>
<?php foreach ($wgowners as $wggroup) : ?>
<tr class="table-light <?php echo $collapsed ? 'collapse' : 'show'; ?> collapse-wg-working-group-parent">
<td colspan="<?php echo $numColumns; ?>">
<button type="button" class="btn btn-link btn-text collapse-btn fw-bold m-0 <?php echo $collapsed ? 'collapsed' : ''; ?>" data-toggle="collapse" data-target=".collapse-wg-<?php echo $wgowner['WGName']; ?>" role="button" aria-expanded="<?php echo $collapsed ? 'false' : 'true'; ?>">
<?php echo $wgowner['WGName'] ?? "No Name"; ?>
<i class="fa <?php echo $collapsed ? 'fa-caret-right' : 'fa-caret-down' ?> fa-sm"></i>
</button>
</td>
<td colspan="<?php echo $numColumns - 3; ?>">
<button type="button" class="btn btn-link btn-text collapse-btn fw-bold m-0 <?php echo $collapsed ? 'collapsed' : ''; ?>" data-toggle="collapse" data-target=".collapse-wg-<?php echo $wggroup['WGName']; ?>" role="button" aria-expanded="<?php echo $collapsed ? 'false' : 'true'; ?>">
<?php echo $wggroup['WGName'] ?? "No Name"; ?>
<i class="fa <?php echo $collapsed ? 'fa-caret-right' : 'fa-caret-down' ?> fa-sm"></i>
</button>
</td>
<td colspan="2">
<?php echo $wggroup['workingDesc'] ?? " "; ?>
</td>
<td>
<span class="d-flex flex-row justify-content-center align-items-center">
<?php echo $wggroup['optOut'] ? $this->element('GrouperLite.Components/optAction', array(
'member' => $wggroup['optOut'],
'action' => 'leavegroup',
'group' => $wggroup['workingGroupId'],
'idx' => $key
)) : ''; ?>
<button class="btn btn-grouper btn-block btn-primary btn-sm m-1 text-nowrap members-btn" data-id="<?php echo $wggroup['WGName']; ?>">
<?php echo _txt('pl.grouperlite.action.members'); ?> <i class="fa fa-group"></i>
</button>
<?php if ($isuserowner === 'T') : ?>
<?php
$baseUrl = $grouperbaseurl;
$path = '/grouper/grouperUi/app/UiV2Main.index';
$groupOperation = '?operation=UiV2Group.viewGroup&groupId=';
$groupUrlBase = $baseUrl . $path . $groupOperation;
$attrOperation = '?operation=UiV2AttributeDefName.viewAttributeDefName&attributeDefNameId=';
$attrUrlBase = $baseUrl . $path . $attrOperation;
?>
<a href="<?php echo $groupUrlBase . $wggroup['workingGroupUUID']; ?>" class="btn btn-grouper btn-block btn-sm btn-success mt-0 text-nowrap" target="_blank" role="button">
<?php echo _txt('pl.grouperlite.action.grouper'); ?> &nbsp;
<i class="fa fa-external-link"></i>
</a>
<?php endif ?>
</span>
</td>
</tr>

<?php foreach ($wgowner['Groups'] as $key => $group) : ?>
<?php /*foreach ($wgowner['Groups'] as $key => $group) : ?>
<tr class="<?php echo $collapsed ? 'collapse' : 'show'; ?> collapse-wg-<?php echo $wgowner['WGName']; ?> collapse-wg-working-group" id="collapse-wg-<?php echo $wgowner['WGName'] . '-' . $key; ?>">
<td class="pl-3"><?php echo $group['WGApp'] ?? "No Name"; ?></td>
<td><?php echo $group['WGRole'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
Expand Down Expand Up @@ -151,7 +181,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false;
</span>
</td>
</tr>
<?php endforeach; ?>
<?php endforeach;*/ ?>
<?php foreach ($wggroup['Groups'] as $key => $group) : ?>
<tr class="<?php echo $collapsed ? 'collapse' : 'show'; ?> collapse-wg-<?php echo $wggroup['WGName']; ?>" id="collapse-wg-<?php echo $wggroup['WGName'] . '-' . $key; ?>">
<td class="pl-3"><?php echo $group['WGApp'] ?? "No Name"; ?></td>
Expand All @@ -163,9 +193,8 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false;
<?php else : ?>
<td><?php echo _txt('pl.grouperlite.value.' . strtolower($group['WGApp'])) ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<?php endif; ?>
<td>

</td>
<td><?php echo isset($group['enabled']) && $group['enabled'] === 'T' ? 'Enabled' : 'Disabled'; ?></td>
<td></td>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
Expand Down

0 comments on commit 030259a

Please sign in to comment.