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_Campaign_Info
extends CRM_Core_Component_Info
{
26 protected $keyword = 'campaign';
32 public function getInfo() {
34 'name' => 'CiviCampaign',
35 'translatedName' => ts('CiviCampaign'),
36 'title' => ts('CiviCRM Campaign 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 'administer CiviCampaign' => [
53 ts('administer CiviCampaign'),
54 ts('Create new campaign, survey and petition types and their status'),
56 'manage campaign' => [
57 ts('manage campaign'),
58 ts('Create new campaigns, surveys and petitions, reserve respondents'),
60 'reserve campaign contacts' => [
61 ts('reserve campaign contacts'),
62 ts('Reserve campaign contacts for surveys and petitions'),
64 'release campaign contacts' => [
65 ts('release campaign contacts'),
66 ts('Release reserved campaign contacts for surveys and petitions'),
68 'interview campaign contacts' => [
69 ts('interview campaign contacts'),
70 ts('Record survey and petition responses from their reserved contacts'),
72 'gotv campaign contacts' => [
73 ts('GOTV campaign contacts'),
74 ts('Record that contacts voted'),
76 'sign CiviCRM Petition' => [
77 ts('sign CiviCRM Petition'),
82 foreach ($permissions as $name => $attr) {
83 $permissions[$name] = array_shift($attr);
94 public function getUserDashboardElement() {
95 // no dashboard element for this component
102 public function getUserDashboardObject() {
103 // no dashboard element for this component
111 public function registerTab() {
112 // this component doesn't use contact record tabs
120 public function getIcon() {
121 return 'crm-i fa-star-o';
128 public function registerAdvancedSearchPane() {
129 // this component doesn't use advanced search
136 public function getActivityTypes() {
141 * add shortcut to Create New.
144 public function creatNewShortcut(&$shortCuts) {
145 if (CRM_Core_Permission
::check('manage campaign') ||
146 CRM_Core_Permission
::check('administer CiviCampaign')
148 $shortCuts = array_merge($shortCuts, [
150 'path' => 'civicrm/campaign/add',
151 'query' => "reset=1&action=add",
152 'ref' => 'new-campaign',
153 'title' => ts('Campaign'),
156 'path' => 'civicrm/survey/add',
157 'query' => "reset=1&action=add",
158 'ref' => 'new-survey',
159 'title' => ts('Survey'),