From e341bbeea78a4c1d1847890146685322d15dc207 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 9 Jan 2014 16:11:07 -0800 Subject: [PATCH] CRM-12872 - Remove print button from search results (except campaign) --- CRM/Activity/Form/Search.php | 18 +----------------- CRM/Activity/StateMachine/Search.php | 8 +------- CRM/Activity/Task.php | 5 +---- CRM/Case/Form/Search.php | 18 +----------------- CRM/Case/StateMachine/Search.php | 8 +------- CRM/Case/Task.php | 5 +---- CRM/Contact/Form/Search.php | 13 +------------ CRM/Contact/StateMachine/Search.php | 1 + CRM/Contribute/Form/Search.php | 18 +----------------- CRM/Contribute/StateMachine/Search.php | 8 +------- CRM/Contribute/Task.php | 5 +---- CRM/Event/Form/Search.php | 18 +----------------- CRM/Event/StateMachine/Search.php | 8 +------- CRM/Event/Task.php | 8 ++------ CRM/Grant/Form/Search.php | 18 +----------------- CRM/Grant/StateMachine/Search.php | 8 +------- CRM/Grant/Task.php | 5 +---- CRM/Member/Form/Search.php | 19 +------------------ CRM/Member/StateMachine/Search.php | 8 +------- CRM/Member/Task.php | 5 +---- CRM/Pledge/Form/Search.php | 18 +----------------- CRM/Pledge/StateMachine/Search.php | 8 +------- CRM/Pledge/Task.php | 5 +---- templates/CRM/common/searchResultTasks.tpl | 5 +++-- 24 files changed, 27 insertions(+), 213 deletions(-) diff --git a/CRM/Activity/Form/Search.php b/CRM/Activity/Form/Search.php index fbc77f0ece..fbd256f7b0 100644 --- a/CRM/Activity/Form/Search.php +++ b/CRM/Activity/Form/Search.php @@ -57,14 +57,6 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { */ protected $_searchButtonName; - /** - * name of print button - * - * @var string - * @access protected - */ - protected $_printButtonName; - /** * name of action button * @@ -150,7 +142,6 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { * set the button names */ $this->_searchButtonName = $this->getButtonName('refresh'); - $this->_printButtonName = $this->getButtonName('next', 'print'); $this->_actionButtonName = $this->getButtonName('next', 'action'); $this->_done = FALSE; @@ -269,13 +260,6 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { ) ); - $this->add('submit', $this->_printButtonName, ts('Print'), - array( - 'class' => 'form-submit', - 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 1);", - ) - ); - // need to perform tasks on all or selected items ? using radio_ts(task selection) for it $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked')); $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', @@ -341,7 +325,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { $this->set('queryParams', $this->_queryParams); $buttonName = $this->controller->getButtonName(); - if ($buttonName == $this->_actionButtonName || $buttonName == $this->_printButtonName) { + if ($buttonName == $this->_actionButtonName) { // check actionName and if next, then do not repeat a search, since we are going to the next page // hack, make sure we reset the task values $stateMachine = $this->controller->getStateMachine(); diff --git a/CRM/Activity/StateMachine/Search.php b/CRM/Activity/StateMachine/Search.php index 04366f8d7c..695ad7ca5a 100644 --- a/CRM/Activity/StateMachine/Search.php +++ b/CRM/Activity/StateMachine/Search.php @@ -77,13 +77,7 @@ class CRM_Activity_StateMachine_Search extends CRM_Core_StateMachine { */ function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff - // fix value if print button is pressed - if (!empty($_POST['_qf_' . $formName . '_next_print'])) { - $value = CRM_Activity_Task::PRINT_ACTIVITIES; - } - else { - $value = CRM_Utils_Array::value('task', $_POST); - } + $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { $value = $this->_controller->get('task'); } diff --git a/CRM/Activity/Task.php b/CRM/Activity/Task.php index 503d8bee90..9d33d26552 100644 --- a/CRM/Activity/Task.php +++ b/CRM/Activity/Task.php @@ -151,10 +151,7 @@ class CRM_Activity_Task { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { - // skip Print Activity task - if ($id != 2) { - $titles[$id] = $value['title']; - } + $titles[$id] = $value['title']; } return $titles; } diff --git a/CRM/Case/Form/Search.php b/CRM/Case/Form/Search.php index 9a1b2e7641..6ef0848616 100644 --- a/CRM/Case/Form/Search.php +++ b/CRM/Case/Form/Search.php @@ -54,14 +54,6 @@ class CRM_Case_Form_Search extends CRM_Core_Form { */ protected $_searchButtonName; - /** - * name of print button - * - * @var string - * @access protected - */ - protected $_printButtonName; - /** * name of action button * @@ -154,7 +146,6 @@ class CRM_Case_Form_Search extends CRM_Core_Form { * set the button names */ $this->_searchButtonName = $this->getButtonName('refresh'); - $this->_printButtonName = $this->getButtonName('next', 'print'); $this->_actionButtonName = $this->getButtonName('next', 'action'); $this->_done = FALSE; @@ -292,13 +283,6 @@ class CRM_Case_Form_Search extends CRM_Core_Form { ) ); - $this->add('submit', $this->_printButtonName, ts('Print'), - array( - 'class' => 'form-submit', - 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 1);", - ) - ); - // need to perform tasks on all or selected items ? using radio_ts(task selection) for it $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked')); $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );")); @@ -368,7 +352,7 @@ class CRM_Case_Form_Search extends CRM_Core_Form { $this->set('queryParams', $this->_queryParams); $buttonName = $this->controller->getButtonName(); - if ($buttonName == $this->_actionButtonName || $buttonName == $this->_printButtonName) { + if ($buttonName == $this->_actionButtonName) { // check actionName and if next, then do not repeat a search, since we are going to the next page // hack, make sure we reset the task values diff --git a/CRM/Case/StateMachine/Search.php b/CRM/Case/StateMachine/Search.php index c9883ff9a6..0245a61ff1 100644 --- a/CRM/Case/StateMachine/Search.php +++ b/CRM/Case/StateMachine/Search.php @@ -81,13 +81,7 @@ class CRM_Case_StateMachine_Search extends CRM_Core_StateMachine { */ function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff - // fix value if print button is pressed - if (!empty($_POST['_qf_' . $formName . '_next_print'])) { - $value = CRM_Case_Task::PRINT_CASES; - } - else { - $value = CRM_Utils_Array::value('task', $_POST); - } + $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { $value = $this->_controller->get('task'); } diff --git a/CRM/Case/Task.php b/CRM/Case/Task.php index 916ca52dfd..32f4eec0e1 100644 --- a/CRM/Case/Task.php +++ b/CRM/Case/Task.php @@ -110,10 +110,7 @@ class CRM_Case_Task { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { - // skip Print Cases task - if ($id != 2) { - $titles[$id] = $value['title']; - } + $titles[$id] = $value['title']; } return $titles; } diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index 23981363cc..6c0cf8e12c 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -116,14 +116,6 @@ class CRM_Contact_Form_Search extends CRM_Core_Form { */ protected $_searchButtonName; - /** - * name of print button - * - * @var string - * @access protected - */ - protected $_printButtonName; - /** * name of action button * @@ -602,11 +594,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form { * set the button names */ $this->_searchButtonName = $this->getButtonName('refresh'); - $this->_printButtonName = $this->getButtonName('next', 'print'); $this->_actionButtonName = $this->getButtonName('next', 'action'); - $this->assign('printButtonName', $this->_printButtonName); - $this->assign('actionButtonName', $this->_actionButtonName); // reset from session, CRM-3526 @@ -876,7 +865,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form { $this->set('queryParams', $this->_params); $this->set('returnProperties', $this->_returnProperties); - if ($buttonName == $this->_actionButtonName || $buttonName == $this->_printButtonName) { + if ($buttonName == $this->_actionButtonName) { // check actionName and if next, then do not repeat a search, since we are going to the next page // hack, make sure we reset the task values $stateMachine = $this->controller->getStateMachine(); diff --git a/CRM/Contact/StateMachine/Search.php b/CRM/Contact/StateMachine/Search.php index 6535e98e0a..d4075b8722 100644 --- a/CRM/Contact/StateMachine/Search.php +++ b/CRM/Contact/StateMachine/Search.php @@ -92,6 +92,7 @@ class CRM_Contact_StateMachine_Search extends CRM_Core_StateMachine { * @access protected */ function taskName($controller, $formName = 'Search') { + // total hack, check POST vars and then session to determine stuff $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { $value = $this->_controller->get('task'); diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php index 64a36d293b..981d57af43 100644 --- a/CRM/Contribute/Form/Search.php +++ b/CRM/Contribute/Form/Search.php @@ -58,14 +58,6 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { */ protected $_searchButtonName; - /** - * name of print button - * - * @var string - * @access protected - */ - protected $_printButtonName; - /** * name of action button * @@ -142,7 +134,6 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { * set the button names */ $this->_searchButtonName = $this->getButtonName('refresh'); - $this->_printButtonName = $this->getButtonName('next', 'print'); $this->_actionButtonName = $this->getButtonName('next', 'action'); $this->_done = FALSE; @@ -304,13 +295,6 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { ) ); - $this->add('submit', $this->_printButtonName, ts('Print'), - array( - 'class' => 'form-submit', - 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 1);", - ) - ); - // need to perform tasks on all or selected items ? using radio_ts(task selection) for it $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked')); $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );")); @@ -417,7 +401,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form { $this->set('queryParams', $this->_queryParams); $buttonName = $this->controller->getButtonName(); - if ($buttonName == $this->_actionButtonName || $buttonName == $this->_printButtonName) { + if ($buttonName == $this->_actionButtonName) { // check actionName and if next, then do not repeat a search, since we are going to the next page // hack, make sure we reset the task values diff --git a/CRM/Contribute/StateMachine/Search.php b/CRM/Contribute/StateMachine/Search.php index 7801d0bfa5..520d611717 100644 --- a/CRM/Contribute/StateMachine/Search.php +++ b/CRM/Contribute/StateMachine/Search.php @@ -79,13 +79,7 @@ class CRM_Contribute_StateMachine_Search extends CRM_Core_StateMachine { */ function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff - // fix value if print button is pressed - if (!empty($_POST['_qf_' . $formName . '_next_print'])) { - $value = CRM_Contribute_Task::PRINT_CONTRIBUTIONS; - } - else { - $value = CRM_Utils_Array::value('task', $_POST); - } + $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { $value = $this->_controller->get('task'); } diff --git a/CRM/Contribute/Task.php b/CRM/Contribute/Task.php index 06feed0f20..729e077470 100644 --- a/CRM/Contribute/Task.php +++ b/CRM/Contribute/Task.php @@ -132,10 +132,7 @@ class CRM_Contribute_Task { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { - // skip Print Contribution task - if ($id != 2) { - $titles[$id] = $value['title']; - } + $titles[$id] = $value['title']; } return $titles; } diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php index b1c213f9b6..aa72ef59c4 100644 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/Form/Search.php @@ -58,14 +58,6 @@ class CRM_Event_Form_Search extends CRM_Core_Form { */ protected $_searchButtonName; - /** - * name of print button - * - * @var string - * @access protected - */ - protected $_printButtonName; - /** * name of action button * @@ -151,7 +143,6 @@ class CRM_Event_Form_Search extends CRM_Core_Form { * set the button names */ $this->_searchButtonName = $this->getButtonName('refresh'); - $this->_printButtonName = $this->getButtonName('next', 'print'); $this->_actionButtonName = $this->getButtonName('next', 'action'); $this->_done = FALSE; @@ -321,13 +312,6 @@ class CRM_Event_Form_Search extends CRM_Core_Form { ) ); - $this->add('submit', $this->_printButtonName, ts('Print'), - array( - 'class' => 'form-submit', - 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 1);", - ) - ); - // need to perform tasks on all or selected items ? using radio_ts(task selection) for it $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked') @@ -399,7 +383,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form { $this->set('queryParams', $this->_queryParams); $buttonName = $this->controller->getButtonName(); - if ($buttonName == $this->_actionButtonName || $buttonName == $this->_printButtonName) { + if ($buttonName == $this->_actionButtonName) { // check actionName and if next, then do not repeat a search, since we are going to the next page // hack, make sure we reset the task values diff --git a/CRM/Event/StateMachine/Search.php b/CRM/Event/StateMachine/Search.php index 66f2fb3efa..44d1186557 100644 --- a/CRM/Event/StateMachine/Search.php +++ b/CRM/Event/StateMachine/Search.php @@ -82,13 +82,7 @@ class CRM_Event_StateMachine_Search extends CRM_Core_StateMachine { */ function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff - // fix value if print button is pressed - if (!empty($_POST['_qf_' . $formName . '_next_print'])) { - $value = CRM_Event_Task::PRINT_EVENTS; - } - else { - $value = CRM_Utils_Array::value('task', $_POST); - } + $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { $value = $this->_controller->get('task'); } diff --git a/CRM/Event/Task.php b/CRM/Event/Task.php index 5ec703b638..ff89176a4b 100644 --- a/CRM/Event/Task.php +++ b/CRM/Event/Task.php @@ -142,14 +142,10 @@ class CRM_Event_Task { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { - // skip Print Participants and Update Smart Group task - if (!in_array($id, array( - 2, 14))) { + // skip Update Smart Group task + if ($id != self::SAVE_SEARCH_UPDATE) { $titles[$id] = $value['title']; } - else { - continue; - } } return $titles; } diff --git a/CRM/Grant/Form/Search.php b/CRM/Grant/Form/Search.php index 6e207fea2b..ae60d6ea9a 100644 --- a/CRM/Grant/Form/Search.php +++ b/CRM/Grant/Form/Search.php @@ -58,14 +58,6 @@ class CRM_Grant_Form_Search extends CRM_Core_Form { */ protected $_searchButtonName; - /** - * name of print button - * - * @var string - * @access protected - */ - protected $_printButtonName; - /** * name of action button * @@ -142,7 +134,6 @@ class CRM_Grant_Form_Search extends CRM_Core_Form { */ $this->_searchButtonName = $this->getButtonName('refresh'); - $this->_printButtonName = $this->getButtonName('next', 'print'); $this->_actionButtonName = $this->getButtonName('next', 'action'); $this->_done = FALSE; @@ -267,13 +258,6 @@ class CRM_Grant_Form_Search extends CRM_Core_Form { ) ); - $this->add('submit', $this->_printButtonName, ts('Print'), - array( - 'class' => 'form-submit', - 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 1);", - ) - ); - // need to perform tasks on all or selected items ? using radio_ts(task selection) for it $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked')); $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onchange' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );")); @@ -327,7 +311,7 @@ class CRM_Grant_Form_Search extends CRM_Core_Form { $this->set('queryParams', $this->_queryParams); $buttonName = $this->controller->getButtonName(); - if ($buttonName == $this->_actionButtonName || $buttonName == $this->_printButtonName) { + if ($buttonName == $this->_actionButtonName) { // check actionName and if next, then do not repeat a search, since we are going to the next page // hack, make sure we reset the task values diff --git a/CRM/Grant/StateMachine/Search.php b/CRM/Grant/StateMachine/Search.php index a2df38f200..df5aaee5a8 100644 --- a/CRM/Grant/StateMachine/Search.php +++ b/CRM/Grant/StateMachine/Search.php @@ -81,13 +81,7 @@ class CRM_Grant_StateMachine_Search extends CRM_Core_StateMachine { */ function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff - // fix value if print button is pressed - if (!empty($_POST['_qf_' . $formName . '_next_print'])) { - $value = CRM_Grant_Task::PRINT_GRANTS; - } - else { - $value = CRM_Utils_Array::value('task', $_POST); - } + $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { $value = $this->_controller->get('task'); } diff --git a/CRM/Grant/Task.php b/CRM/Grant/Task.php index 01164d2d99..1fb7b17b81 100644 --- a/CRM/Grant/Task.php +++ b/CRM/Grant/Task.php @@ -107,10 +107,7 @@ class CRM_Grant_Task { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { - // skip Print Grant task - if ($id != 2) { - $titles[$id] = $value['title']; - } + $titles[$id] = $value['title']; } return $titles; } diff --git a/CRM/Member/Form/Search.php b/CRM/Member/Form/Search.php index e0bfebc3f5..4dd4f5c728 100644 --- a/CRM/Member/Form/Search.php +++ b/CRM/Member/Form/Search.php @@ -58,14 +58,6 @@ class CRM_Member_Form_Search extends CRM_Core_Form { */ protected $_searchButtonName; - /** - * name of print button - * - * @var string - * @access protected - */ - protected $_printButtonName; - /** * name of action button * @@ -143,7 +135,6 @@ class CRM_Member_Form_Search extends CRM_Core_Form { * set the button names */ $this->_searchButtonName = $this->getButtonName('refresh'); - $this->_printButtonName = $this->getButtonName('next', 'print'); $this->_actionButtonName = $this->getButtonName('next', 'action'); $this->_done = FALSE; @@ -258,14 +249,6 @@ class CRM_Member_Form_Search extends CRM_Core_Form { ) ); - $this->add('submit', $this->_printButtonName, ts('Print'), - array( - 'class' => 'form-submit', - 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 1);", - ) - ); - - // need to perform tasks on all or selected items ? using radio_ts(task selection) for it $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked')); $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );")); @@ -323,7 +306,7 @@ class CRM_Member_Form_Search extends CRM_Core_Form { $this->set('queryParams', $this->_queryParams); $buttonName = $this->controller->getButtonName(); - if ($buttonName == $this->_actionButtonName || $buttonName == $this->_printButtonName) { + if ($buttonName == $this->_actionButtonName) { // check actionName and if next, then do not repeat a search, since we are going to the next page // hack, make sure we reset the task values diff --git a/CRM/Member/StateMachine/Search.php b/CRM/Member/StateMachine/Search.php index 6d7a132d7a..939b2bdd79 100644 --- a/CRM/Member/StateMachine/Search.php +++ b/CRM/Member/StateMachine/Search.php @@ -79,13 +79,7 @@ class CRM_Member_StateMachine_Search extends CRM_Core_StateMachine { */ function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff - // fix value if print button is pressed - if (!empty($_POST['_qf_' . $formName . '_next_print'])) { - $value = CRM_Member_Task::PRINT_MEMBERS; - } - else { - $value = CRM_Utils_Array::value('task', $_POST); - } + $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { $value = $this->_controller->get('task'); } diff --git a/CRM/Member/Task.php b/CRM/Member/Task.php index d41c0487e2..6af9cf2466 100644 --- a/CRM/Member/Task.php +++ b/CRM/Member/Task.php @@ -129,10 +129,7 @@ class CRM_Member_Task { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { - // skip Print Membership task - if ($id != 2) { - $titles[$id] = $value['title']; - } + $titles[$id] = $value['title']; } return $titles; } diff --git a/CRM/Pledge/Form/Search.php b/CRM/Pledge/Form/Search.php index d81bf2f98c..db82486008 100644 --- a/CRM/Pledge/Form/Search.php +++ b/CRM/Pledge/Form/Search.php @@ -54,14 +54,6 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form { */ protected $_searchButtonName; - /** - * name of print button - * - * @var string - * @access protected - */ - protected $_printButtonName; - /** * name of action button * @@ -138,7 +130,6 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form { * set the button names */ $this->_searchButtonName = $this->getButtonName('refresh'); - $this->_printButtonName = $this->getButtonName('next', 'print'); $this->_actionButtonName = $this->getButtonName('next', 'action'); $this->_done = FALSE; @@ -258,13 +249,6 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form { ) ); - $this->add('submit', $this->_printButtonName, ts('Print'), - array( - 'class' => 'form-submit', - 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 1);", - ) - ); - // need to perform tasks on all or selected items ? using radio_ts(task selection) for it $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked')); $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );")); @@ -332,7 +316,7 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form { $this->set('queryParams', $this->_queryParams); $buttonName = $this->controller->getButtonName(); - if ($buttonName == $this->_actionButtonName || $buttonName == $this->_printButtonName) { + if ($buttonName == $this->_actionButtonName) { // check actionName and if next, then do not repeat a search, since we are going to the next page // hack, make sure we reset the task values diff --git a/CRM/Pledge/StateMachine/Search.php b/CRM/Pledge/StateMachine/Search.php index 1d4fc16ba4..c8c32ddb49 100644 --- a/CRM/Pledge/StateMachine/Search.php +++ b/CRM/Pledge/StateMachine/Search.php @@ -81,13 +81,7 @@ class CRM_Pledge_StateMachine_Search extends CRM_Core_StateMachine { */ function taskName($controller, $formName = 'Search') { // total hack, check POST vars and then session to determine stuff - // fix value if print button is pressed - if (!empty($_POST['_qf_' . $formName . '_next_print'])) { - $value = CRM_Pledge_Task::PRINT_PLEDGES; - } - else { - $value = CRM_Utils_Array::value('task', $_POST); - } + $value = CRM_Utils_Array::value('task', $_POST); if (!isset($value)) { $value = $this->_controller->get('task'); } diff --git a/CRM/Pledge/Task.php b/CRM/Pledge/Task.php index 411983f659..6a829bc441 100644 --- a/CRM/Pledge/Task.php +++ b/CRM/Pledge/Task.php @@ -105,10 +105,7 @@ class CRM_Pledge_Task { self::tasks(); $titles = array(); foreach (self::$_tasks as $id => $value) { - // skip Print Pledges task - if ($id != 2) { - $titles[$id] = $value['title']; - } + $titles[$id] = $value['title']; } return $titles; } diff --git a/templates/CRM/common/searchResultTasks.tpl b/templates/CRM/common/searchResultTasks.tpl index 5c22ff479f..f217c9c571 100644 --- a/templates/CRM/common/searchResultTasks.tpl +++ b/templates/CRM/common/searchResultTasks.tpl @@ -57,9 +57,10 @@ - {if $printButtonName} + {* Note print buttons were mostly removed except for Campaign search - the following lines can be removed soon CRM-12872 *} + {if !empty($printButtonName)} {$form.$printButtonName.html}     - {else} + {elseif !empty($form._qf_Search_next_print)} {$form._qf_Search_next_print.html}     {/if} -- 2.25.1