Skip to content

Commit

Permalink
Dev: Reodered buttons in user groups table also added border to buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
thedirtypanda committed Jul 14, 2021
1 parent a107cb2 commit 53a3d78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion application/controllers/UserGroupController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

/**
* UserGroupController
**/
class UserGroupController extends LSBaseController
{
/**
Expand Down
14 changes: 7 additions & 7 deletions application/models/UserGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,29 +317,29 @@ public function getColumns()
}

/**
* Returns the buttons for grid view
* @return string
*/
public function getButtons()
{

// View users
$url = Yii::app()->createUrl("userGroup/viewGroup/ugid/$this->ugid");
$button = '<a class="btn btn-default list-btn" data-toggle="tooltip" data-placement="left" title="' . gT('View users') . '" href="' . $url . '" role="button"><span class="fa fa-list-alt" ></span></a>';

// Edit user group
if (Permission::model()->hasGlobalPermission('usergroups', 'update')) {
$url = Yii::app()->createUrl("userGroup/edit/ugid/$this->ugid");
$button .= ' <a class="btn btn-default list-btn" data-toggle="tooltip" data-placement="left" title="' . gT('Edit user group') . '" href="' . $url . '" role="button"><span class="fa fa-pencil" ></span></a>';
$button = ' <a class="btn btn-default list-btn green-border" style="margin-right: 5px;" data-toggle="tooltip" data-placement="left" title="' . gT('Edit user group') . '" href="' . $url . '" role="button"><span class="fa fa-pencil" ></span></a>';
}

// View users
$url = Yii::app()->createUrl("userGroup/viewGroup/ugid/$this->ugid");
$button .= '<a class="btn btn-default list-btn" data-toggle="tooltip" data-placement="left" title="' . gT('View users') . '" href="' . $url . '" role="button"><span class="fa fa-list-alt" ></span></a>';

// Mail to user group
// Which permission should be checked for this button to be available?
$url = Yii::app()->createUrl("userGroup/mailToAllUsersInGroup/ugid/$this->ugid");
$button .= ' <a class="btn btn-default list-btn" data-toggle="tooltip" data-placement="left" title="' . gT('Email user group') . '" href="' . $url . '" role="button"><span class="icon-invite" ></span></a>';

// Delete user group
if (Permission::model()->hasGlobalPermission('usergroups', 'delete')) {
$button .= ' <span data-toggle="tooltip" title="' . gT('Delete user group') . '"><button class="btn btn-default list-btn action__delete-group" data-placement="left" href="#delete-modal" data-toggle="modal" data-ugid="' . $this->ugid . '" role="button"><i class="fa fa-trash text-warning"></i></button></span>';
$button .= ' <span data-toggle="tooltip" title="' . gT('Delete user group') . '"><button class="btn btn-default list-btn red-border action__delete-group" data-placement="left" href="#delete-modal" data-toggle="modal" data-ugid="' . $this->ugid . '" role="button"><i class="fa fa-trash"></i></button></span>';
}

return $button;
Expand Down

0 comments on commit 53a3d78

Please sign in to comment.