Skip to content

Commit

Permalink
Latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Dec 14, 2020
1 parent 10d1487 commit 8415e4e
Show file tree
Hide file tree
Showing 13 changed files with 460 additions and 114 deletions.
50 changes: 47 additions & 3 deletions Controller/GrouperGroupsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ class GrouperGroupsController extends GrouperLiteAppController
public $components = array('Flash');

public $name = 'GrouperGroups';
public $userId = '';
public $userId = 'ryan.mathis@at.internet2.edu';

public function index() {
return $this->redirect(array('controller' => 'GrouperGroups', 'action' => 'groupoptin'));
return $this->redirect(
array('controller' => 'GrouperGroups', 'action' => 'groupoptin')
);
}


Expand All @@ -29,7 +31,7 @@ public function groupInfo()
$details = $this->GrouperGroup->groupDescriptions($name);

$this->set('groupname', $name);
$this->set('title', 'Grouper Groups Info and Attributes:');
$this->set('title', 'Group configuration and attributes');
$this->set('groupergroupsdetail', $details[0]);
}

Expand Down Expand Up @@ -58,6 +60,48 @@ public function groupOptin()
}
}

public function emailListsOptin()
{
$this->set('title', 'Email lists');
// mock data
$this->set('group', array(
'member' => true,
'name' => 'Email List 1',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
'enabled' => 'T'
));
}

public function emailListsManaged()
{
$this->set('title', 'Email lists I manage');
// mock data
$this->set('group', array(
'member' => true,
'name' => 'Email List 1',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
'enabled' => 'T'
));
}

public function emailListInfo()
{
$this->set('title', 'Email list configuration and attributes');
// mock data
$this->set('groupergroupsdetail', array(
'member' => true,
'uuid' => 'abc123xyz789',
'displayExtension' => 'email-list-1',
'extension' => 'email-list-1',
'displayName' => 'Email List 1',
'typeOfGroup' => 'list',
'name' => 'Email List 1',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
'enabled' => 'T',
'attributes' => array()
));
}

public function groupCreateForm() {
$this->set('title', 'Create Grouper Group');
}
Expand Down
22 changes: 22 additions & 0 deletions View/Elements/Components/groupattributes.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<table class="table table-striped w-100">
<thead>
<tr>
<th class="attr descr">Attribute name</th>
<th class="attr definition">Attribute description</th>
<th class="attr action">Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($attributes as $attr): ?>
<tr>
<td><?php echo $attr['displayName']; ?></td>
<td><?php echo $attr['description'] ?></td>
<td>
<a href="<?php echo $baseUrl.$attr['uuid']; ?>" class="btn btn-primary btn-raised btn-block" target="_blank" role="button">
View <i class="fa fa-external-link"></i>
</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
42 changes: 42 additions & 0 deletions View/Elements/Components/groupproperties.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<div class="row no-gutters bg-lighter align-items-center p-2">
<div class="col-sm-3 font-weight-bold">Display Name:</div>
<div class="col-sm-9 form-control-plaintext">
<?php echo $group['displayName']; ?>
</div>
</div>
<div class="row no-gutters bg-light align-items-center p-2">
<div class="col-sm-3 font-weight-bold">Grouper Name:</div>
<div class="col-sm-9 form-control-plaintext">
<?php echo $group['name']; ?>
</div>
</div>
<div class="row no-gutters bg-lighter align-items-center p-2">
<div class="col-sm-3 font-weight-bold">Display Extension:</div>
<div class="col-sm-9 form-control-plaintext">
<?php echo $group['displayExtension']; ?>
</div>
</div>
<div class="row no-gutters bg-light align-items-center p-2">
<div class="col-sm-3 font-weight-bold">Extension:</div>
<div class="col-sm-9 form-control-plaintext">
<?php echo $group['extension']; ?>
</div>
</div>
<div class="row no-gutters bg-lighter align-items-center p-2">
<div class="col-sm-3 font-weight-bold">Enabled:</div>
<div class="col-sm-9 form-control-plaintext">
<?php echo $group['enabled']; ?>
</div>
</div>
<div class="row no-gutters bg-light align-items-center p-2">
<div class="col-sm-3 font-weight-bold">Type of Group:</div>
<div class="col-sm-9 form-control-plaintext">
<?php echo $group['typeOfGroup']; ?>
</div>
</div>
<div class="row no-gutters bg-lighter align-items-center p-2">
<div class="col-sm-3 font-weight-bold">UUID:</div>
<div class="col-sm-9 form-control-plaintext">
<?php echo $group['uuid']; ?>
</div>
</div>
22 changes: 20 additions & 2 deletions View/Elements/Components/navigation.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,28 @@
?>
</div>
<div class="nav-item">
<a href="" class="nav-link">Email lists</a>
<?php
print $this->Html->link(
filter_var('Email lists', FILTER_SANITIZE_SPECIAL_CHARS),
array(
'controller' => 'groupergroups',
'action' => 'emaillistsoptin'
),
array('class' => array('nav-link', $active == 'emaillistsoptin' ? 'active' : ''))
)
?>
</div>
<div class="nav-item">
<a href="" class="nav-link">Email lists I manage</a>
<?php
print $this->Html->link(
filter_var('Email lists I manage', FILTER_SANITIZE_SPECIAL_CHARS),
array(
'controller' => 'groupergroups',
'action' => 'emaillistsmanaged'
),
array('class' => array('nav-link', $active == 'emaillistsmanaged' ? 'active' : ''))
)
?>
</div>
</div>
<div class="align-self">
Expand Down
2 changes: 1 addition & 1 deletion View/Elements/Components/search.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ $(document).ready(function() {
</select>
</div>
<div class="col col-lg-6 col-12">
<label htmlFor="adv-search-type">Type</label>
<label for="adv-search-type">Type</label>
<select class="custom-select" id="adv-search-type">
<option>All</option>
<option>Other</option>
Expand Down
5 changes: 5 additions & 0 deletions View/Elements/Components/subscriberList.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ul class="list-group list-group-flush">
<?php foreach ($subscribers as $sub): ?>
<li class="list-group-item"><?php echo $sub['name']; ?> - <?php echo $sub['email']; ?></li>
<?php endforeach; ?>
</ul>
95 changes: 95 additions & 0 deletions View/GrouperGroups/emaillistinfo.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?php $this->extend('/GrouperGroups/base'); ?>
<?php
$baseUrl = 'https://grouper.staging.at.internet2.edu/grouper/';
$path = 'grouperUi/app/UiV2Main.index';
$groupOperation = '?operation=UiV2Group.viewGroup&groupId=';
$groupUrlBase = $baseUrl.$path.$groupOperation;
$attrOperation = '?operation=UiV2AttributeDefName.viewAttributeDefName&attributeDefNameId=';
$attrUrlBase = $baseUrl.$path.$attrOperation;
?>

<div>
<div class="border-bottom py-4 mb-4 d-flex justify-content-between">
<h2><strong>Group: </strong><?php echo $groupergroupsdetail['displayName']; ?></h2>
<div>
<a href="<?php echo $groupUrlBase.$groupergroupsdetail['uuid']; ?>" class="btn btn-primary btn-raised" target="_blank" role="button">
View Group in Grouper &nbsp;
<i class="fa fa-external-link"></i>
</a>
</div>
</div>
<div class="row">
<div class="col-xl-6 col-xs-12 group-details">
<h3>Group Properties</h3>
<div class="form-group row no-gutters bg-lighter">
<label for="folder" class="col-sm-3 col-form-label font-weight-bold">Display Name:</label>
<div class="col-sm-9 form-control-plaintext">
<?php echo $groupergroupsdetail['displayName']; ?>
</div>
</div>
<div class="form-group row no-gutters bg-light">
<label for="folder" class="col-sm-3 col-form-label font-weight-bold">Grouper Name:</label>
<div class="col-sm-9 form-control-plaintext">
<?php echo $groupergroupsdetail['name']; ?>
</div>
</div>
<div class="form-group row no-gutters bg-lighter">
<label for="folder" class="col-sm-3 col-form-label font-weight-bold">Display Extension:</label>
<div class="col-sm-9 form-control-plaintext">
<?php echo $groupergroupsdetail['displayExtension']; ?>
</div>
</div>
<div class="form-group row no-gutters bg-light">
<label for="folder" class="col-sm-3 col-form-label font-weight-bold">Extension:</label>
<div class="col-sm-9 form-control-plaintext">
<?php echo $groupergroupsdetail['extension']; ?>
</div>
</div>
<div class="form-group row no-gutters bg-lighter">
<label for="name" class="col-sm-3 col-form-label font-weight-bold">Enabled:</label>
<div class="col-sm-9 form-control-plaintext">
<?php echo $groupergroupsdetail['enabled']; ?>
</div>
</div>
<div class="form-group row no-gutters bg-light">
<label for="folder" class="col-sm-3 col-form-label font-weight-bold">Type of Group:</label>
<div class="col-sm-9 form-control-plaintext">
<?php echo $groupergroupsdetail['typeOfGroup']; ?>
</div>
</div>
<div class="form-group row no-gutters bg-lighter">
<label for="name" class="col-sm-3 col-form-label font-weight-bold">UUID:</label>
<div class="col-sm-9 form-control-plaintext">
<?php echo $groupergroupsdetail['uuid']; ?>
</div>
</div>
</div>
<div class="col-xl-6 col-xs-12">
<div class="table-responsive">
<h3>Attributes</h3>
<table class="table table-striped w-100">
<thead>
<tr>
<th class="attr descr">Attribute name</th>
<th class="attr definition">Attribute description</th>
<th class="attr action">Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($groupergroupsdetail['attributes'] as $attr): ?>
<tr>
<td><a href="/"><?php echo $attr['displayName']; ?></a></td>
<td><?php echo $attr['description'] ?></td>
<td>
<a href="<?php echo $attrUrlBase.$attr['uuid']; ?>" class="btn btn-primary btn-raised btn-block" target="_blank" role="button">
View <i class="fa fa-external-link"></i>
</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
39 changes: 39 additions & 0 deletions View/GrouperGroups/emaillistsmanaged.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php $this->extend('/GrouperGroups/base'); ?>
<?php echo $this->element('Components/navigation', array('active' => 'emaillistsmanaged', 'create' => true)); ?>
<?php echo $this->element('Components/search', array('active' => 'emaillistsmanaged')); ?>
<div class="">
<table class="table table-striped w-100">
<thead>
<tr>
<th class="group name">Name</th>
<th class="group descr">Description</th>
<th class="group status">Status</th>
<th class="group action">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo $this->Html->link(
isset($group['name']) ? $group['name'] : "No Name",
array(
'controller' => 'groupergroups',
'action' => 'emaillistinfo',
'?' => array('groupname' => urlencode($group['name']))
)
) ?></td>
<td><?php echo isset($group['description']) ? $group['description'] : "No Description"; ?></td>
<td><?php echo isset($group['enabled']) && $group['enabled'] === 'T' ? 'Enabled' : 'Disabled'; ?></td>
<td class="text-right">
<button class="btn btn-raised btn-primary">
Edit Group &nbsp;
<i class="fa fa-edit fa-sm"></i>
</button>
<button class="btn btn-raised btn-danger">
Disable Group &nbsp;
<i class="fa fa-trash fa-sm"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
36 changes: 36 additions & 0 deletions View/GrouperGroups/emaillistsoptin.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php $this->extend('/GrouperGroups/base'); ?>
<?php echo $this->element('Components/navigation', array('active' => 'emaillistsoptin')); ?>
<?php echo $this->element('Components/search', array('active' => 'emaillistsoptin')); ?>
<div class="">
<table class="table table-striped w-100">
<thead>
<tr>
<th class="group name">Name</th>
<th class="group descr">Description</th>
<th class="group status">Status</th>
<th class="group action">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo $this->Html->link(
isset($group['name']) ? $group['name'] : "No Name",
array(
'controller' => 'groupergroups',
'action' => 'emaillistinfo',
'?' => array('groupname' => urlencode($group['name']))
)
) ?></td>
<td><?php echo isset($group['description']) ? $group['description'] : "No Description"; ?></td>
<td><?php echo isset($group['enabled']) && $group['enabled'] === 'T' ? 'Enabled' : 'Disabled'; ?></td>
<td>
<?php echo $this->element('Components/optAction', array(
'member' => $group['member'],
'action' => $group['member'] ? 'leavegroup' : 'joingroup',
'group' => $group['name']
)); ?>
</td>
</tr>
</tbody>
</table>
</div>
Loading

0 comments on commit 8415e4e

Please sign in to comment.