Merge pull request #9754 from lcdservices/CRM-19947
[civicrm-core.git] / CRM / Report / Info.php
CommitLineData
6a488035 1<?php
6a488035
TO
2/*
3 +--------------------------------------------------------------------+
7e9e8871 4 | CiviCRM version 4.7 |
6a488035 5 +--------------------------------------------------------------------+
0f03f337 6 | Copyright CiviCRM LLC (c) 2004-2017 |
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 *
0f03f337 33 * @copyright CiviCRM LLC (c) 2004-2017
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'),
57 'title' => 'CiviCRM Report Engine',
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 ),
92991caf
SV
90 'administer private reports' => array(
91 ts('administer private reports'),
92 ts('Edit all private reports'),
0f8c6e58 93 ),
221b21b4
AH
94 'administer reserved reports' => array(
95 ts('administer reserved reports'),
96 ts('Edit all reports that have been marked as reserved'),
97 ),
98 'administer Reports' => array(
99 ts('administer Reports'),
100 ts('Manage report templates'),
101 ),
02d451ab
EM
102 'view report sql' => array(
103 ts('view report sql'),
104 ts('View sql used in CiviReports'),
105 ),
221b21b4
AH
106 );
107
108 if (!$descriptions) {
109 foreach ($permissions as $name => $attr) {
110 $permissions[$name] = array_shift($attr);
111 }
112 }
113
114 return $permissions;
6a488035
TO
115 }
116
117
74cf4551 118 /**
e7c15cb6 119 * @inheritDoc
74cf4551
EM
120 * Provides information about user dashboard element
121 * offered by this component.
122 *
72b3a70c
CW
123 * @return array|null
124 * collection of required dashboard settings,
74cf4551 125 * null if no element offered
74cf4551 126 */
6a488035
TO
127 public function getUserDashboardElement() {
128 // no dashboard element for this component
129 return NULL;
130 }
131
74cf4551
EM
132 /**
133 * Provides component's user dashboard page object.
134 *
72b3a70c
CW
135 * @return mixed
136 * component's User Dashboard applet object
74cf4551
EM
137 */
138 /**
139 * @return mixed
140 */
6a488035
TO
141 public function getUserDashboardObject() {
142 // no dashboard element for this component
143 return NULL;
144 }
145
74cf4551 146 /**
e7c15cb6 147 * @inheritDoc
74cf4551
EM
148 * Provides information about user dashboard element
149 * offered by this component.
150 *
72b3a70c
CW
151 * @return array|null
152 * collection of required dashboard settings,
74cf4551 153 * null if no element offered
74cf4551
EM
154 */
155 /**
156 * @return array|null
157 */
6a488035
TO
158 public function registerTab() {
159 // this component doesn't use contact record tabs
160 return NULL;
161 }
162
74cf4551 163 /**
e7c15cb6 164 * @inheritDoc
74cf4551
EM
165 * Provides information about advanced search pane
166 * offered by this component.
167 *
72b3a70c
CW
168 * @return array|null
169 * collection of required pane settings,
74cf4551 170 * null if no element offered
74cf4551
EM
171 */
172 /**
173 * @return array|null
174 */
6a488035
TO
175 public function registerAdvancedSearchPane() {
176 // this component doesn't use advanced search
177 return NULL;
178 }
179
74cf4551 180 /**
e7c15cb6 181 * @inheritDoc
74cf4551
EM
182 * Provides potential activity types that this
183 * component might want to register in activity history.
184 * Needs to be implemented in component's information
185 * class.
186 *
72b3a70c
CW
187 * @return array|null
188 * collection of activity types
74cf4551
EM
189 */
190 /**
191 * @return array|null
192 */
6a488035
TO
193 public function getActivityTypes() {
194 return NULL;
195 }
196
74cf4551 197 /**
fe482240 198 * add shortcut to Create New.
74cf4551
EM
199 * @param $shortCuts
200 */
84178120
TO
201 public function creatNewShortcut(&$shortCuts) {
202 }
96025800 203
6a488035 204}