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
20 class CRM_Event_Info
extends CRM_Core_Component_Info
{
26 protected $keyword = 'event';
32 public function getInfo() {
34 'name' => 'CiviEvent',
35 'translatedName' => ts('CiviEvent'),
36 'title' => ts('CiviCRM Event Engine'),
38 'showActivitiesInCore' => 1,
44 * @param bool $getAllUnconditionally
45 * @param bool $descriptions
46 * Whether to return permission descriptions
50 public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
52 'access CiviEvent' => [
53 ts('access CiviEvent'),
54 ts('Create events, view all events, and view participant records (for visible contacts)'),
56 'edit event participants' => [
57 ts('edit event participants'),
58 ts('Record and update backend event registrations'),
60 'edit all events' => [
61 ts('edit all events'),
62 ts('Edit events even without specific ACL granted'),
64 'register for events' => [
65 ts('register for events'),
66 ts('Register for events online'),
68 'view event info' => [
69 ts('view event info'),
70 ts('View online event information pages'),
72 'view event participants' => [
73 ts('view event participants'),
75 'delete in CiviEvent' => [
76 ts('delete in CiviEvent'),
77 ts('Delete participants and events that you can edit'),
79 'manage event profiles' => [
80 ts('manage event profiles'),
81 ts('Allow users to create, edit and copy event-related profile forms used for online event registration.'),
86 foreach ($permissions as $name => $attr) {
87 $permissions[$name] = array_shift($attr);
97 public function getAnonymousPermissionWarnings() {
107 public function getUserDashboardElement() {
109 'name' => ts('Events'),
110 'title' => ts('Your Event(s)'),
111 'perm' => ['register for events'],
120 public function registerTab() {
122 'title' => ts('Events'),
123 'id' => 'participant',
124 'url' => 'participant',
133 public function getIcon() {
134 return 'crm-i fa-calendar';
141 public function registerAdvancedSearchPane() {
143 'title' => ts('Events'),
152 public function getActivityTypes() {
155 'title' => ts('Event'),
156 'callback' => 'CRM_Event_Page_EventInfo::run()',
162 * add shortcut to Create New.
166 public function creatNewShortcut(&$shortCuts, $newCredit) {
167 if (CRM_Core_Permission
::check('access CiviEvent') &&
168 CRM_Core_Permission
::check('edit event participants')
171 'path' => 'civicrm/participant/add',
172 'query' => "reset=1&action=add&context=standalone",
173 'ref' => 'new-participant',
174 'title' => ts('Event Registration'),
177 $title = ts('Event Registration') . '<br /> (' . ts('credit card') . ')';
178 $shortCut[0]['shortCuts'][] = [
179 'path' => 'civicrm/participant/add',
180 'query' => "reset=1&action=add&context=standalone&mode=live",
181 'ref' => 'new-participant-cc',
185 $shortCuts = array_merge($shortCuts, $shortCut);