Standalone - delete en/disable actions for roles
authorWilliam Mortada <williammortada@thirdsectordesign.org>
Sat, 2 Dec 2023 16:24:19 +0000 (16:24 +0000)
committerWilliam Mortada <williammortada@thirdsectordesign.org>
Sat, 2 Dec 2023 16:24:19 +0000 (16:24 +0000)
ext/standaloneusers/managed/SavedSearch_Administer_Roles.mgd.php

index d01d517a85bc7805c75220b807f8d554c51cbeda..daf5cb37720d527ae7dd83c9b63dc68e17fdd744 100644 (file)
@@ -20,6 +20,7 @@ return [
           'version' => 4,
           'select' => [
             'id',
+            'name',
             'label',
             'is_active',
           ],
@@ -56,6 +57,13 @@ return [
           'pager' => [],
           'placeholder' => 5,
           'columns' => [
+            [
+              'type' => 'field',
+              'key' => 'name',
+              'dataType' => 'String',
+              'label' => E::ts('Name'),
+              'sortable' => TRUE,
+            ],
             [
               'type' => 'field',
               'key' => 'label',
@@ -87,6 +95,32 @@ return [
                   'path' => '',
                   'condition' => [],
                 ],
+                [
+                  'task' => 'enable',
+                  'entity' => 'Role',
+                  'target' => 'crm-popup',
+                  'icon' => 'fa-toggle-on',
+                  'text' => E::ts('Enable'),
+                  'style' => 'default',
+                  'condition' => ['is_active', '=', FALSE],
+                ],
+                [
+                  'task' => 'disable',
+                  'entity' => 'Role',
+                  'target' => 'crm-popup',
+                  'icon' => 'fa-toggle-off',
+                  'text' => E::ts('Disable'),
+                  'style' => 'default',
+                  'condition' => ['is_active', '=', TRUE],
+                ],
+                [
+                  'entity' => 'Role',
+                  'task' => 'delete',
+                  'target' => 'crm-popup',
+                  'icon' => 'fa-trash',
+                  'text' => E::ts('Delete'),
+                  'style' => 'danger',
+                ],
               ],
               'type' => 'menu',
               'icon' => 'fa-bars',