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 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * class to represent the actions that can be performed on a group of voters.
21 * Used by the search forms.
23 class CRM_Campaign_Task
extends CRM_Core_Task
{
36 public static $objectType = 'campaign';
39 * These tasks are the core set of tasks that the user can perform
40 * on a voter / group of voters
43 * the set of tasks for a group of voters.
45 public static function tasks() {
46 if (!(self
::$_tasks)) {
49 'title' => ts('Record Respondents Interview'),
51 'CRM_Campaign_Form_Task_Interview',
52 'CRM_Campaign_Form_Task_Release',
57 'title' => ts('Reserve Respondents'),
59 'CRM_Campaign_Form_Task_Reserve',
60 'CRM_Campaign_Form_Task_Interview',
61 'CRM_Campaign_Form_Task_Release',
66 'title' => ts('Release Respondents'),
67 'class' => 'CRM_Campaign_Form_Task_Release',
71 'title' => ts('Print Respondents'),
72 'class' => 'CRM_Campaign_Form_Task_Print',
84 * Show tasks selectively based on the permission level
87 * @param int $permission
88 * @param array $params
91 * set of tasks that are valid for the user
93 public static function permissionedTaskTitles($permission, $params = []) {
94 $tasks = self
::taskTitles();
96 $tasks = parent
::corePermissionedTaskTitles($tasks, $permission, $params);
101 * These tasks are the core set of tasks that the user can perform
107 * the set of tasks for a group of voters.
109 public static function getTask($value) {
111 if (!$value ||
empty(self
::$_tasks[$value])) {
112 // Set the interview task as default
113 $value = self
::INTERVIEW
;
117 self
::$_tasks[$value]['class'],
118 self
::$_tasks[$value]['result'],