Merge pull request #22484 from civicrm/5.46
[civicrm-core.git] / CRM / Admin / Page / RelationshipType.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * Page for displaying list of relationship types.
20 */
21 class CRM_Admin_Page_RelationshipType extends CRM_Core_Page_Basic {
22
23 public $useLivePageJS = TRUE;
24
25 /**
26 * The action links that we need to display for the browse screen.
27 *
28 * @var array
29 */
30 public static $_links = NULL;
31
32 /**
33 * Get BAO Name.
34 *
35 * @return string
36 * Classname of BAO.
37 */
38 public function getBAOName() {
39 return 'CRM_Contact_BAO_RelationshipType';
40 }
41
42 /**
43 * Get action Links.
44 *
45 * @return array
46 * (reference) of action links
47 */
48 public function &links() {
49 if (!(self::$_links)) {
50 self::$_links = [
51 CRM_Core_Action::VIEW => [
52 'name' => ts('View'),
53 'url' => 'civicrm/admin/reltype',
54 'qs' => 'action=view&id=%%id%%&reset=1',
55 'title' => ts('View Relationship Type'),
56 ],
57 CRM_Core_Action::UPDATE => [
58 'name' => ts('Edit'),
59 'url' => 'civicrm/admin/reltype',
60 'qs' => 'action=update&id=%%id%%&reset=1',
61 'title' => ts('Edit Relationship Type'),
62 ],
63 CRM_Core_Action::DISABLE => [
64 'name' => ts('Disable'),
65 'ref' => 'crm-enable-disable',
66 'title' => ts('Disable Relationship Type'),
67 ],
68 CRM_Core_Action::ENABLE => [
69 'name' => ts('Enable'),
70 'ref' => 'crm-enable-disable',
71 'title' => ts('Enable Relationship Type'),
72 ],
73 CRM_Core_Action::DELETE => [
74 'name' => ts('Delete'),
75 'url' => 'civicrm/admin/reltype',
76 'qs' => 'action=delete&id=%%id%%',
77 'title' => ts('Delete Reletionship Type'),
78 ],
79 ];
80 }
81 return self::$_links;
82 }
83
84 /**
85 * Get name of edit form.
86 *
87 * @return string
88 * Classname of edit form.
89 */
90 public function editForm() {
91 return 'CRM_Admin_Form_RelationshipType';
92 }
93
94 /**
95 * Get edit form name.
96 *
97 * @return string
98 * name of this page.
99 */
100 public function editName() {
101 return 'Relationship Types';
102 }
103
104 /**
105 * Get user context.
106 *
107 * @param null $mode
108 *
109 * @return string
110 * user context.
111 */
112 public function userContext($mode = NULL) {
113 return 'civicrm/admin/reltype';
114 }
115
116 }