Merge pull request #16178 from seamuslee001/regen_dao
[civicrm-core.git] / CRM / Report / Info.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 * This class introduces component to the system and provides all the
14 * information about it. It needs to extend CRM_Core_Component_Info
15 * abstract class.
16 *
17 * @copyright CiviCRM LLC https://civicrm.org/licensing
18 * $Id$
19 *
20 */
21 class CRM_Report_Info extends CRM_Core_Component_Info {
22
23 /**
24 * @var string
25 * @inheritDoc
26 */
27 protected $keyword = 'report';
28
29 /**
30 * @inheritDoc
31 * Provides base information about the component.
32 * Needs to be implemented in component's information
33 * class.
34 *
35 * @return array
36 * collection of required component settings
37 */
38 public function getInfo() {
39 return [
40 'name' => 'CiviReport',
41 'translatedName' => ts('CiviReport'),
42 'title' => ts('CiviCRM Report Engine'),
43 'search' => 0,
44 'showActivitiesInCore' => 1,
45 ];
46 }
47
48 /**
49 * @inheritDoc
50 * Provides permissions that are used by component.
51 * Needs to be implemented in component's information
52 * class.
53 *
54 * NOTE: if using conditionally permission return,
55 * implementation of $getAllUnconditionally is required.
56 *
57 * @param bool $getAllUnconditionally
58 * @param bool $descriptions
59 * Whether to return permission descriptions
60 *
61 * @return array|null
62 * collection of permissions, null if none
63 */
64 public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
65 $permissions = [
66 'access CiviReport' => [
67 ts('access CiviReport'),
68 ts('View reports'),
69 ],
70 'access Report Criteria' => [
71 ts('access Report Criteria'),
72 ts('Change report search criteria'),
73 ],
74 'save Report Criteria' => [
75 ts('save Report Criteria'),
76 ts('Save report search criteria'),
77 ],
78 'administer private reports' => [
79 ts('administer private reports'),
80 ts('Edit all private reports'),
81 ],
82 'administer reserved reports' => [
83 ts('administer reserved reports'),
84 ts('Edit all reports that have been marked as reserved'),
85 ],
86 'administer Reports' => [
87 ts('administer Reports'),
88 ts('Manage report templates'),
89 ],
90 'view report sql' => [
91 ts('view report sql'),
92 ts('View sql used in CiviReports'),
93 ],
94 ];
95
96 if (!$descriptions) {
97 foreach ($permissions as $name => $attr) {
98 $permissions[$name] = array_shift($attr);
99 }
100 }
101
102 return $permissions;
103 }
104
105 /**
106 * @inheritDoc
107 * Provides information about user dashboard element
108 * offered by this component.
109 *
110 * @return array|null
111 * collection of required dashboard settings,
112 * null if no element offered
113 */
114 public function getUserDashboardElement() {
115 // no dashboard element for this component
116 return NULL;
117 }
118
119 /**
120 * Provides component's user dashboard page object.
121 *
122 * @return mixed
123 * component's User Dashboard applet object
124 */
125
126 /**
127 * @return mixed
128 */
129 public function getUserDashboardObject() {
130 // no dashboard element for this component
131 return NULL;
132 }
133
134 /**
135 * @inheritDoc
136 * Provides information about user dashboard element
137 * offered by this component.
138 *
139 * @return array|null
140 * collection of required dashboard settings,
141 * null if no element offered
142 */
143
144 /**
145 * @return array|null
146 */
147 public function registerTab() {
148 // this component doesn't use contact record tabs
149 return NULL;
150 }
151
152 /**
153 * @inheritDoc
154 * @return string
155 */
156 public function getIcon() {
157 return 'crm-i fa-table';
158 }
159
160 /**
161 * @inheritDoc
162 * Provides information about advanced search pane
163 * offered by this component.
164 *
165 * @return array|null
166 * collection of required pane settings,
167 * null if no element offered
168 */
169
170 /**
171 * @return array|null
172 */
173 public function registerAdvancedSearchPane() {
174 // this component doesn't use advanced search
175 return NULL;
176 }
177
178 /**
179 * @inheritDoc
180 * Provides potential activity types that this
181 * component might want to register in activity history.
182 * Needs to be implemented in component's information
183 * class.
184 *
185 * @return array|null
186 * collection of activity types
187 */
188
189 /**
190 * @return array|null
191 */
192 public function getActivityTypes() {
193 return NULL;
194 }
195
196 /**
197 * add shortcut to Create New.
198 * @param $shortCuts
199 */
200 public function creatNewShortcut(&$shortCuts) {
201 }
202
203 }