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
34 * @copyright CiviCRM LLC (c) 2004-2019
38 class CRM_Event_Info
extends CRM_Core_Component_Info
{
44 protected $keyword = 'event';
50 public function getInfo() {
52 'name' => 'CiviEvent',
53 'translatedName' => ts('CiviEvent'),
54 'title' => ts('CiviCRM Event Engine'),
56 'showActivitiesInCore' => 1,
62 * @param bool $getAllUnconditionally
63 * @param bool $descriptions
64 * Whether to return permission descriptions
68 public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
70 'access CiviEvent' => [
71 ts('access CiviEvent'),
72 ts('Create events, view all events, and view participant records (for visible contacts)'),
74 'edit event participants' => [
75 ts('edit event participants'),
76 ts('Record and update backend event registrations'),
78 'edit all events' => [
79 ts('edit all events'),
80 ts('Edit events even without specific ACL granted'),
82 'register for events' => [
83 ts('register for events'),
84 ts('Register for events online'),
86 'view event info' => [
87 ts('view event info'),
88 ts('View online event information pages'),
90 'view event participants' => [
91 ts('view event participants'),
93 'delete in CiviEvent' => [
94 ts('delete in CiviEvent'),
95 ts('Delete participants and events that you can edit'),
97 'manage event profiles' => [
98 ts('manage event profiles'),
99 ts('Allow users to create, edit and copy event-related profile forms used for online event registration.'),
103 if (!$descriptions) {
104 foreach ($permissions as $name => $attr) {
105 $permissions[$name] = array_shift($attr);
115 public function getAnonymousPermissionWarnings() {
125 public function getUserDashboardElement() {
127 'name' => ts('Events'),
128 'title' => ts('Your Event(s)'),
129 'perm' => ['register for events'],
138 public function registerTab() {
140 'title' => ts('Events'),
141 'id' => 'participant',
142 'url' => 'participant',
151 public function getIcon() {
152 return 'crm-i fa-calendar';
159 public function registerAdvancedSearchPane() {
161 'title' => ts('Events'),
170 public function getActivityTypes() {
173 'title' => ts('Event'),
174 'callback' => 'CRM_Event_Page_EventInfo::run()',
180 * add shortcut to Create New.
184 public function creatNewShortcut(&$shortCuts, $newCredit) {
185 if (CRM_Core_Permission
::check('access CiviEvent') &&
186 CRM_Core_Permission
::check('edit event participants')
189 'path' => 'civicrm/participant/add',
190 'query' => "reset=1&action=add&context=standalone",
191 'ref' => 'new-participant',
192 'title' => ts('Event Registration'),
195 $title = ts('Event Registration') . '<br /> (' . ts('credit card') . ')';
196 $shortCut[0]['shortCuts'][] = [
197 'path' => 'civicrm/participant/add',
198 'query' => "reset=1&action=add&context=standalone&mode=live",
199 'ref' => 'new-participant-cc',
203 $shortCuts = array_merge($shortCuts, $shortCut);