Skip to content

Commit

Permalink
Merge branch 'develop' into October2022
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel Stohn authored and Axel Stohn committed Nov 9, 2022
2 parents 369b450 + 5198d31 commit 301b278
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 20 deletions.
16 changes: 12 additions & 4 deletions Controller/GrouperGroupsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -695,12 +695,16 @@ public function joinGroup()
{
if ($this->request->is('post')) {
$name = $this->request->data['GroupName'];
$display = $this->request->data['GroupDisplayName'];

try {
if ($this->GrouperGroup->joinGroup($this->userId, $name)) {
$this->Flash->set(_txt('pl.grouperlite.message.flash.join-group-success'), array('key' => 'success'));
$this->Flash->set(
_txt('pl.grouperlite.message.flash.join-group-success', array(filter_var($display, FILTER_SANITIZE_SPECIAL_CHARS))),
array('key' => 'success')
);
} else {
$this->Flash->set(_txt('pl.grouperlite.message.flash.join-group-failed'), array('key' => 'error'));
$this->Flash->set(_txt('pl.grouperlite.message.flash.join-group-failed', array(filter_var($display, FILTER_SANITIZE_SPECIAL_CHARS))), array('key' => 'error'));
}
} catch (Exception $e) {
CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true));
Expand All @@ -722,12 +726,16 @@ public function leaveGroup()
{
if ($this->request->is('post')) {
$name = $this->request->data['GroupName'];
$display = $this->request->data['GroupDisplayName'];

try {
if ($this->GrouperGroup->leaveGroup($this->userId, $name)) {
$this->Flash->set(_txt('pl.grouperlite.message.flash.leave-group-success'), array('key' => 'success'));
$this->Flash->set(
_txt('pl.grouperlite.message.flash.leave-group-success', array(filter_var($display, FILTER_SANITIZE_SPECIAL_CHARS))),
array('key' => 'success')
);
} else {
$this->Flash->set(_txt('pl.grouperlite.message.flash.leave-group-failed'), array('key' => 'error'));
$this->Flash->set(_txt('pl.grouperlite.message.flash.leave-group-failed', array(filter_var($display, FILTER_SANITIZE_SPECIAL_CHARS))), array('key' => 'error'));
}
} catch (Exception $e) {
CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true));
Expand Down
10 changes: 5 additions & 5 deletions Lib/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
'pl.grouperlite.title.groupcreate' => 'Create a group',
'pl.grouperlite.title.templatecreate' => 'Create a working group',

'pl.grouperlite.message.flash.join-group-success' => 'You have been added to the group!',
'pl.grouperlite.message.flash.join-group-failed' => 'You are unable to join the group!',
'pl.grouperlite.message.flash.join-group-success' => 'You have been added to the group: %1$s',
'pl.grouperlite.message.flash.join-group-failed' => 'You are unable to join the group: %1$s',
'pl.grouperlite.message.flash.join-group-error' => 'An error occurred in joining the group, please try again later.',
'pl.grouperlite.message.flash.info-group-failed' => 'Error in viewing group info, please try again later.',

'pl.grouperlite.message.flash.leave-group-success' => 'You have been deleted from the group!',
'pl.grouperlite.message.flash.leave-group-failed' => 'You are unable to delete the group!',
'pl.grouperlite.message.flash.leave-group-success' => 'You have been deleted from the group: %1$s',
'pl.grouperlite.message.flash.leave-group-failed' => 'You are unable to be removed from the group: %1$s',
'pl.grouperlite.message.flash.leave-group-error' => 'An error occurred in leaving the group, please try again later.',
'pl.grouperlite.message.flash.owner-group-failed' => 'Error occurred in viewing groups you manage, please try again later.',
'pl.grouperlite.message.flash.member-group-failed' => 'Error occurred in viewing groups you are a member, please try again later.',
Expand Down Expand Up @@ -103,7 +103,7 @@
'pl.grouperlite.action.disable-group' => 'Disable',
'pl.grouperlite.action.subscribe' => 'Subscribe',
'pl.grouperlite.action.unsubscribe' => 'Unsubscribe',
'pl.grouperlite.action.search' => 'Search',
'pl.grouperlite.action.search' => 'Search For Groups',
'pl.grouperlite.action.remove' => 'Remove',
'pl.grouperlite.action.view' => 'View',
'pl.grouperlite.action.edit' => 'Edit',
Expand Down
1 change: 1 addition & 0 deletions View/Elements/Components/optAction.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'id' => 'join-group.' . $idx
)); ?>
<?php print $this->Form->hidden('GroupName', array('default' => $group, 'id' => 'groupName.' . $idx)); ?>
<?php print $this->Form->hidden('GroupDisplayName', array('default' => $groupDisplay, 'id' => 'groupDisplayName.' . $idx)); ?>
<button class="btn btn-sm btn-<?php echo $member ? 'danger' : 'success'; ?> btn-block text-nowrap m-1" type="submit">
<?php echo $member ? _txt('pl.grouperlite.action.leave') : _txt('pl.grouperlite.action.join') ?> &nbsp;
<em class="material-icons mt-0" aria-hidden="true"><?php echo $member ? 'person_off' : 'person'; ?></em>
Expand Down
22 changes: 13 additions & 9 deletions View/Elements/Components/search.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@
<div class="d-flex">
<label class="sr-only" for="search"><?php echo _txt('pl.grouperlite.search.tags.text'); ?></label>
<div class="input-group input-group-search">
<?php echo $this->Form->input("search", array('label' => false, 'class' => 'form-control', 'value' => isset($searchcriteria) ? $searchcriteria : '')) ?>

<!--<input type="text" name="search" class="form-control" value="<?php echo isset($searchcriteria) ? $searchcriteria : ''; ?>" /> -->
<div class="input-group-append">
<?php if (isset($searchcriteria) && $searchcriteria !== '') { ?>
<button class="btn btn-grouper btn-outline-secondary shadow-none" type="button" value="Clear" id="reset-search" aria-label="<?php echo _txt("pl.grouperlite.action.clear"); ?>">
<em class="material-icons lg" aria-hidden="true">close</em>
<span class="sr-only"><?php echo _txt("pl.grouperlite.action.clear"); ?></span>
</button>
<?php } ?>
<div class="input-group-prepend">

<button class="btn btn-grouper btn-primary px-4" type="submit" value="Submit">
<em class="material-icons" aria-hidden="true">search</em>
<span class="ml-2"><?php echo _txt('pl.grouperlite.action.search'); ?></span>
<span class="ml-2 text-sml"><?php echo _txt('pl.grouperlite.action.search'); ?></span>
</button>
</div>
<?php echo $this->Form->input("search", array('label' => false, 'class' => 'form-control', 'value' => isset($searchcriteria) ? $searchcriteria : '')) ?>
<?php if (isset($searchcriteria) && $searchcriteria !== '') { ?>
<div class="input-group-append">
<button class="btn btn-grouper btn-outline-secondary shadow-none" type="button" value="Clear" id="reset-search" aria-label="<?php echo _txt("pl.grouperlite.action.clear"); ?>">
<em class="material-icons lg" aria-hidden="true">close</em>
<span class="sr-only"><?php echo _txt("pl.grouperlite.action.clear"); ?></span>
</button>
</div>
<?php } ?>
</div>
</div>
<script>
Expand Down
8 changes: 6 additions & 2 deletions View/Elements/base-styles.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
color: var(--primary);
}

.material-icons.mt-0 {
margin-top: 0;
.text-sml {
font-size: 0.8rem;
}

#content .material-icons.lg {
Expand Down Expand Up @@ -106,6 +106,10 @@
animation-timing-function: ease-in-out !important;
}

#search {
background-color: #F6F6F6;
}

/* fade out half */

#grouper-loader.fade-out-half circle:nth-child(1) {
Expand Down
1 change: 1 addition & 0 deletions View/GrouperGroups/groupmember.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false;
'member' => $group['optOut'],
'action' => 'leavegroup',
'group' => $group['name'],
'groupDisplay' => $group['friendlyName'],
'idx' => $key
)) : ''; ?>
<button class="btn btn-grouper btn-block btn-primary btn-sm m-1 text-nowrap members-btn"
Expand Down
1 change: 1 addition & 0 deletions View/GrouperGroups/groupoptin.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false;
'member' => false,
'action' => 'joingroup',
'group' => $group['name'],
'groupDisplay' => $group['friendlyName'],
'idx' => $key
)); ?>
</td>
Expand Down
1 change: 1 addition & 0 deletions View/GrouperGroups/groupowner.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false;
'member' => $group['optOut'],
'action' => 'leavegroup',
'group' => $group['name'],
'groupDisplay' => $group['friendlyName'],
'idx' => $key
)) : ''; ?>
<button class="btn btn-grouper btn-block btn-primary btn-sm m-1 text-nowrap members-btn" data-id="<?php echo urlencode($group['name']) ?>" data-name="<?php echo ($group['friendlyName']); ?>">
Expand Down

0 comments on commit 301b278

Please sign in to comment.