3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2019 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * This class introduces component to the system and provides all the
30 * information about it. It needs to extend CRM_Core_Component_Info
33 * @copyright CiviCRM LLC (c) 2004-2019
37 class CRM_Report_Info
extends CRM_Core_Component_Info
{
42 protected $keyword = 'report';
46 * Provides base information about the component.
47 * Needs to be implemented in component's information
51 * collection of required component settings
53 public function getInfo() {
55 'name' => 'CiviReport',
56 'translatedName' => ts('CiviReport'),
57 'title' => ts('CiviCRM Report Engine'),
59 'showActivitiesInCore' => 1,
66 * Provides permissions that are used by component.
67 * Needs to be implemented in component's information
70 * NOTE: if using conditionally permission return,
71 * implementation of $getAllUnconditionally is required.
73 * @param bool $getAllUnconditionally
74 * @param bool $descriptions
75 * Whether to return permission descriptions
78 * collection of permissions, null if none
80 public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
82 'access CiviReport' => [
83 ts('access CiviReport'),
86 'access Report Criteria' => [
87 ts('access Report Criteria'),
88 ts('Change report search criteria'),
90 'save Report Criteria' => [
91 ts('save Report Criteria'),
92 ts('Save report search criteria'),
94 'administer private reports' => [
95 ts('administer private reports'),
96 ts('Edit all private reports'),
98 'administer reserved reports' => [
99 ts('administer reserved reports'),
100 ts('Edit all reports that have been marked as reserved'),
102 'administer Reports' => [
103 ts('administer Reports'),
104 ts('Manage report templates'),
106 'view report sql' => [
107 ts('view report sql'),
108 ts('View sql used in CiviReports'),
112 if (!$descriptions) {
113 foreach ($permissions as $name => $attr) {
114 $permissions[$name] = array_shift($attr);
124 * Provides information about user dashboard element
125 * offered by this component.
128 * collection of required dashboard settings,
129 * null if no element offered
131 public function getUserDashboardElement() {
132 // no dashboard element for this component
137 * Provides component's user dashboard page object.
140 * component's User Dashboard applet object
145 public function getUserDashboardObject() {
146 // no dashboard element for this component
152 * Provides information about user dashboard element
153 * offered by this component.
156 * collection of required dashboard settings,
157 * null if no element offered
162 public function registerTab() {
163 // this component doesn't use contact record tabs
171 public function getIcon() {
172 return 'crm-i fa-table';
177 * Provides information about advanced search pane
178 * offered by this component.
181 * collection of required pane settings,
182 * null if no element offered
187 public function registerAdvancedSearchPane() {
188 // this component doesn't use advanced search
194 * Provides potential activity types that this
195 * component might want to register in activity history.
196 * Needs to be implemented in component's information
200 * collection of activity types
205 public function getActivityTypes() {
210 * add shortcut to Create New.
213 public function creatNewShortcut(&$shortCuts) {