Standalone - Add button to add user role
authorWilliam Mortada <williammortada@thirdsectordesign.org>
Sat, 2 Dec 2023 12:44:42 +0000 (12:44 +0000)
committerWilliam Mortada <williammortada@thirdsectordesign.org>
Sat, 2 Dec 2023 13:03:14 +0000 (13:03 +0000)
ext/standaloneusers/CRM/Standaloneusers/DAO/Role.php
ext/standaloneusers/managed/SavedSearch_Administer_Roles.mgd.php
ext/standaloneusers/sql/auto_uninstall.sql
ext/standaloneusers/xml/schema/CRM/Standaloneusers/Role.xml

index 585f241f2f16af0355a92e0a2d2bdb740bb462c2..da141595926a6364f9a9f5f713bb1480f2b24097 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from standaloneusers/xml/schema/CRM/Standaloneusers/Role.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d5053ae97fba22b13adecdce76ebb30f)
+ * (GenCodeChecksum:afe744210fe5b5d38bf16ae05677a749)
  */
 use CRM_Standaloneusers_ExtensionUtil as E;
 
@@ -38,6 +38,16 @@ class CRM_Standaloneusers_DAO_Role extends CRM_Core_DAO {
    */
   public static $_log = TRUE;
 
+  /**
+   * Paths for accessing this entity in the UI.
+   *
+   * @var string[]
+   */
+  protected static $_paths = [
+    'add' => 'civicrm/admin/role',
+    'update' => 'civicrm/admin/role#?Role1=[id]',
+  ];
+
   /**
    * Unique Role ID
    *
index 692ea568bdc1390eb452d3234680169ef84493b9..d01d517a85bc7805c75220b807f8d554c51cbeda 100644 (file)
@@ -62,13 +62,7 @@ return [
               'dataType' => 'String',
               'label' => E::ts('Label'),
               'sortable' => TRUE,
-              'link' => [
-                'path' => '/civicrm/admin/role#?Role1=[id]',
-                'entity' => '',
-                'action' => '',
-                'join' => '',
-                'target' => '',
-              ],
+              'editable' => TRUE,
             ],
             [
               'type' => 'field',
@@ -79,12 +73,41 @@ return [
               'rewrite' => '',
               'alignment' => '',
             ],
+            [
+              'size' => 'btn-xs',
+              'links' => [
+                [
+                  'entity' => 'Role',
+                  'action' => 'update',
+                  'join' => '',
+                  'target' => 'crm-popup',
+                  'icon' => 'fa-pencil',
+                  'text' => E::ts('Edit'),
+                  'style' => 'default',
+                  'path' => '',
+                  'condition' => [],
+                ],
+              ],
+              'type' => 'menu',
+              'icon' => 'fa-bars',
+              'alignment' => 'text-right',
+            ],
           ],
           'actions' => TRUE,
           'classes' => [
             'table',
             'table-striped',
           ],
+          'toolbar' => [
+            [
+              'text' => E::ts('Add Role'),
+              'target' => 'crm-popup',
+              'icon' => 'fa-plus',
+              'style' => 'primary',
+              'entity' => 'Role',
+              'action' => 'add',
+            ],
+          ],
         ],
         'acl_bypass' => FALSE,
       ],
index e963db9f2a0cf98d4d527df67b4210e6526cb1af..35c0c090b4cf90af67f3bf04db4e1a9f244d459c 100644 (file)
@@ -8,9 +8,11 @@
 --
 -- Generated from drop.tpl
 -- DO NOT EDIT.  Generated by CRM_Core_CodeGen
----- /*******************************************************
+--
+-- /*******************************************************
+-- *
+-- * Clean up the existing tables
 -- *
--- * Clean up the existing tables-- *
 -- *******************************************************/
 
 SET FOREIGN_KEY_CHECKS=0;
index 4c0e0d0abcc92ca379f19b0991cb1ba07f9e53aa..f83aa46181bc9e82ec26329d3de3bb4aa12adead 100644 (file)
@@ -7,6 +7,11 @@
   <comment>A Role holds a set of permissions. Roles may be granted to Users.</comment>
   <log>true</log>
 
+  <paths>
+    <add>civicrm/admin/role</add>
+    <update>civicrm/admin/role#?Role1=[id]</update>
+  </paths>
+
   <field>
     <name>id</name>
     <type>int unsigned</type>