Skip to content

Commit

Permalink
[REF] Remove unused taskName variable
Browse files Browse the repository at this point in the history
This variable is only used at the tpl layer in export - there is a separate PR
to change that usage to something more meaningful
civicrm#18589

Other than that all this task assignment appears to be just cruft

It's likely that it precedes other ways of setting the page title
  • Loading branch information
eileenmcnaughton committed Sep 25, 2020
1 parent 64c8be5 commit c641ac4
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 21 deletions.
2 changes: 0 additions & 2 deletions CRM/Activity/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ public static function preProcessCommon(&$form) {
$values = $form->controller->exportValues($form->get('searchFormName'));

$form->_task = $values['task'];
$activityTasks = CRM_Activity_Task::tasks();
$form->assign('taskName', $activityTasks[$form->_task]);

$ids = [];
if ($values['radio_ts'] == 'ts_sel') {
Expand Down
3 changes: 0 additions & 3 deletions CRM/Campaign/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ public function preProcess() {
$values = $this->controller->exportValues('Search');

$this->_task = $values['task'];
$campaignTasks = CRM_Campaign_Task::tasks();
$taskName = $campaignTasks[$this->_task] ?? NULL;
$this->assign('taskName', $taskName);

$ids = [];
if ($values['radio_ts'] == 'ts_sel') {
Expand Down
2 changes: 0 additions & 2 deletions CRM/Contact/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ public static function preProcessCommon(&$form) {
$cacheKey = "civicrm search {$qfKey}";

$form->_task = self::$_searchFormValues['task'] ?? NULL;
$crmContactTaskTasks = CRM_Contact_Task::taskTitles();
$form->assign('taskName', CRM_Utils_Array::value($form->_task, $crmContactTaskTasks));

// all contacts or action = save a search
if ((CRM_Utils_Array::value('radio_ts', self::$_searchFormValues) == 'ts_all') ||
Expand Down
2 changes: 0 additions & 2 deletions CRM/Contact/Form/Task/SaveSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ public function preProcess() {
// Get Task name
$modeValue = CRM_Contact_Form_Search::getModeValue(CRM_Utils_Array::value('component_mode', $values, CRM_Contact_BAO_Query::MODE_CONTACTS));
$className = $modeValue['taskClassName'];
$taskList = $className::taskTitles();
$this->_task = $values['task'] ?? NULL;
$this->assign('taskName', CRM_Utils_Array::value($this->_task, $taskList));
}

/**
Expand Down
2 changes: 0 additions & 2 deletions CRM/Contribute/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ public static function preProcessCommon(&$form) {
$values = $form->controller->exportValues($form->get('searchFormName'));

$form->_task = $values['task'] ?? NULL;
$contributeTasks = CRM_Contribute_Task::tasks();
$form->assign('taskName', CRM_Utils_Array::value($form->_task, $contributeTasks));

$ids = [];
if (isset($values['radio_ts']) && $values['radio_ts'] == 'ts_sel') {
Expand Down
3 changes: 0 additions & 3 deletions CRM/Core/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ public static function preProcessCommon(&$form) {
$searchFormValues = $form->controller->exportValues($form->get('searchFormName'));

$form->_task = $searchFormValues['task'];
$className = 'CRM_' . ucfirst($form::$entityShortname) . '_Task';
$entityTasks = $className::tasks();
$form->assign('taskName', $entityTasks[$form->_task]);

$entityIds = [];
if ($searchFormValues['radio_ts'] == 'ts_sel') {
Expand Down
1 change: 0 additions & 1 deletion CRM/Event/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public static function preProcessCommon(&$form) {
if (!array_key_exists($form->_task, $tasks)) {
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
$form->assign('taskName', $tasks[$form->_task]);

$ids = [];
if ($values['radio_ts'] == 'ts_sel') {
Expand Down
1 change: 0 additions & 1 deletion CRM/Grant/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public static function preProcessCommon(&$form) {
if (!array_key_exists($form->_task, $tasks)) {
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
$form->assign('taskName', $tasks[$form->_task]);

$ids = [];
if ($values['radio_ts'] == 'ts_sel') {
Expand Down
2 changes: 0 additions & 2 deletions CRM/Mailing/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public static function preProcessCommon(&$form) {
$values = $form->controller->exportValues($form->get('searchFormName'));

$form->_task = $values['task'] ?? NULL;
$mailingTasks = CRM_Mailing_Task::tasks();
$form->assign('taskName', CRM_Utils_Array::value('task', $values));

// ids are mailing event queue ids
$ids = [];
Expand Down
1 change: 0 additions & 1 deletion CRM/Member/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public static function preProcessCommon(&$form) {
if (!array_key_exists($form->_task, $tasks)) {
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
$form->assign('taskName', $tasks[$form->_task]);

$ids = [];
if ($values['radio_ts'] === 'ts_sel') {
Expand Down
2 changes: 0 additions & 2 deletions CRM/Pledge/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public static function preProcessCommon(&$form) {
$values = $form->controller->exportValues('Search');

$form->_task = $values['task'];
$pledgeTasks = CRM_Pledge_Task::tasks();
$form->assign('taskName', $pledgeTasks[$form->_task]);

$ids = [];
if ($values['radio_ts'] == 'ts_sel') {
Expand Down

0 comments on commit c641ac4

Please sign in to comment.