From: Damilare Adedoyin Date: Wed, 12 Oct 2022 13:43:35 +0000 (+0100) Subject: Add RelationshipType searchkit mgd files and update paths X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5e45324540e96b6bb61b9d8a34c969419ce57c3d;p=civicrm-core.git Add RelationshipType searchkit mgd files and update paths --- diff --git a/CRM/Admin/Form/RelationshipType.php b/CRM/Admin/Form/RelationshipType.php index ea8bf12135..43914d6a72 100644 --- a/CRM/Admin/Form/RelationshipType.php +++ b/CRM/Admin/Form/RelationshipType.php @@ -41,6 +41,13 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form { */ protected $entityFields = []; + public function preProcess(): void { + CRM_Utils_Request::retrieve('action', 'String', $this); + CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0); + $this->set('BAOName', 'CRM_Contact_BAO_RelationshipType'); + parent::preProcess(); + } + /** * Set entity fields to be assigned to the form. */ diff --git a/CRM/Admin/Page/RelationshipType.php b/CRM/Admin/Page/RelationshipType.php index 3e4cdfb6ed..312d2942e2 100644 --- a/CRM/Admin/Page/RelationshipType.php +++ b/CRM/Admin/Page/RelationshipType.php @@ -50,13 +50,13 @@ class CRM_Admin_Page_RelationshipType extends CRM_Core_Page_Basic { self::$_links = [ CRM_Core_Action::VIEW => [ 'name' => ts('View'), - 'url' => 'civicrm/admin/reltype', + 'url' => 'civicrm/admin/reltype/edit', 'qs' => 'action=view&id=%%id%%&reset=1', 'title' => ts('View Relationship Type'), ], CRM_Core_Action::UPDATE => [ 'name' => ts('Edit'), - 'url' => 'civicrm/admin/reltype', + 'url' => 'civicrm/admin/reltype/edit', 'qs' => 'action=update&id=%%id%%&reset=1', 'title' => ts('Edit Relationship Type'), ], @@ -72,7 +72,7 @@ class CRM_Admin_Page_RelationshipType extends CRM_Core_Page_Basic { ], CRM_Core_Action::DELETE => [ 'name' => ts('Delete'), - 'url' => 'civicrm/admin/reltype', + 'url' => 'civicrm/admin/reltype/edit', 'qs' => 'action=delete&id=%%id%%', 'title' => ts('Delete Reletionship Type'), ], diff --git a/CRM/Contact/DAO/RelationshipType.php b/CRM/Contact/DAO/RelationshipType.php index c5ce8a75cf..49d0553728 100644 --- a/CRM/Contact/DAO/RelationshipType.php +++ b/CRM/Contact/DAO/RelationshipType.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/RelationshipType.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:88fd0251d3164ad9917e6ca7eef858fe) + * (GenCodeChecksum:48b28ea10ac682ddbd880197d7555e9f) */ /** @@ -30,6 +30,18 @@ class CRM_Contact_DAO_RelationshipType extends CRM_Core_DAO { */ public static $_log = TRUE; + /** + * Paths for accessing this entity in the UI. + * + * @var string[] + */ + protected static $_paths = [ + 'add' => 'civicrm/admin/reltype/edit?action=add&reset=1', + 'view' => 'civicrm/admin/reltype/edit?action=view&id=[id]&reset=1', + 'update' => 'civicrm/admin/reltype/edit?action=update&id=[id]&reset=1', + 'delete' => 'civicrm/admin/reltype/edit?action=delete&id=[id]&reset=1', + ]; + /** * Primary key * diff --git a/CRM/Core/xml/Menu/Admin.xml b/CRM/Core/xml/Menu/Admin.xml index 030b2b03d9..c532ede1cc 100644 --- a/CRM/Core/xml/Menu/Admin.xml +++ b/CRM/Core/xml/Menu/Admin.xml @@ -118,6 +118,11 @@ Customize Data and Screens 35 + + civicrm/admin/reltype/edit + Edit Relationship Type + CRM_Admin_Form_RelationshipType + civicrm/admin/options/subtype Contact Types @@ -580,7 +585,7 @@ civicrm/admin/options/grant_type Grant Types - List of types which can be assigned to Grants. (Enable CiviGrant from Administer > Systme Settings > Enable Components if you want to track grants.) + List of types which can be assigned to Grants. (Enable CiviGrant from Administer > System Settings > Enable Components if you want to track grants.) CRM_Admin_Page_Options Option Lists 385 diff --git a/contributor-key.yml b/contributor-key.yml index 33e503a7b9..e3bc50963b 100644 --- a/contributor-key.yml +++ b/contributor-key.yml @@ -1598,3 +1598,7 @@ - github : wikimediaWfan name : Wenjun Fan organization: Wikimedia Foundation + +- github : damilare1 + name : Damilare Adedoyin + organization: Wikimedia Foundation diff --git a/ext/civicrm_admin_ui/ang/afsearchRelationshipTypes.aff.html b/ext/civicrm_admin_ui/ang/afsearchRelationshipTypes.aff.html new file mode 100644 index 0000000000..ba8433acca --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchRelationshipTypes.aff.html @@ -0,0 +1,13 @@ +
+
+
+

{{:: ts('Relationship types describe relationships between people, households and organizations. Relationship types labels describe the relationship from the perspective of each of the two entities (e.g. Parent >-< Child, Employer >-< Employee). For some types of relationships, the labels may be the same in both directions (e.g. Spouse >-< Spouse).') }} {{:: ts('(Learn more...)') }}

+

{{:: ts('You can define as many additional relationships types as needed to cover the types of relationships you want to track. Once a relationship type is created, you may also define custom fields to extend relationship information for that type from ') }} {{:: ts('Administer CiviCRM » Custom Data') }}

+
+
+
+
+ +
\ No newline at end of file diff --git a/ext/civicrm_admin_ui/ang/afsearchRelationshipTypes.aff.json b/ext/civicrm_admin_ui/ang/afsearchRelationshipTypes.aff.json new file mode 100644 index 0000000000..58bc820a2f --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchRelationshipTypes.aff.json @@ -0,0 +1,18 @@ +{ + "type": "search", + "requires": [], + "entity_type": null, + "join_entity": null, + "title": "Relationship Types", + "description": "", + "is_dashlet": false, + "is_public": false, + "is_token": false, + "contact_summary": null, + "icon": "fa-list-alt", + "server_route": "civicrm/admin/reltype", + "permission": "access CiviCRM", + "redirect": null, + "create_submission": false, + "navigation": null +} diff --git a/ext/civicrm_admin_ui/managed/SavedSearch_Administer_Relationship_Types.mgd.php b/ext/civicrm_admin_ui/managed/SavedSearch_Administer_Relationship_Types.mgd.php new file mode 100644 index 0000000000..66d6316168 --- /dev/null +++ b/ext/civicrm_admin_ui/managed/SavedSearch_Administer_Relationship_Types.mgd.php @@ -0,0 +1,159 @@ + 'SavedSearch_Administer_Relationship_Types', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Administer_Relationship_Types', + 'label' => E::ts('Administer Relationship Types'), + 'form_values' => NULL, + 'mapping_id' => NULL, + 'search_custom_id' => NULL, + 'api_entity' => 'RelationshipType', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'name_a_b', + 'name_b_a', + 'contact_type_a:label', + 'contact_type_b:label', + 'is_active', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => [], + 'join' => [], + 'having' => [], + ], + 'expires_date' => NULL, + 'description' => NULL, + ], + ], + ], + [ + 'name' => 'SavedSearch_Administer_Relationship_Types_SearchDisplay_Administer_Relationship_Types_Table_1', + 'entity' => 'SearchDisplay', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Administer_Relationship_Types_Table_1', + 'label' => E::ts('Administer Relationship Types Table 1'), + 'saved_search_id.name' => 'Administer_Relationship_Types', + 'type' => 'table', + 'settings' => [ + 'actions' => FALSE, + 'limit' => 50, + 'classes' => [ + 'table', + 'table-striped', + ], + 'pager' => [], + 'placeholder' => 5, + 'sort' => [], + 'columns' => [ + [ + 'type' => 'field', + 'key' => 'name_a_b', + 'dataType' => 'String', + 'label' => E::ts('Relationship A to B'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'name_b_a', + 'dataType' => 'String', + 'label' => E::ts('Relationship B to A'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'contact_type_a:label', + 'dataType' => 'String', + 'label' => E::ts('Contact Type A'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'contact_type_b:label', + 'dataType' => 'String', + 'label' => E::ts('Contact Type B'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'is_active', + 'dataType' => 'Boolean', + 'label' => E::ts('Enabled'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + [ + 'size' => 'btn-sm', + 'links' => [ + [ + 'entity' => 'RelationshipType', + 'action' => 'view', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-external-link', + 'text' => E::ts('View'), + 'style' => 'default', + 'path' => '', + 'condition' => [], + ], + [ + 'entity' => 'RelationshipType', + 'action' => 'update', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-pencil', + 'text' => E::ts('Edit'), + 'style' => 'default', + 'path' => '', + 'condition' => [], + ], + [ + 'entity' => 'RelationshipType', + 'action' => 'delete', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-trash', + 'text' => E::ts('Delete'), + 'style' => 'danger', + 'path' => '', + 'condition' => [], + ], + ], + 'type' => 'buttons', + 'alignment' => 'text-right', + ], + ], + 'addButton' => [ + 'path' => 'civicrm/admin/reltype/edit?action=add&reset=1', + 'text' => E::ts('Add Relationship Type'), + 'icon' => 'fa-plus', + ], + 'cssRules' => [ + [ + 'disabled', + 'is_active', + '=', + FALSE, + ], + ], + ], + 'acl_bypass' => FALSE, + ], + ], + ], +]; diff --git a/xml/schema/Contact/RelationshipType.xml b/xml/schema/Contact/RelationshipType.xml index ba388a8368..ead8d6f7bf 100644 --- a/xml/schema/Contact/RelationshipType.xml +++ b/xml/schema/Contact/RelationshipType.xml @@ -6,6 +6,12 @@ civicrm_relationship_type Relationship types s/b structured with contact_a as the 'subject/child' contact and contact_b as the 'object/parent' contact (e.g. Individual A is Employee of Org B). 1.1 + + civicrm/admin/reltype/edit?action=add&reset=1 + civicrm/admin/reltype/edit?action=view&id=[id]&reset=1 + civicrm/admin/reltype/edit?action=update&id=[id]&reset=1 + civicrm/admin/reltype/edit?action=delete&id=[id]&reset=1 + true id