Skip to content

Commit

Permalink
Fixed issue #17460: themes permission action button is shown now
Browse files Browse the repository at this point in the history
  • Loading branch information
Trischi80 committed Jul 28, 2021
1 parent 9febdb1 commit 2a50cef
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions application/controllers/UserManagementController.php
Expand Up @@ -454,10 +454,10 @@ public function actionSaveUserPermissions(): string
/**
* Opens a modal to edit user template permissions
*
* @return string
* @return string|null
* @throws CException
*/
public function actionUserTemplatePermissions(): string
public function actionUserTemplatePermissions(): ?string
{
if (!Permission::model()->hasGlobalPermission('users', 'update')) {
return $this->renderPartial(
Expand Down
15 changes: 10 additions & 5 deletions application/models/User.php
Expand Up @@ -576,6 +576,7 @@ public function getManagementButtons()
$setPermissionsUrl = Yii::app()->getController()->createUrl('userManagement/userPermissions', ['userid' => $this->uid]);
$setRoleUrl = Yii::app()->getController()->createUrl('userManagement/addRole', ['userid' => $this->uid]);
$changeOwnershipUrl = Yii::app()->getController()->createUrl('userManagement/takeOwnership');
$setTemplatePermissionsUrl = Yii::app()->getController()->createUrl('userManagement/userTemplatePermissions', ['userid' => $this->uid]);
$deleteUrl = Yii::app()->getController()->createUrl('userManagement/deleteConfirm', ['userid' => $this->uid, 'user' => $this->full_name]);


Expand All @@ -584,9 +585,7 @@ public function getManagementButtons()
data-toggle='tooltip'
title='" . gT("User details") . "'
class='btn btn-sm btn-default UserManagement--action--openmodal UserManagement--action--userdetail'
data-href='" . $detailUrl . "'
data-modalsize='modal-lg'
><i class='fa fa-search'></i></button>";
data-href='" . $detailUrl . "'><i class='fa fa-search'></i></button>";

$editPermissionButton = ""
. "<button
Expand All @@ -612,8 +611,13 @@ class='btn btn-sm btn-default UserManagement--action--openmodal UserManagement--
title='" . gT("Edit user") . "'
class='btn btn-sm btn-default UserManagement--action--openmodal UserManagement--action--edituser green-border'
style='margin-left: 5px;'
data-href='" . $editUrl . "'
data-modalsize='modal-lg'><i class='fa fa-pencil'></i></button>";
data-href='" . $editUrl . "'><i class='fa fa-pencil'></i></button>";
$editTemplatePermissionButton = ""
. "<button
data-toggle='tooltip'
title='" . gT("Template permissions") . "'
class='btn btn-sm btn-default UserManagement--action--openmodal UserManagement--action--templatepermissions'
data-href='" . $setTemplatePermissionsUrl . "'><i class='fa fa-paint-brush'></i></button>";
$takeOwnershipButton = ""
. "<button
id='UserManagement--takeown-" . $this->uid . "'
Expand Down Expand Up @@ -657,6 +661,7 @@ class='btn btn-default btn-sm UserManagement--action--openmodal UserManagement--
$addRoleButton,
"\n",
$userDetail,
$editTemplatePermissionButton,
$this->parent_id != Yii::app()->session['loginID'] ? $takeOwnershipButton : '',
$deleteUserButton]);
}
Expand Down
3 changes: 2 additions & 1 deletion application/views/userManagement/massiveAction/_selector.php
Expand Up @@ -62,6 +62,7 @@
),

// Template Permission
/* Decision: take this out and reimplement the action button (this massive action was never working/implemented correctly)
array(
'type' => 'action',
'action' => 'templatePermission',
Expand All @@ -77,7 +78,7 @@
'selectedUrl' => '',
'sModalTitle' => gT("Template permissions"),
'htmlModalBody' => App()->getController()->renderPartial('/userManagement/massiveAction/_updatepermissions', [], true),
),
),*/

),
);
Expand Down
@@ -1,7 +1,7 @@
<?php
Yii::app()->getController()->renderPartial(
'/layouts/partial_modals/modal_header',
['modalTitle' => gT('Permission')]
['modalTitle' => gT('Theme template permission')]
);
?>

Expand Down

0 comments on commit 2a50cef

Please sign in to comment.