Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Integrated plugin with comanage processes
rmathis committed Dec 15, 2020
1 parent 8415e4e commit 9f9a43d
Showing 15 changed files with 142 additions and 90 deletions.
29 changes: 29 additions & 0 deletions Lib/lang.php
@@ -0,0 +1,29 @@
<?php

$cm_grouper_lite_texts['en_US'] = array(

'pl.grouperlite.nav.groups' => 'Groups',
'pl.grouperlite.nav.groups-presided' => 'Groups I preside over',
'pl.grouperlite.nav.email-lists' => 'Email lists',
'pl.grouperlite.nav.email-lists-managed' => 'Email lists I manage',
'pl.grouperlite.nav.create-group' => 'Create group',

'pl.grouperlite.table.name' => 'Name',
'pl.grouperlite.table.description' => 'Description',
'pl.grouperlite.table.status' => 'Status',
'pl.grouperlite.table.action' => 'Action',

'pl.grouperlite.value.descr.zerostate' => 'No Description',
'pl.grouperlite.value.enabled' => 'Enabled',
'pl.grouperlite.value.disabled' => 'Disabled',

'pl.grouperlite.action.join-group' => 'Join group',
'pl.grouperlite.action.leave-group' => 'Leave group',
'pl.grouperlite.action.edit-group' => 'Edit',
'pl.grouperlite.action.disable-group' => 'Disable',
'pl.grouperlite.action.subscribe' => 'Subscribe',
'pl.grouperlite.action.unsubscribe' => 'Unsubscribe',
'pl.grouperlite.action.search' => 'Search',

'pl.grouperlite.search.tags.text' => 'Search',
);
11 changes: 11 additions & 0 deletions Model/GrouperLite.php
@@ -8,5 +8,16 @@ class GrouperLite extends AppModel {
// Required by COmanage Plugins
public $cmPluginType = "dashboardwidget";

public function cmPluginMenus() {
return array(
"cogroups" => array(
'Grouper groups' => array(
'controller' => "groupergroups",
'action' => "groupoptin"
)
)
);
}


}
1 change: 1 addition & 0 deletions View/CoGrouperLite/display.ctp
@@ -0,0 +1 @@
Hi I am the dashboard widget
15 changes: 5 additions & 10 deletions View/Elements/Components/navigation.ctp
@@ -1,14 +1,9 @@
<?php


// selected
?>
<nav id="grouper-plugin-tabs" class="nav nav-tabs mb-4 justify-content-between">
<div class="d-flex nav-tab-group">
<div class="nav-item">
<?php
print $this->Html->link(
filter_var('Groups', FILTER_SANITIZE_SPECIAL_CHARS),
_txt('pl.grouperlite.nav.groups'),
array(
'controller' => 'groupergroups',
'action' => 'groupoptin'
@@ -20,7 +15,7 @@
<div class="nav-item">
<?php
print $this->Html->link(
filter_var('Groups I preside over', FILTER_SANITIZE_SPECIAL_CHARS),
_txt('pl.grouperlite.nav.groups-presided'),
array(
'controller' => 'groupergroups',
'action' => 'groupowner'
@@ -32,7 +27,7 @@
<div class="nav-item">
<?php
print $this->Html->link(
filter_var('Email lists', FILTER_SANITIZE_SPECIAL_CHARS),
_txt('pl.grouperlite.nav.email-lists'),
array(
'controller' => 'groupergroups',
'action' => 'emaillistsoptin'
@@ -44,7 +39,7 @@
<div class="nav-item">
<?php
print $this->Html->link(
filter_var('Email lists I manage', FILTER_SANITIZE_SPECIAL_CHARS),
_txt('pl.grouperlite.nav.email-lists-managed'),
array(
'controller' => 'groupergroups',
'action' => 'emaillistsmanaged'
@@ -64,7 +59,7 @@
);
?>
<a href="<?php echo $createGroupUrl; ?>" class="btn btn-link px-3 py-2">
<i class="fa fa-plus-circle"></i>&nbsp; Create group
<i class="fa fa-plus-circle"></i>&nbsp; <?php echo _txt('pl.grouperlite.nav.create-group'); ?>
</a>
</div>
</nav>
17 changes: 5 additions & 12 deletions View/Elements/Components/optAction.ctp
@@ -1,16 +1,9 @@
<form method="POST" action="<?php echo $this->Html->url(
array('controller' => 'groupergroups', 'action' => $action)
)?>">
<?php echo $this->Form->create(false, array(
'url' => array('controller' => 'groupergroups', 'action' => $action)
)); ?>
<input type="hidden" name="GroupName" value="<?php echo $group; ?>" />
<?php
// If a token was passed in, submit it as part of the form
if(!empty($vv_petition_token)) {
print $this->Form->hidden('token', array('default' => $vv_petition_token)) . "\n";
}
?>
<button class="btn btn-raised btn-block btn-<?php echo $member ? 'danger' : 'success'; ?>" type="submit">
<?php echo $member ? 'Leave' : 'Join' ?> group &nbsp;
<?php echo $member ? _txt('pl.grouperlite.action.leave-group') : _txt('pl.grouperlite.action.join-group') ?> &nbsp;
<i class="fa fa-<?php echo $member ? 'user-times' : 'users'; ?> fa-sm"></i>

</button>
</form>
<?php echo $this->Form->end(); ?>
14 changes: 8 additions & 6 deletions View/Elements/Components/search.ctp
@@ -15,29 +15,32 @@ $(document).ready(function() {
});
});
</script>

<form class="search my-4" method="POST" action="<?php echo $this->Html->url(array('controller' => 'groupergroups', 'action' => $active))?>">
<?php echo $this->Form->create(false, array(
'url' => array('controller' => 'groupergroups', 'action' => $active),
'class' => 'search mb-4'
)); ?>
<div>
<div class="d-flex">
<div class="input-group input-group-search">
<input type="text" name="search" class="form-control" value="<?php echo isset($searchcriteria) ? $searchcriteria : ''; ?>" />
<div class="input-group-append">
<button class="btn btn-outline-secondary px-4" type="submit" value="Submit">
<i class="fa fa-search"></i>
<span class="ml-2">Search</span>
<span class="ml-2"><?php echo _txt('pl.grouperlite.action.search'); ?></span>
</button>
</div>
</div>
</div>
<?php if (isset($searchcriteria)) { ?>
<div class="d-flex px-2 pt-4">
<button class="btn btn-badge btn-primary badge badge-pill badge-primary">
Text: <?php echo $searchcriteria; ?>
<?php echo _txt('pl.grouperlite.search.tags.text').' '.$searchcriteria; ?>
<i class="fa fa-times"></i>
</button>
</div>
<?php } ?>
</div>
<!--
<div id class="my-2 collapse bg-light border-light py-3 px-4">
<div class="row">
<div class="col col-lg-6 col-12">
@@ -92,12 +95,11 @@ $(document).ready(function() {
</div>
</div>
</div>
<!--
<div class="d-flex justify-content-end align-items-end my-2">
<button class="btn btn-link adv-search-link">
<i class="fa fa-caret-down"></i>
&nbsp;advanced search
</button>
</div>
-->
</form>
<?php echo $this->Form->end(); ?>
13 changes: 11 additions & 2 deletions View/GrouperGroups/base.ctp
@@ -1,8 +1,17 @@
<?php
$this->Html->css('GrouperLite.co-grouper-plugin', array('inline' => false));
print $this->Html->css('GrouperLite.bootstrap') . "\n ";
print $this->Html->css('GrouperLite.co-grouper-base') . "\n ";
print $this->Html->css('GrouperLite.co-grouper-plugin') . "\n ";
?>
<!-- Load JavaScript -->
<?php /* only JQuery here - other scripts at bottom */
print $this->Html->script('GrouperLite.bootstrap.bundle.js') . "\n ";
print $this->Html->script('GrouperLite.typeahead.bundle.js') . "\n ";

$this->Html->addCrumb('Grouper groups', array('controller' => 'groupergroups', 'action' => 'groupoptin'), array('prepend' => true));
?>

<div id="grouper-plugin" class="p-4">
<div id="grouper-plugin" class="pt-2">
<div class="d-flex align-items-center">
<h2><?php echo($title); ?></h2>
</div>
27 changes: 15 additions & 12 deletions View/GrouperGroups/emaillistsmanaged.ctp
@@ -1,14 +1,15 @@
<?php $this->extend('/GrouperGroups/base'); ?>
<?php $this->Html->addCrumb('Email lists I manage'); ?>
<?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>
<th class="group name"><?php echo _txt('pl.grouperlite.table.name'); ?></th>
<th class="group description"><?php echo _txt('pl.grouperlite.table.description'); ?></th>
<th class="group status"><?php echo _txt('pl.grouperlite.table.status'); ?></th>
<th class="group action"><?php echo _txt('pl.grouperlite.table.action'); ?></th>
</tr>
</thead>
<tbody>
@@ -24,14 +25,16 @@
<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>
<span class="d-flex flex-column flex-lg-row justify-content-between align-items-center">
<button class="btn btn-raised btn-primary w-50 mr-1">
<?php echo _txt('pl.grouperlite.action.edit-group'); ?> &nbsp;
<i class="fa fa-edit fa-sm"></i>
</button>
<button class="btn btn-raised btn-danger w-50 ml-1">
<?php echo _txt('pl.grouperlite.action.disable-group'); ?> &nbsp;
<i class="fa fa-ban fa-sm"></i>
</button>
</span>
</td>
</tr>
</tbody>
25 changes: 14 additions & 11 deletions View/GrouperGroups/emaillistsoptin.ctp
@@ -1,14 +1,18 @@
<?php $this->extend('/GrouperGroups/base'); ?>
<?php $this->Html->addCrumb('Email lists I can join'); ?>
<?php echo $this->element('Components/navigation', array('active' => 'emaillistsoptin')); ?>
<?php echo $this->element('Components/search', array('active' => 'emaillistsoptin')); ?>

<?php $this->Html->addCrumb('Group Optin/Optout'); ?>

<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>
<th class="group name"><?php echo _txt('pl.grouperlite.table.name'); ?></th>
<th class="group description"><?php echo _txt('pl.grouperlite.table.description'); ?></th>
<th class="group status"><?php echo _txt('pl.grouperlite.table.status'); ?></th>
<th class="group action"><?php echo _txt('pl.grouperlite.table.action'); ?></th>
</tr>
</thead>
<tbody>
@@ -21,14 +25,13 @@
'?' => 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 isset($group['description']) ? $group['description'] : _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td><?php echo isset($group['enabled']) && $group['enabled'] === 'T' ? _txt('pl.grouperlite.value.enabled') : _txt('pl.grouperlite.value.disabled'); ?></td>
<td>
<?php echo $this->element('Components/optAction', array(
'member' => $group['member'],
'action' => $group['member'] ? 'leavegroup' : 'joingroup',
'group' => $group['name']
)); ?>
<button class="btn btn-raised btn-block btn-success" type="submit">
<?php echo _txt('pl.grouperlite.action.subscribe') ?>
<i class="fa fa-<?php echo $member ? 'user-times' : 'users'; ?> fa-sm"></i>
</button>
</td>
</tr>
</tbody>
33 changes: 17 additions & 16 deletions View/GrouperGroups/groupcreateform.ctp
@@ -1,4 +1,5 @@
<?php $this->extend('/GrouperGroups/base'); ?>
<?php $this->Html->addCrumb('Create a Group'); ?>
<hr />
<script type="text/javascript">
$(document).ready(function () {
@@ -140,6 +141,22 @@
</small>
</div>
</div>
<div class="form-group row py-2 bg-light">
<?php echo $this->Form->label(false, 'Description:', array(
'for' => 'descr',
'class' => "col-sm-3 col-form-label"
)); ?>
<div class="col-sm-9">
<?php echo $this->Form->textarea('description', array(
'class' => 'form-control',
'id' => 'descr',
'rows' => 5
)); ?>
<small id="descrHelp" class="form-text text-muted">
Description contains notes about the group, which could include: what the group represents, why it was created, etc.
</small>
</div>
</div>
<div class="form-group row py-2 bg-lighter">
<legend class="col-form-label col-sm-3 pt-0">Privileges:</legend>
<div class="col-sm-9">
@@ -207,22 +224,6 @@
</div>
</div>
</div>
<div class="form-group row py-2 bg-light">
<?php echo $this->Form->label(false, 'Description:', array(
'for' => 'descr',
'class' => "col-sm-3 col-form-label"
)); ?>
<div class="col-sm-9">
<?php echo $this->Form->textarea('description', array(
'class' => 'form-control',
'id' => 'descr',
'rows' => 5
)); ?>
<small id="descrHelp" class="form-text text-muted">
Description contains notes about the group, which could include: what the group represents, why it was created, etc.
</small>
</div>
</div>
<div class="form-group row py-2 bg-light">
<?php echo $this->Form->label(false, 'Subscribers:', array(
'for' => 'subscribers',
1 change: 1 addition & 0 deletions View/GrouperGroups/groupinfo.ctp
@@ -1,4 +1,5 @@
<?php $this->extend('/GrouperGroups/base'); ?>
<?php $this->Html->addCrumb('Group configuration'); ?>
<?php
$baseUrl = 'https://grouper.staging.at.internet2.edu/grouper/';
$path = 'grouperUi/app/UiV2Main.index';
14 changes: 8 additions & 6 deletions View/GrouperGroups/groupoptin.ctp
@@ -1,14 +1,16 @@

<?php $this->extend('/GrouperGroups/base'); ?>
<?php $this->Html->addCrumb('Groups I can join'); ?>
<?php echo $this->element('GrouperLite.Components/navigation', array('active' => 'groupoptin')); ?>
<?php echo $this->element('GrouperLite.Components/search', array('active' => 'groupoptin')); ?>
<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>
<th class="group name"><?php echo _txt('pl.grouperlite.table.name'); ?></th>
<th class="group description"><?php echo _txt('pl.grouperlite.table.description'); ?></th>
<th class="group status"><?php echo _txt('pl.grouperlite.table.status'); ?></th>
<th class="group action"><?php echo _txt('pl.grouperlite.table.action'); ?></th>
</tr>
</thead>
<tbody>
@@ -22,8 +24,8 @@
'?' => 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 isset($group['description']) ? $group['description'] : _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<td><?php echo isset($group['enabled']) && $group['enabled'] === 'T' ? _txt('pl.grouperlite.value.enabled') : _txt('pl.grouperlite.value.disabled'); ?></td>
<td>
<?php echo $this->element('GrouperLite.Components/optAction', array(
'member' => $group['member'],

0 comments on commit 9f9a43d

Please sign in to comment.