From f964354ab307902ce0a7f8ea1efa76a4f897f5f2 Mon Sep 17 00:00:00 2001 From: William Mortada Date: Tue, 5 Dec 2023 23:01:04 +0000 Subject: [PATCH] Standalone - Improve administer user screen --- .../afsearchAdministerUserAccounts.aff.html | 6 +- .../SavedSearch_Administer_Users.mgd.php | 118 ++++++++++++++---- 2 files changed, 98 insertions(+), 26 deletions(-) diff --git a/ext/standaloneusers/ang/afsearchAdministerUserAccounts.aff.html b/ext/standaloneusers/ang/afsearchAdministerUserAccounts.aff.html index 669ca2e222..c17e57e19c 100644 --- a/ext/standaloneusers/ang/afsearchAdministerUserAccounts.aff.html +++ b/ext/standaloneusers/ang/afsearchAdministerUserAccounts.aff.html @@ -1,16 +1,12 @@
- -

{{:: ts('User accounts allow people to access CiviCRM. What they can access is determined by which roles the users have, and what permissions are granted to those roles.') }}

- -
- +
diff --git a/ext/standaloneusers/managed/SavedSearch_Administer_Users.mgd.php b/ext/standaloneusers/managed/SavedSearch_Administer_Users.mgd.php index bce679c4cd..7689f3e6f1 100644 --- a/ext/standaloneusers/managed/SavedSearch_Administer_Users.mgd.php +++ b/ext/standaloneusers/managed/SavedSearch_Administer_Users.mgd.php @@ -12,9 +12,6 @@ return [ 'values' => [ 'name' => 'Users', 'label' => E::ts('Administer Users'), - 'form_values' => NULL, - 'mapping_id' => NULL, - 'search_custom_id' => NULL, 'api_entity' => 'User', 'api_params' => [ 'version' => 4, @@ -25,6 +22,7 @@ return [ 'is_active', 'when_created', 'when_last_accessed', + 'roles:label', ], 'orderBy' => [], 'where' => [], @@ -32,8 +30,6 @@ return [ 'join' => [], 'having' => [], ], - 'expires_date' => NULL, - 'description' => NULL, ], 'match' => [ 'name', @@ -54,18 +50,16 @@ return [ 'type' => 'table', 'settings' => [ 'description' => NULL, - 'sort' => [], + 'sort' => [ + [ + 'username', + 'ASC', + ], + ], 'limit' => 50, 'pager' => [], 'placeholder' => 5, 'columns' => [ - [ - 'type' => 'field', - 'key' => 'id', - 'dataType' => 'Integer', - 'label' => E::ts('id'), - 'sortable' => TRUE, - ], [ 'type' => 'field', 'key' => 'username', @@ -87,6 +81,13 @@ return [ 'label' => E::ts('Email'), 'sortable' => TRUE, ], + [ + 'type' => 'field', + 'key' => 'roles:label', + 'dataType' => 'String', + 'label' => E::ts('Roles'), + 'sortable' => TRUE, + ], [ 'type' => 'field', 'key' => 'is_active', @@ -99,16 +100,82 @@ return [ 'type' => 'field', 'key' => 'when_created', 'dataType' => 'Timestamp', - 'label' => E::ts('When Created'), + 'label' => E::ts('Created'), 'sortable' => TRUE, ], [ 'type' => 'field', 'key' => 'when_last_accessed', 'dataType' => 'Timestamp', - 'label' => E::ts('When Last Accessed'), + 'label' => E::ts('Last Accessed'), 'sortable' => TRUE, ], + [ + 'text' => '', + 'style' => 'default', + 'size' => 'btn-xs', + 'icon' => 'fa-bars', + 'links' => [ + [ + 'entity' => 'User', + 'action' => 'update', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-pencil', + 'text' => E::ts('Edit'), + 'style' => 'default', + 'path' => '', + 'task' => '', + 'condition' => [], + ], + [ + 'task' => 'disable', + 'entity' => 'User', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-toggle-off', + 'text' => E::ts('Disable'), + 'style' => 'default', + 'path' => '', + 'action' => '', + 'condition' => [ + 'is_active', + '=', + TRUE, + ], + ], + [ + 'task' => 'enable', + 'entity' => 'User', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-toggle-on', + 'text' => E::ts('Enable'), + 'style' => 'default', + 'path' => '', + 'action' => '', + 'condition' => [ + 'is_active', + '=', + FALSE, + ], + ], + [ + 'task' => 'delete', + 'entity' => 'User', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-trash', + 'text' => E::ts('Delete'), + 'style' => 'danger', + 'path' => '', + 'action' => '', + 'condition' => [], + ], + ], + 'type' => 'menu', + 'alignment' => 'text-right', + ], ], 'actions' => [ 'delete', @@ -120,17 +187,26 @@ return [ 'table', 'table-striped', ], - 'addButton' => [ - 'path' => '/civicrm/admin/user#', - 'text' => E::ts('Add User'), - 'icon' => 'fa-plus', + 'toolbar' => [ + [ + 'path' => '/civicrm/admin/user#', + 'text' => E::ts('Add User'), + 'icon' => 'fa-plus', + 'style' => 'primary', + 'task' => '', + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + 'condition' => [], + ], ], + 'button' => NULL, ], - 'acl_bypass' => FALSE, ], 'match' => [ - 'name', 'saved_search_id', + 'name', ], ], ], -- 2.25.1