Merge pull request #12783 from civicrm/5.5
[civicrm-core.git] / CRM / Report / Info.php
CommitLineData
6a488035 1<?php
6a488035
TO
2/*
3 +--------------------------------------------------------------------+
fee14197 4 | CiviCRM version 5 |
6a488035 5 +--------------------------------------------------------------------+
8c9251b3 6 | Copyright CiviCRM LLC (c) 2004-2018 |
6a488035
TO
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
d25dd0ee 26 */
6a488035
TO
27
28/**
29 * This class introduces component to the system and provides all the
30 * information about it. It needs to extend CRM_Core_Component_Info
31 * abstract class.
32 *
8c9251b3 33 * @copyright CiviCRM LLC (c) 2004-2018
6a488035
TO
34 * $Id$
35 *
36 */
37class CRM_Report_Info extends CRM_Core_Component_Info {
38
e7c15cb6
CW
39 /**
40 * @inheritDoc
41 */
6a488035
TO
42 protected $keyword = 'report';
43
74cf4551 44 /**
e7c15cb6 45 * @inheritDoc
74cf4551
EM
46 * Provides base information about the component.
47 * Needs to be implemented in component's information
48 * class.
49 *
a6c01b45
CW
50 * @return array
51 * collection of required component settings
74cf4551 52 */
6a488035
TO
53 public function getInfo() {
54 return array(
55 'name' => 'CiviReport',
56 'translatedName' => ts('CiviReport'),
e300cf31 57 'title' => ts('CiviCRM Report Engine'),
6a488035
TO
58 'search' => 0,
59 'showActivitiesInCore' => 1,
60 );
61 }
62
63
74cf4551 64 /**
e7c15cb6 65 * @inheritDoc
74cf4551
EM
66 * Provides permissions that are used by component.
67 * Needs to be implemented in component's information
68 * class.
69 *
70 * NOTE: if using conditionally permission return,
71 * implementation of $getAllUnconditionally is required.
72 *
73 * @param bool $getAllUnconditionally
221b21b4
AH
74 * @param bool $descriptions
75 * Whether to return permission descriptions
74cf4551 76 *
72b3a70c
CW
77 * @return array|null
78 * collection of permissions, null if none
74cf4551 79 */
221b21b4
AH
80 public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
81 $permissions = array(
82 'access CiviReport' => array(
83 ts('access CiviReport'),
84 ts('View reports'),
85 ),
86 'access Report Criteria' => array(
87 ts('access Report Criteria'),
88 ts('Change report search criteria'),
89 ),
4341efe4
JV
90 'save Report Criteria' => array(
91 ts('save Report Criteria'),
92 ts('Save report search criteria'),
93 ),
92991caf
SV
94 'administer private reports' => array(
95 ts('administer private reports'),
96 ts('Edit all private reports'),
0f8c6e58 97 ),
221b21b4
AH
98 'administer reserved reports' => array(
99 ts('administer reserved reports'),
100 ts('Edit all reports that have been marked as reserved'),
101 ),
102 'administer Reports' => array(
103 ts('administer Reports'),
104 ts('Manage report templates'),
105 ),
02d451ab
EM
106 'view report sql' => array(
107 ts('view report sql'),
108 ts('View sql used in CiviReports'),
109 ),
221b21b4
AH
110 );
111
112 if (!$descriptions) {
113 foreach ($permissions as $name => $attr) {
114 $permissions[$name] = array_shift($attr);
115 }
116 }
117
118 return $permissions;
6a488035
TO
119 }
120
121
74cf4551 122 /**
e7c15cb6 123 * @inheritDoc
74cf4551
EM
124 * Provides information about user dashboard element
125 * offered by this component.
126 *
72b3a70c
CW
127 * @return array|null
128 * collection of required dashboard settings,
74cf4551 129 * null if no element offered
74cf4551 130 */
6a488035
TO
131 public function getUserDashboardElement() {
132 // no dashboard element for this component
133 return NULL;
134 }
135
74cf4551
EM
136 /**
137 * Provides component's user dashboard page object.
138 *
72b3a70c
CW
139 * @return mixed
140 * component's User Dashboard applet object
74cf4551
EM
141 */
142 /**
143 * @return mixed
144 */
6a488035
TO
145 public function getUserDashboardObject() {
146 // no dashboard element for this component
147 return NULL;
148 }
149
74cf4551 150 /**
e7c15cb6 151 * @inheritDoc
74cf4551
EM
152 * Provides information about user dashboard element
153 * offered by this component.
154 *
72b3a70c
CW
155 * @return array|null
156 * collection of required dashboard settings,
74cf4551 157 * null if no element offered
74cf4551
EM
158 */
159 /**
160 * @return array|null
161 */
6a488035
TO
162 public function registerTab() {
163 // this component doesn't use contact record tabs
164 return NULL;
165 }
166
74cf4551 167 /**
e7c15cb6 168 * @inheritDoc
74cf4551
EM
169 * Provides information about advanced search pane
170 * offered by this component.
171 *
72b3a70c
CW
172 * @return array|null
173 * collection of required pane settings,
74cf4551 174 * null if no element offered
74cf4551
EM
175 */
176 /**
177 * @return array|null
178 */
6a488035
TO
179 public function registerAdvancedSearchPane() {
180 // this component doesn't use advanced search
181 return NULL;
182 }
183
74cf4551 184 /**
e7c15cb6 185 * @inheritDoc
74cf4551
EM
186 * Provides potential activity types that this
187 * component might want to register in activity history.
188 * Needs to be implemented in component's information
189 * class.
190 *
72b3a70c
CW
191 * @return array|null
192 * collection of activity types
74cf4551
EM
193 */
194 /**
195 * @return array|null
196 */
6a488035
TO
197 public function getActivityTypes() {
198 return NULL;
199 }
200
74cf4551 201 /**
fe482240 202 * add shortcut to Create New.
74cf4551
EM
203 * @param $shortCuts
204 */
84178120
TO
205 public function creatNewShortcut(&$shortCuts) {
206 }
96025800 207
6a488035 208}