Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
bc77d7c0 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 5 | | | |
bc77d7c0 TO |
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 | | |
6a488035 TO |
9 | +--------------------------------------------------------------------+ |
10 | */ | |
11 | ||
12 | /** | |
13 | * | |
14 | * @package CRM | |
ca5cec67 | 15 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
6a488035 TO |
16 | */ |
17 | ||
18 | /** | |
df371444 | 19 | * Page for displaying Campaigns. |
6a488035 TO |
20 | */ |
21 | class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { | |
22 | ||
23 | /** | |
fe482240 | 24 | * The action links that we need to display for the browse screen. |
6a488035 TO |
25 | * |
26 | * @var array | |
27 | */ | |
28 | private static $_campaignActionLinks; | |
29 | private static $_surveyActionLinks; | |
30 | private static $_petitionActionLinks; | |
31 | ||
32 | /** | |
33 | * Get the action links for this page. | |
34 | * | |
a6c01b45 | 35 | * @return array |
6a488035 | 36 | */ |
de18909a | 37 | public static function campaignActionLinks() { |
6a488035 TO |
38 | // check if variable _actionsLinks is populated |
39 | if (!isset(self::$_campaignActionLinks)) { | |
be2fb01f CW |
40 | self::$_campaignActionLinks = [ |
41 | CRM_Core_Action::UPDATE => [ | |
6a488035 TO |
42 | 'name' => ts('Edit'), |
43 | 'url' => 'civicrm/campaign/add', | |
44 | 'qs' => 'reset=1&action=update&id=%%id%%', | |
45 | 'title' => ts('Update Campaign'), | |
be2fb01f CW |
46 | ], |
47 | CRM_Core_Action::DISABLE => [ | |
6a488035 TO |
48 | 'name' => ts('Disable'), |
49 | 'title' => ts('Disable Campaign'), | |
4d17a233 | 50 | 'ref' => 'crm-enable-disable', |
be2fb01f CW |
51 | ], |
52 | CRM_Core_Action::ENABLE => [ | |
6a488035 TO |
53 | 'name' => ts('Enable'), |
54 | 'title' => ts('Enable Campaign'), | |
4d17a233 | 55 | 'ref' => 'crm-enable-disable', |
be2fb01f CW |
56 | ], |
57 | CRM_Core_Action::DELETE => [ | |
6a488035 TO |
58 | 'name' => ts('Delete'), |
59 | 'url' => 'civicrm/campaign/add', | |
60 | 'qs' => 'action=delete&reset=1&id=%%id%%', | |
61 | 'title' => ts('Delete Campaign'), | |
be2fb01f CW |
62 | ], |
63 | ]; | |
6a488035 TO |
64 | } |
65 | ||
66 | return self::$_campaignActionLinks; | |
67 | } | |
68 | ||
30c4e065 EM |
69 | /** |
70 | * @return array | |
71 | */ | |
de18909a | 72 | public static function surveyActionLinks() { |
6a488035 TO |
73 | // check if variable _actionsLinks is populated |
74 | if (!isset(self::$_surveyActionLinks)) { | |
be2fb01f CW |
75 | self::$_surveyActionLinks = [ |
76 | CRM_Core_Action::UPDATE => [ | |
6a488035 TO |
77 | 'name' => ts('Edit'), |
78 | 'url' => 'civicrm/survey/configure/main', | |
79 | 'qs' => 'action=update&id=%%id%%&reset=1', | |
80 | 'title' => ts('Update Survey'), | |
be2fb01f CW |
81 | ], |
82 | CRM_Core_Action::DISABLE => [ | |
6a488035 | 83 | 'name' => ts('Disable'), |
4d17a233 | 84 | 'ref' => 'crm-enable-disable', |
6a488035 | 85 | 'title' => ts('Disable Survey'), |
be2fb01f CW |
86 | ], |
87 | CRM_Core_Action::ENABLE => [ | |
6a488035 | 88 | 'name' => ts('Enable'), |
4d17a233 | 89 | 'ref' => 'crm-enable-disable', |
6a488035 | 90 | 'title' => ts('Enable Survey'), |
be2fb01f CW |
91 | ], |
92 | CRM_Core_Action::DELETE => [ | |
6a488035 TO |
93 | 'name' => ts('Delete'), |
94 | 'url' => 'civicrm/survey/delete', | |
95 | 'qs' => 'id=%%id%%&reset=1', | |
96 | 'title' => ts('Delete Survey'), | |
be2fb01f CW |
97 | ], |
98 | ]; | |
6a488035 TO |
99 | } |
100 | ||
101 | return self::$_surveyActionLinks; | |
102 | } | |
103 | ||
30c4e065 EM |
104 | /** |
105 | * @return array | |
106 | */ | |
de18909a | 107 | public static function petitionActionLinks() { |
6a488035 TO |
108 | if (!isset(self::$_petitionActionLinks)) { |
109 | self::$_petitionActionLinks = self::surveyActionLinks(); | |
be2fb01f | 110 | self::$_petitionActionLinks[CRM_Core_Action::UPDATE] = [ |
6a488035 TO |
111 | 'name' => ts('Edit'), |
112 | 'url' => 'civicrm/petition/add', | |
113 | 'qs' => 'action=update&id=%%id%%&reset=1', | |
114 | 'title' => ts('Update Petition'), | |
be2fb01f CW |
115 | ]; |
116 | self::$_petitionActionLinks[CRM_Core_Action::DISABLE] = [ | |
6a488035 | 117 | 'name' => ts('Disable'), |
4d17a233 | 118 | 'ref' => 'crm-enable-disable', |
6a488035 | 119 | 'title' => ts('Disable Petition'), |
be2fb01f CW |
120 | ]; |
121 | self::$_petitionActionLinks[CRM_Core_Action::ENABLE] = [ | |
6a488035 | 122 | 'name' => ts('Enable'), |
4d17a233 | 123 | 'ref' => 'crm-enable-disable', |
6a488035 | 124 | 'title' => ts('Enable Petition'), |
be2fb01f CW |
125 | ]; |
126 | self::$_petitionActionLinks[CRM_Core_Action::DELETE] = [ | |
6a488035 TO |
127 | 'name' => ts('Delete'), |
128 | 'url' => 'civicrm/petition/add', | |
129 | 'qs' => 'action=delete&id=%%id%%&reset=1', | |
130 | 'title' => ts('Delete Petition'), | |
be2fb01f CW |
131 | ]; |
132 | self::$_petitionActionLinks[CRM_Core_Action::PROFILE] = [ | |
6a488035 TO |
133 | 'name' => ts('Sign'), |
134 | 'url' => 'civicrm/petition/sign', | |
135 | 'qs' => 'sid=%%id%%&reset=1', | |
136 | 'title' => ts('Sign Petition'), | |
137 | 'fe' => TRUE, | |
353ffa53 | 138 | //CRM_Core_Action::PROFILE is used because there isn't a specific action for sign |
be2fb01f CW |
139 | ]; |
140 | self::$_petitionActionLinks[CRM_Core_Action::BROWSE] = [ | |
6a488035 TO |
141 | 'name' => ts('Signatures'), |
142 | 'url' => 'civicrm/activity/search', | |
143 | 'qs' => 'survey=%%id%%&force=1', | |
144 | 'title' => ts('List the signatures'), | |
353ffa53 | 145 | //CRM_Core_Action::PROFILE is used because there isn't a specific action for sign |
be2fb01f | 146 | ]; |
6a488035 TO |
147 | } |
148 | ||
149 | return self::$_petitionActionLinks; | |
150 | } | |
151 | ||
627456b5 EM |
152 | /** |
153 | * @return mixed | |
154 | */ | |
00be9182 | 155 | public function browseCampaign() { |
6a488035 TO |
156 | // ensure valid javascript (these must have a value set) |
157 | $this->assign('searchParams', json_encode(NULL)); | |
158 | $this->assign('campaignTypes', json_encode(NULL)); | |
159 | $this->assign('campaignStatus', json_encode(NULL)); | |
160 | ||
161 | $this->assign('addCampaignUrl', CRM_Utils_System::url('civicrm/campaign/add', 'reset=1&action=add')); | |
162 | $campaignCount = CRM_Campaign_BAO_Campaign::getCampaignCount(); | |
163 | //don't load find interface when no campaigns in db. | |
164 | if (!$campaignCount) { | |
165 | $this->assign('hasCampaigns', FALSE); | |
166 | return; | |
167 | } | |
168 | $this->assign('hasCampaigns', TRUE); | |
169 | ||
170 | //build the ajaxify campaign search and selector. | |
171 | $controller = new CRM_Core_Controller_Simple('CRM_Campaign_Form_Search_Campaign', ts('Search Campaigns')); | |
172 | $controller->set('searchTab', 'campaign'); | |
173 | $controller->setEmbedded(TRUE); | |
174 | $controller->process(); | |
175 | return $controller->run(); | |
176 | } | |
177 | ||
30c4e065 EM |
178 | /** |
179 | * @param array $params | |
180 | * | |
181 | * @return array | |
182 | */ | |
be2fb01f CW |
183 | public static function getCampaignSummary($params = []) { |
184 | $campaignsData = []; | |
6a488035 TO |
185 | |
186 | //get the campaigns. | |
187 | $campaigns = CRM_Campaign_BAO_Campaign::getCampaignSummary($params); | |
188 | if (!empty($campaigns)) { | |
353ffa53 TO |
189 | $config = CRM_Core_Config::singleton(); |
190 | $campaignType = CRM_Campaign_PseudoConstant::campaignType(); | |
6a488035 | 191 | $campaignStatus = CRM_Campaign_PseudoConstant::campaignStatus(); |
be2fb01f | 192 | $properties = [ |
353ffa53 TO |
193 | 'id', |
194 | 'name', | |
195 | 'title', | |
196 | 'status_id', | |
197 | 'description', | |
198 | 'campaign_type_id', | |
199 | 'is_active', | |
200 | 'start_date', | |
201 | 'end_date', | |
be2fb01f | 202 | ]; |
6a488035 TO |
203 | foreach ($campaigns as $cmpid => $campaign) { |
204 | foreach ($properties as $prop) { | |
9c1bc317 | 205 | $campaignsData[$cmpid][$prop] = $campaign[$prop] ?? NULL; |
6a488035 | 206 | } |
9c1bc317 CW |
207 | $statusId = $campaign['status_id'] ?? NULL; |
208 | $campaignsData[$cmpid]['status'] = $campaignStatus[$statusId] ?? NULL; | |
6a488035 TO |
209 | $campaignsData[$cmpid]['campaign_id'] = $campaign['id']; |
210 | $campaignsData[$cmpid]['campaign_type'] = $campaignType[$campaign['campaign_type_id']]; | |
211 | ||
212 | $action = array_sum(array_keys(self::campaignActionLinks())); | |
213 | if ($campaign['is_active']) { | |
214 | $action -= CRM_Core_Action::ENABLE; | |
215 | } | |
216 | else { | |
217 | $action -= CRM_Core_Action::DISABLE; | |
218 | } | |
219 | ||
220 | $isActive = ts('No'); | |
221 | if ($campaignsData[$cmpid]['is_active']) { | |
222 | $isActive = ts('Yes'); | |
223 | } | |
224 | $campaignsData[$cmpid]['isActive'] = $isActive; | |
225 | ||
a7488080 | 226 | if (!empty($campaignsData[$cmpid]['start_date'])) { |
6a488035 TO |
227 | $campaignsData[$cmpid]['start_date'] = CRM_Utils_Date::customFormat($campaignsData[$cmpid]['start_date'], |
228 | $config->dateformatFull | |
229 | ); | |
230 | } | |
a7488080 | 231 | if (!empty($campaignsData[$cmpid]['end_date'])) { |
6a488035 TO |
232 | $campaignsData[$cmpid]['end_date'] = CRM_Utils_Date::customFormat($campaignsData[$cmpid]['end_date'], |
233 | $config->dateformatFull | |
234 | ); | |
235 | } | |
236 | $campaignsData[$cmpid]['action'] = CRM_Core_Action::formLink(self::campaignActionLinks(), | |
237 | $action, | |
be2fb01f | 238 | ['id' => $campaign['id']], |
87dab4a4 AH |
239 | ts('more'), |
240 | FALSE, | |
241 | 'campaign.dashboard.row', | |
242 | 'Campaign', | |
243 | $campaign['id'] | |
6a488035 TO |
244 | ); |
245 | } | |
246 | } | |
247 | ||
248 | return $campaignsData; | |
249 | } | |
250 | ||
bb271167 EM |
251 | /** |
252 | * @return mixed | |
253 | */ | |
00be9182 | 254 | public function browseSurvey() { |
6a488035 TO |
255 | // ensure valid javascript - this must have a value set |
256 | $this->assign('searchParams', json_encode(NULL)); | |
257 | $this->assign('surveyTypes', json_encode(NULL)); | |
258 | $this->assign('surveyCampaigns', json_encode(NULL)); | |
259 | ||
260 | $this->assign('addSurveyUrl', CRM_Utils_System::url('civicrm/survey/add', 'reset=1&action=add')); | |
261 | ||
262 | $surveyCount = CRM_Campaign_BAO_Survey::getSurveyCount(); | |
263 | //don't load find interface when no survey in db. | |
264 | if (!$surveyCount) { | |
265 | $this->assign('hasSurveys', FALSE); | |
266 | return; | |
267 | } | |
268 | $this->assign('hasSurveys', TRUE); | |
269 | ||
270 | //build the ajaxify survey search and selector. | |
271 | $controller = new CRM_Core_Controller_Simple('CRM_Campaign_Form_Search_Survey', ts('Search Survey')); | |
272 | $controller->set('searchTab', 'survey'); | |
273 | $controller->setEmbedded(TRUE); | |
274 | $controller->process(); | |
275 | return $controller->run(); | |
276 | } | |
277 | ||
30c4e065 EM |
278 | /** |
279 | * @param array $params | |
280 | * | |
281 | * @return array | |
282 | */ | |
be2fb01f CW |
283 | public static function getSurveySummary($params = []) { |
284 | $surveysData = []; | |
6a488035 TO |
285 | |
286 | //get the survey. | |
287 | $config = CRM_Core_Config::singleton(); | |
288 | $surveys = CRM_Campaign_BAO_Survey::getSurveySummary($params); | |
289 | if (!empty($surveys)) { | |
290 | $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE); | |
291 | $surveyType = CRM_Campaign_BAO_Survey::getSurveyActivityType(); | |
292 | foreach ($surveys as $sid => $survey) { | |
293 | $surveysData[$sid] = $survey; | |
9c1bc317 CW |
294 | $campaignId = $survey['campaign_id'] ?? NULL; |
295 | $surveysData[$sid]['campaign'] = $campaigns[$campaignId] ?? NULL; | |
6a488035 | 296 | $surveysData[$sid]['activity_type'] = $surveyType[$survey['activity_type_id']]; |
a7488080 | 297 | if (!empty($survey['release_frequency'])) { |
be2fb01f | 298 | $surveysData[$sid]['release_frequency'] = ts('1 Day', ['plural' => '%count Days', 'count' => $survey['release_frequency']]); |
6a488035 TO |
299 | } |
300 | ||
301 | $action = array_sum(array_keys(self::surveyActionLinks($surveysData[$sid]['activity_type']))); | |
302 | if ($survey['is_active']) { | |
303 | $action -= CRM_Core_Action::ENABLE; | |
304 | } | |
305 | else { | |
306 | $action -= CRM_Core_Action::DISABLE; | |
307 | } | |
308 | ||
309 | $isActive = ts('No'); | |
310 | if ($surveysData[$sid]['is_active']) { | |
311 | $isActive = ts('Yes'); | |
312 | } | |
313 | $surveysData[$sid]['isActive'] = $isActive; | |
314 | ||
bc37053c AH |
315 | // For some reason, 'is_default' is coming as a string. |
316 | $surveysData[$sid]['is_default'] = boolval($surveysData[$sid]['is_default']); | |
6a488035 TO |
317 | |
318 | if ($surveysData[$sid]['result_id']) { | |
92fcb95f | 319 | $resultSet = '<a href= "javascript:displayResultSet( ' . $sid . ',' . "'" . $surveysData[$sid]['title'] . "'" . ', ' . $surveysData[$sid]['result_id'] . ' )" title="' . ts('view result set') . '">' . ts('Result Set') . '</a>'; |
6a488035 | 320 | $surveysData[$sid]['result_id'] = $resultSet; |
0db6c3e1 TO |
321 | } |
322 | else { | |
6a488035 TO |
323 | $resultUrl = CRM_Utils_System::url("civicrm/survey/configure/results", "action=update&id={$sid}&reset=1"); |
324 | $surveysData[$sid]['result_id'] = "<a href='{$resultUrl}' class='status-warning'>(" . ts('Incomplete. Click to configure result set.') . ')</a>'; | |
325 | } | |
326 | $surveysData[$sid]['action'] = CRM_Core_Action::formLink(self::surveyActionLinks($surveysData[$sid]['activity_type']), | |
327 | $action, | |
be2fb01f | 328 | ['id' => $sid], |
87dab4a4 AH |
329 | ts('more'), |
330 | FALSE, | |
331 | 'survey.dashboard.row', | |
332 | 'Survey', | |
333 | $sid | |
6a488035 TO |
334 | ); |
335 | ||
336 | if (CRM_Utils_Array::value('activity_type', $surveysData[$sid]) != 'Petition') { | |
337 | $surveysData[$sid]['voterLinks'] = CRM_Campaign_BAO_Survey::buildPermissionLinks($sid, | |
338 | TRUE, | |
339 | ts('more') | |
340 | ); | |
341 | } | |
342 | ||
343 | if ($reportID = CRM_Campaign_BAO_Survey::getReportID($sid)) { | |
94880218 | 344 | $url = CRM_Utils_System::url("civicrm/report/instance/{$reportID}", 'reset=1'); |
6a488035 TO |
345 | $surveysData[$sid]['title'] = "<a href='{$url}' title='View Survey Report'>{$surveysData[$sid]['title']}</a>"; |
346 | } | |
347 | } | |
348 | } | |
349 | ||
350 | return $surveysData; | |
351 | } | |
352 | ||
b896fa44 EM |
353 | /** |
354 | * Browse petitions. | |
355 | * | |
356 | * @return mixed|null | |
357 | */ | |
00be9182 | 358 | public function browsePetition() { |
211e2fca | 359 | // Ensure valid javascript - this must have a value set |
6a488035 TO |
360 | $this->assign('searchParams', json_encode(NULL)); |
361 | $this->assign('petitionCampaigns', json_encode(NULL)); | |
362 | ||
363 | $this->assign('addPetitionUrl', CRM_Utils_System::url('civicrm/petition/add', 'reset=1&action=add')); | |
364 | ||
365 | $petitionCount = CRM_Campaign_BAO_Petition::getPetitionCount(); | |
366 | //don't load find interface when no petition in db. | |
367 | if (!$petitionCount) { | |
368 | $this->assign('hasPetitions', FALSE); | |
211e2fca | 369 | return NULL; |
6a488035 TO |
370 | } |
371 | $this->assign('hasPetitions', TRUE); | |
372 | ||
211e2fca | 373 | // Build the ajax petition search and selector. |
6a488035 TO |
374 | $controller = new CRM_Core_Controller_Simple('CRM_Campaign_Form_Search_Petition', ts('Search Petition')); |
375 | $controller->set('searchTab', 'petition'); | |
376 | $controller->setEmbedded(TRUE); | |
377 | $controller->process(); | |
378 | return $controller->run(); | |
379 | } | |
380 | ||
30c4e065 EM |
381 | /** |
382 | * @param array $params | |
383 | * | |
384 | * @return array | |
385 | */ | |
be2fb01f | 386 | public static function getPetitionSummary($params = []) { |
6a488035 | 387 | $config = CRM_Core_Config::singleton(); |
be2fb01f | 388 | $petitionsData = []; |
6a488035 TO |
389 | |
390 | //get the petitions. | |
391 | $petitions = CRM_Campaign_BAO_Petition::getPetitionSummary($params); | |
392 | if (!empty($petitions)) { | |
393 | $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE); | |
394 | $petitionType = CRM_Campaign_BAO_Survey::getSurveyActivityType('label', TRUE); | |
395 | foreach ($petitions as $pid => $petition) { | |
396 | $petitionsData[$pid] = $petition; | |
9c1bc317 CW |
397 | $camapignId = $petition['campaign_id'] ?? NULL; |
398 | $petitionsData[$pid]['campaign'] = $campaigns[$camapignId] ?? NULL; | |
6a488035 TO |
399 | $petitionsData[$pid]['activity_type'] = $petitionType[$petition['activity_type_id']]; |
400 | ||
401 | $action = array_sum(array_keys(self::petitionActionLinks())); | |
402 | ||
403 | if ($petition['is_active']) { | |
404 | $action -= CRM_Core_Action::ENABLE; | |
405 | } | |
406 | else { | |
407 | $action -= CRM_Core_Action::DISABLE; | |
408 | } | |
409 | ||
410 | $isActive = ts('No'); | |
411 | if ($petitionsData[$pid]['is_active']) { | |
412 | $isActive = ts('Yes'); | |
413 | } | |
414 | $petitionsData[$pid]['isActive'] = $isActive; | |
bc37053c AH |
415 | |
416 | // For some reason, 'is_default' is coming as a string. | |
417 | $petitionsData[$pid]['is_default'] = boolval($petitionsData[$pid]['is_default']); | |
6a488035 TO |
418 | |
419 | $petitionsData[$pid]['action'] = CRM_Core_Action::formLink(self::petitionActionLinks(), | |
420 | $action, | |
be2fb01f | 421 | ['id' => $pid], |
87dab4a4 AH |
422 | ts('more'), |
423 | FALSE, | |
424 | 'petition.dashboard.row', | |
425 | 'Petition', | |
426 | $pid | |
6a488035 TO |
427 | ); |
428 | } | |
429 | } | |
430 | ||
431 | return $petitionsData; | |
432 | } | |
433 | ||
00be9182 | 434 | public function browse() { |
be2fb01f | 435 | $this->_tabs = [ |
349a45b7 | 436 | 'campaign' => ts('Campaigns'), |
6a488035 TO |
437 | 'survey' => ts('Surveys'), |
438 | 'petition' => ts('Petitions'), | |
be2fb01f | 439 | ]; |
6a488035 TO |
440 | |
441 | $subPageType = CRM_Utils_Request::retrieve('type', 'String', $this); | |
442 | if ($subPageType) { | |
349a45b7 CW |
443 | if (!isset($this->_tabs[$subPageType])) { |
444 | CRM_Utils_System::permissionDenied(); | |
445 | } | |
6a488035 TO |
446 | //load the data in tabs. |
447 | $this->{'browse' . ucfirst($subPageType)}(); | |
349a45b7 | 448 | $this->assign('subPageType', ucfirst($subPageType)); |
6a488035 TO |
449 | } |
450 | else { | |
451 | //build the tabs. | |
452 | $this->buildTabs(); | |
453 | } | |
4165b7e5 | 454 | CRM_Core_Resources::singleton() |
96ed17aa | 455 | ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header') |
be2fb01f CW |
456 | ->addSetting([ |
457 | 'tabSettings' => [ | |
353ffa53 | 458 | 'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'campaign')), |
be2fb01f CW |
459 | ], |
460 | ]); | |
6a488035 TO |
461 | } |
462 | ||
30c4e065 EM |
463 | /** |
464 | * @return string | |
465 | */ | |
00be9182 | 466 | public function run() { |
6a488035 TO |
467 | if (!CRM_Campaign_BAO_Campaign::accessCampaign()) { |
468 | CRM_Utils_System::permissionDenied(); | |
469 | } | |
470 | ||
471 | $this->browse(); | |
472 | ||
473 | return parent::run(); | |
474 | } | |
475 | ||
00be9182 | 476 | public function buildTabs() { |
be2fb01f | 477 | $allTabs = []; |
6a488035 | 478 | foreach ($this->_tabs as $name => $title) { |
be2fb01f | 479 | $allTabs[$name] = [ |
6a488035 | 480 | 'title' => $title, |
349a45b7 CW |
481 | 'valid' => TRUE, |
482 | 'active' => TRUE, | |
483 | 'link' => CRM_Utils_System::url('civicrm/campaign', "reset=1&type=$name"), | |
be2fb01f | 484 | ]; |
6a488035 | 485 | } |
a2e0853f | 486 | $allTabs['campaign']['class'] = 'livePage'; |
349a45b7 | 487 | $this->assign('tabHeader', $allTabs); |
6a488035 | 488 | } |
96025800 | 489 | |
6a488035 | 490 | } |