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 categories. |
6a488035 TO |
20 | */ |
21 | class CRM_Admin_Page_Mapping extends CRM_Core_Page_Basic { | |
22 | ||
e2046b33 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. |
6a488035 | 34 | * |
a6c01b45 CW |
35 | * @return string |
36 | * Classname of BAO. | |
6a488035 | 37 | */ |
00be9182 | 38 | public function getBAOName() { |
6a488035 TO |
39 | return 'CRM_Core_BAO_Mapping'; |
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 TO |
49 | if (!(self::$_links)) { |
50 | // helper variable for nicer formatting | |
51 | $deleteExtra = ts('Are you sure you want to delete this mapping?') . ' ' . ts('This operation cannot be undone.'); | |
be2fb01f CW |
52 | self::$_links = [ |
53 | CRM_Core_Action::UPDATE => [ | |
6a488035 TO |
54 | 'name' => ts('Edit'), |
55 | 'url' => 'civicrm/admin/mapping', | |
56 | 'qs' => 'action=update&id=%%id%%&reset=1', | |
57 | 'title' => ts('Edit Mapping'), | |
be2fb01f CW |
58 | ], |
59 | CRM_Core_Action::DELETE => [ | |
6a488035 TO |
60 | 'name' => ts('Delete'), |
61 | 'url' => 'civicrm/admin/mapping', | |
62 | 'qs' => 'action=delete&id=%%id%%', | |
63 | 'title' => ts('Delete Mapping'), | |
be2fb01f CW |
64 | ], |
65 | ]; | |
6a488035 TO |
66 | } |
67 | return self::$_links; | |
68 | } | |
69 | ||
70 | /** | |
eceb18cc | 71 | * Get name of edit form. |
6a488035 | 72 | * |
a6c01b45 CW |
73 | * @return string |
74 | * Classname of edit form. | |
6a488035 | 75 | */ |
00be9182 | 76 | public function editForm() { |
6a488035 TO |
77 | return 'CRM_Admin_Form_Mapping'; |
78 | } | |
79 | ||
80 | /** | |
eceb18cc | 81 | * Get form name for edit form. |
6a488035 | 82 | * |
a6c01b45 CW |
83 | * @return string |
84 | * name of this page. | |
6a488035 | 85 | */ |
00be9182 | 86 | public function editName() { |
6a488035 TO |
87 | return 'Mapping'; |
88 | } | |
89 | ||
90 | /** | |
eceb18cc | 91 | * Get form name for delete form. |
6a488035 | 92 | * |
a6c01b45 CW |
93 | * @return string |
94 | * name of this page. | |
6a488035 | 95 | */ |
00be9182 | 96 | public function deleteName() { |
6a488035 TO |
97 | return 'Mapping'; |
98 | } | |
99 | ||
100 | /** | |
101 | * Get user context. | |
102 | * | |
dd244018 EM |
103 | * @param null $mode |
104 | * | |
a6c01b45 CW |
105 | * @return string |
106 | * user context. | |
6a488035 | 107 | */ |
00be9182 | 108 | public function userContext($mode = NULL) { |
6a488035 TO |
109 | return 'civicrm/admin/mapping'; |
110 | } | |
111 | ||
112 | /** | |
eceb18cc | 113 | * Get name of delete form. |
6a488035 | 114 | * |
a6c01b45 CW |
115 | * @return string |
116 | * Classname of delete form. | |
6a488035 | 117 | */ |
00be9182 | 118 | public function deleteForm() { |
6a488035 TO |
119 | return 'CRM_Admin_Form_Mapping'; |
120 | } | |
121 | ||
122 | /** | |
eceb18cc | 123 | * Run the basic page. |
6a488035 | 124 | */ |
00be9182 | 125 | public function run() { |
6a488035 TO |
126 | $sort = 'mapping_type asc'; |
127 | return parent::run($sort); | |
128 | } | |
96025800 | 129 | |
6a488035 | 130 | } |