Merge remote-tracking branch 'upstream/4.5' into 4.5-4.6-2015-03-23-18-42-19
[civicrm-core.git] / CRM / Campaign / Info.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
39de6fd5 4 | CiviCRM version 4.6 |
6a488035 5 +--------------------------------------------------------------------+
06b69b18 6 | Copyright CiviCRM LLC (c) 2004-2014 |
6a488035
TO
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
d25dd0ee 26 */
6a488035
TO
27
28/**
29 * This class introduces component to the system and provides all the
30 * information about it. It needs to extend CRM_Core_Component_Info
31 * abstract class.
32 *
33 * @package CRM
06b69b18 34 * @copyright CiviCRM LLC (c) 2004-2014
6a488035
TO
35 * $Id$
36 *
37 */
38class CRM_Campaign_Info extends CRM_Core_Component_Info {
39
e7c15cb6
CW
40 /**
41 * @inheritDoc
42 */
6a488035
TO
43 protected $keyword = 'campaign';
44
30c4e065 45 /**
e7c15cb6 46 * @inheritDoc
30c4e065
EM
47 * @return array
48 */
6a488035
TO
49 public function getInfo() {
50 return array(
51 'name' => 'CiviCampaign',
52 'translatedName' => ts('CiviCampaign'),
53 'title' => 'CiviCRM Campaign Engine',
54 'search' => 1,
55 'showActivitiesInCore' => 1,
56 );
57 }
58
59
30c4e065 60 /**
e7c15cb6 61 * @inheritDoc
30c4e065
EM
62 * @param bool $getAllUnconditionally
63 *
64 * @return array
65 */
33777e4a 66 public function getPermissions($getAllUnconditionally = FALSE) {
6a488035
TO
67 return array(
68 'administer CiviCampaign',
69 'manage campaign',
70 'reserve campaign contacts',
71 'release campaign contacts',
72 'interview campaign contacts',
73 'gotv campaign contacts',
74 'sign CiviCRM Petition',
75 );
76 }
77
78
30c4e065 79 /**
e7c15cb6 80 * @inheritDoc
30c4e065
EM
81 * @return null
82 */
6a488035
TO
83 public function getUserDashboardElement() {
84 // no dashboard element for this component
85 return NULL;
86 }
87
30c4e065
EM
88 /**
89 * @return null
90 */
6a488035
TO
91 public function getUserDashboardObject() {
92 // no dashboard element for this component
93 return NULL;
94 }
95
30c4e065 96 /**
e7c15cb6 97 * @inheritDoc
30c4e065
EM
98 * @return null
99 */
6a488035
TO
100 public function registerTab() {
101 // this component doesn't use contact record tabs
102 return NULL;
103 }
104
30c4e065 105 /**
e7c15cb6 106 * @inheritDoc
30c4e065
EM
107 * @return null
108 */
6a488035
TO
109 public function registerAdvancedSearchPane() {
110 // this component doesn't use advanced search
111 return NULL;
112 }
113
30c4e065 114 /**
e7c15cb6 115 * @inheritDoc
30c4e065 116 */
6a488035
TO
117 public function getActivityTypes() {
118 return NULL;
119 }
120
30c4e065 121 /**
fe482240 122 * add shortcut to Create New.
30c4e065
EM
123 * @param $shortCuts
124 */
6a488035
TO
125 public function creatNewShortcut(&$shortCuts) {
126 if (CRM_Core_Permission::check('manage campaign') ||
127 CRM_Core_Permission::check('administer CiviCampaign')
128 ) {
129 $shortCuts = array_merge($shortCuts, array(
94880218 130 array(
353ffa53
TO
131 'path' => 'civicrm/campaign/add',
132 'query' => "reset=1&action=add",
133 'ref' => 'new-campaign',
134 'title' => ts('Campaign'),
135 ),
136 array(
137 'path' => 'civicrm/survey/add',
138 'query' => "reset=1&action=add",
139 'ref' => 'new-survey',
140 'title' => ts('Survey'),
141 ),
142 ));
6a488035
TO
143 }
144 }
96025800 145
6a488035 146}