*/
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.
*/
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'),
],
],
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'),
],
*
* Generated from xml/schema/CRM/Contact/RelationshipType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:88fd0251d3164ad9917e6ca7eef858fe)
+ * (GenCodeChecksum:48b28ea10ac682ddbd880197d7555e9f)
*/
/**
*/
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
*
<adminGroup>Customize Data and Screens</adminGroup>
<weight>35</weight>
</item>
+ <item>
+ <path>civicrm/admin/reltype/edit</path>
+ <title>Edit Relationship Type</title>
+ <page_callback>CRM_Admin_Form_RelationshipType</page_callback>
+ </item>
<item>
<path>civicrm/admin/options/subtype</path>
<title>Contact Types</title>
<item>
<path>civicrm/admin/options/grant_type</path>
<title>Grant Types</title>
- <desc>List of types which can be assigned to Grants. (Enable CiviGrant from Administer > Systme Settings > Enable Components if you want to track grants.)</desc>
+ <desc>List of types which can be assigned to Grants. (Enable CiviGrant from Administer > System Settings > Enable Components if you want to track grants.)</desc>
<page_callback>CRM_Admin_Page_Options</page_callback>
<adminGroup>Option Lists</adminGroup>
<weight>385</weight>
- github : wikimediaWfan
name : Wenjun Fan
organization: Wikimedia Foundation
+
+- github : damilare1
+ name : Damilare Adedoyin
+ organization: Wikimedia Foundation
--- /dev/null
+<div class="af-container">
+ <div class="af-markup">
+ <div class="help">
+ <p>{{:: 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).') }} <a class="crm-doc-link no-popup"
+ href="https://docs.civicrm.org/user/en/latest/organising-your-data/relationships" target="_blank">{{:: ts('(Learn more...)') }}</a></p>
+ <p>{{:: 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 ') }} <a href="civicrm/admin/custom/group?reset=1">{{:: ts('Administer CiviCRM » Custom Data') }}</a></p>
+ </div>
+ </div>
+</div>
+<div af-fieldset="">
+ <crm-search-display-table search-name="Administer_Relationship_Types"
+ display-name="Administer_Relationship_Types_Table_1"></crm-search-display-table>
+</div>
\ No newline at end of file
--- /dev/null
+{
+ "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
+}
--- /dev/null
+<?php
+use CRM_CivicrmAdminUi_ExtensionUtil as E;
+
+return [
+ [
+ 'name' => '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,
+ ],
+ ],
+ ],
+];
<name>civicrm_relationship_type</name>
<comment>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).</comment>
<add>1.1</add>
+ <paths>
+ <add>civicrm/admin/reltype/edit?action=add&reset=1</add>
+ <view>civicrm/admin/reltype/edit?action=view&id=[id]&reset=1</view>
+ <update>civicrm/admin/reltype/edit?action=update&id=[id]&reset=1</update>
+ <delete>civicrm/admin/reltype/edit?action=delete&id=[id]&reset=1</delete>
+ </paths>
<log>true</log>
<field>
<name>id</name>