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