3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 |
9 +--------------------------------------------------------------------+
13 * This class introduces component to the system and provides all the
14 * information about it. It needs to extend CRM_Core_Component_Info
18 * @copyright CiviCRM LLC https://civicrm.org/licensing
22 class CRM_Event_Info
extends CRM_Core_Component_Info
{
28 protected $keyword = 'event';
34 public function getInfo() {
36 'name' => 'CiviEvent',
37 'translatedName' => ts('CiviEvent'),
38 'title' => ts('CiviCRM Event Engine'),
40 'showActivitiesInCore' => 1,
46 * @param bool $getAllUnconditionally
47 * @param bool $descriptions
48 * Whether to return permission descriptions
52 public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
54 'access CiviEvent' => [
55 ts('access CiviEvent'),
56 ts('Create events, view all events, and view participant records (for visible contacts)'),
58 'edit event participants' => [
59 ts('edit event participants'),
60 ts('Record and update backend event registrations'),
62 'edit all events' => [
63 ts('edit all events'),
64 ts('Edit events even without specific ACL granted'),
66 'register for events' => [
67 ts('register for events'),
68 ts('Register for events online'),
70 'view event info' => [
71 ts('view event info'),
72 ts('View online event information pages'),
74 'view event participants' => [
75 ts('view event participants'),
77 'delete in CiviEvent' => [
78 ts('delete in CiviEvent'),
79 ts('Delete participants and events that you can edit'),
81 'manage event profiles' => [
82 ts('manage event profiles'),
83 ts('Allow users to create, edit and copy event-related profile forms used for online event registration.'),
88 foreach ($permissions as $name => $attr) {
89 $permissions[$name] = array_shift($attr);
99 public function getAnonymousPermissionWarnings() {
109 public function getUserDashboardElement() {
111 'name' => ts('Events'),
112 'title' => ts('Your Event(s)'),
113 'perm' => ['register for events'],
122 public function registerTab() {
124 'title' => ts('Events'),
125 'id' => 'participant',
126 'url' => 'participant',
135 public function getIcon() {
136 return 'crm-i fa-calendar';
143 public function registerAdvancedSearchPane() {
145 'title' => ts('Events'),
154 public function getActivityTypes() {
157 'title' => ts('Event'),
158 'callback' => 'CRM_Event_Page_EventInfo::run()',
164 * add shortcut to Create New.
168 public function creatNewShortcut(&$shortCuts, $newCredit) {
169 if (CRM_Core_Permission
::check('access CiviEvent') &&
170 CRM_Core_Permission
::check('edit event participants')
173 'path' => 'civicrm/participant/add',
174 'query' => "reset=1&action=add&context=standalone",
175 'ref' => 'new-participant',
176 'title' => ts('Event Registration'),
179 $title = ts('Event Registration') . '<br /> (' . ts('credit card') . ')';
180 $shortCut[0]['shortCuts'][] = [
181 'path' => 'civicrm/participant/add',
182 'query' => "reset=1&action=add&context=standalone&mode=live",
183 'ref' => 'new-participant-cc',
187 $shortCuts = array_merge($shortCuts, $shortCut);