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