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