From: William Mortada Date: Sat, 2 Dec 2023 12:44:42 +0000 (+0000) Subject: Standalone - Add button to add user role X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=108446697c06430d6d618936671601882ca796f4;p=civicrm-core.git Standalone - Add button to add user role --- diff --git a/ext/standaloneusers/CRM/Standaloneusers/DAO/Role.php b/ext/standaloneusers/CRM/Standaloneusers/DAO/Role.php index 585f241f2f..da14159592 100644 --- a/ext/standaloneusers/CRM/Standaloneusers/DAO/Role.php +++ b/ext/standaloneusers/CRM/Standaloneusers/DAO/Role.php @@ -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 * diff --git a/ext/standaloneusers/managed/SavedSearch_Administer_Roles.mgd.php b/ext/standaloneusers/managed/SavedSearch_Administer_Roles.mgd.php index 692ea568bd..d01d517a85 100644 --- a/ext/standaloneusers/managed/SavedSearch_Administer_Roles.mgd.php +++ b/ext/standaloneusers/managed/SavedSearch_Administer_Roles.mgd.php @@ -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, ], diff --git a/ext/standaloneusers/sql/auto_uninstall.sql b/ext/standaloneusers/sql/auto_uninstall.sql index e963db9f2a..35c0c090b4 100644 --- a/ext/standaloneusers/sql/auto_uninstall.sql +++ b/ext/standaloneusers/sql/auto_uninstall.sql @@ -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; diff --git a/ext/standaloneusers/xml/schema/CRM/Standaloneusers/Role.xml b/ext/standaloneusers/xml/schema/CRM/Standaloneusers/Role.xml index 4c0e0d0abc..f83aa46181 100644 --- a/ext/standaloneusers/xml/schema/CRM/Standaloneusers/Role.xml +++ b/ext/standaloneusers/xml/schema/CRM/Standaloneusers/Role.xml @@ -7,6 +7,11 @@ A Role holds a set of permissions. Roles may be granted to Users. true + + civicrm/admin/role + civicrm/admin/role#?Role1=[id] + + id int unsigned