CRM-12872 - Get campaign search to conform
authorColeman Watts <coleman@civicrm.org>
Fri, 10 Jan 2014 01:03:50 +0000 (17:03 -0800)
committerColeman Watts <coleman@civicrm.org>
Fri, 24 Jan 2014 06:24:07 +0000 (22:24 -0800)
CRM/Campaign/Form/Search.php
CRM/Campaign/StateMachine/Search.php

index 35efeb9d4d33286803cdcf76a8fd0542bb183285..eeb223a39c2777a026a9a43c2c153f42d5fd7b21 100755 (executable)
@@ -54,14 +54,6 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form {
    */
   protected $_searchButtonName;
 
-  /**
-   * name of print button
-   *
-   * @var string
-   * @access protected
-   */
-  protected $_printButtonName;
-
   /**
    * name of action button
    *
@@ -306,8 +298,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form {
           ));
       }
 
-      $this->add('select', 'task', ts('Actions:') . ' ', $taskValue);
-      $this->setDefaults(array('task' => $currentTaskValue));
+      $this->add('select', 'task', ts('Actions:') . ' ', array('' => ts('- actions -')) + $taskValue);
 
       $this->add('submit', $this->_actionButtonName, ts('Go'),
         array(
@@ -316,13 +307,6 @@ class CRM_Campaign_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 );"));
@@ -378,7 +362,7 @@ class CRM_Campaign_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
index 715cc765ce83ee1844493ab6f5c734c484b15026..f60984c9c15f78693f5e7ff7069327cf5853aa51 100755 (executable)
@@ -79,13 +79,7 @@ class CRM_Campaign_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_Campaign_Task::PRINT_VOTERS;
-    }
-    else {
-      $value = CRM_Utils_Array::value('task', $_POST);
-    }
+    $value = CRM_Utils_Array::value('task', $_POST);
     if (!isset($value)) {
       $value = $this->_controller->get('task');
     }