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
36 class CRM_Campaign_Info
extends CRM_Core_Component_Info
{
42 protected $keyword = 'campaign';
48 public function getInfo() {
50 'name' => 'CiviCampaign',
51 'translatedName' => ts('CiviCampaign'),
52 'title' => ts('CiviCRM Campaign Engine'),
54 'showActivitiesInCore' => 1,
60 * @param bool $getAllUnconditionally
61 * @param bool $descriptions
62 * Whether to return permission descriptions
66 public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
68 'administer CiviCampaign' => [
69 ts('administer CiviCampaign'),
70 ts('Create new campaign, survey and petition types and their status'),
72 'manage campaign' => [
73 ts('manage campaign'),
74 ts('Create new campaigns, surveys and petitions, reserve respondents'),
76 'reserve campaign contacts' => [
77 ts('reserve campaign contacts'),
78 ts('Reserve campaign contacts for surveys and petitions'),
80 'release campaign contacts' => [
81 ts('release campaign contacts'),
82 ts('Release reserved campaign contacts for surveys and petitions'),
84 'interview campaign contacts' => [
85 ts('interview campaign contacts'),
86 ts('Record survey and petition responses from their reserved contacts'),
88 'gotv campaign contacts' => [
89 ts('GOTV campaign contacts'),
90 ts('Record that contacts voted'),
92 'sign CiviCRM Petition' => [
93 ts('sign CiviCRM Petition'),
98 foreach ($permissions as $name => $attr) {
99 $permissions[$name] = array_shift($attr);
110 public function getUserDashboardElement() {
111 // no dashboard element for this component
118 public function getUserDashboardObject() {
119 // no dashboard element for this component
127 public function registerTab() {
128 // this component doesn't use contact record tabs
136 public function getIcon() {
137 return 'crm-i fa-star-o';
144 public function registerAdvancedSearchPane() {
145 // this component doesn't use advanced search
152 public function getActivityTypes() {
157 * add shortcut to Create New.
160 public function creatNewShortcut(&$shortCuts) {
161 if (CRM_Core_Permission
::check('manage campaign') ||
162 CRM_Core_Permission
::check('administer CiviCampaign')
164 $shortCuts = array_merge($shortCuts, [
166 'path' => 'civicrm/campaign/add',
167 'query' => "reset=1&action=add",
168 'ref' => 'new-campaign',
169 'title' => ts('Campaign'),
172 'path' => 'civicrm/survey/add',
173 'query' => "reset=1&action=add",
174 'ref' => 'new-survey',
175 'title' => ts('Survey'),