From 62c10c94257a2c55cb3a844b8a0f1e52903e8789 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 8 Jan 2014 19:21:58 -0800 Subject: [PATCH] CRM-12872 - Remove print button from contact search results --- CRM/Contact/Form/Search.php | 8 -------- CRM/Contact/Form/Search/Advanced.php | 3 --- CRM/Contact/Form/Search/Basic.php | 3 --- CRM/Contact/StateMachine/Search.php | 9 +-------- CRM/Contact/Task.php | 3 +-- templates/CRM/Contact/Form/Search/ResultTasks.tpl | 14 +------------- 6 files changed, 3 insertions(+), 37 deletions(-) diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index c0f2839b31..0e3a69abcb 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -562,14 +562,6 @@ class CRM_Contact_Form_Search extends CRM_Core_Form { ) ); - $this->add('submit', $this->_printButtonName, ts('Print'), - array( - 'class' => 'form-submit', - 'id' => 'Print', - 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 1, 1);", - ) - ); - $this->setDefaultAction('refresh'); } diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index 0b6cc47d61..a952ae4cae 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -207,9 +207,6 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { if ($this->_context === 'amtg') { $defaults['task'] = CRM_Contact_Task::GROUP_CONTACTS; } - else { - $defaults['task'] = CRM_Contact_Task::PRINT_CONTACTS; - } $defaults['privacy_toggle'] = 1; diff --git a/CRM/Contact/Form/Search/Basic.php b/CRM/Contact/Form/Search/Basic.php index 7f8126d016..46f55c10a4 100644 --- a/CRM/Contact/Form/Search/Basic.php +++ b/CRM/Contact/Form/Search/Basic.php @@ -122,9 +122,6 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { if ($this->_context === 'amtg') { $defaults['task'] = CRM_Contact_Task::GROUP_CONTACTS; } - else { - $defaults['task'] = CRM_Contact_Task::PRINT_CONTACTS; - } if ($this->_context === 'smog') { $defaults['group_contact_status[Added]'] = TRUE; diff --git a/CRM/Contact/StateMachine/Search.php b/CRM/Contact/StateMachine/Search.php index 01ceeb8fdc..6535e98e0a 100644 --- a/CRM/Contact/StateMachine/Search.php +++ b/CRM/Contact/StateMachine/Search.php @@ -92,14 +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 - // fix value if print button is pressed - if (CRM_Utils_Array::value('_qf_' . $formName . '_next_print', $_POST)) { - $value = CRM_Contact_Task::PRINT_CONTACTS; - } - 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/Contact/Task.php b/CRM/Contact/Task.php index 7b4f576cd1..a99253ad25 100644 --- a/CRM/Contact/Task.php +++ b/CRM/Contact/Task.php @@ -291,9 +291,8 @@ class CRM_Contact_Task { $titles[$id] = $value['title']; } - // hack unset update saved search and print contacts + // hack unset update saved search unset($titles[self::SAVE_SEARCH_UPDATE]); - unset($titles[self::PRINT_CONTACTS]); if (!CRM_Utils_Mail::validOutBoundMail()) { unset($titles[self::EMAIL_CONTACTS]); diff --git a/templates/CRM/Contact/Form/Search/ResultTasks.tpl b/templates/CRM/Contact/Form/Search/ResultTasks.tpl index 9b280dafe4..61cec069e9 100644 --- a/templates/CRM/Contact/Form/Search/ResultTasks.tpl +++ b/templates/CRM/Contact/Form/Search/ResultTasks.tpl @@ -74,20 +74,8 @@ - {* Hide export and print buttons in 'Add Members to Group' context. *} + {* Hide export button in 'Add Members to Group' context. *} {if $context NEQ 'amtg'} - {if $action eq 512} -