Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-06-25-23-42-42
[civicrm-core.git] / CRM / Activity / StateMachine / Search.php
index 690fc46ac124d131dc352649065cd96da7b3d019..ad14391ecdb9a711316851283d19fa8360c15d0d 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -27,7 +27,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -72,18 +72,14 @@ class CRM_Activity_StateMachine_Search extends CRM_Core_StateMachine {
    *
    * @param CRM_Core_Controller $controller the controller object
    *
+   * @param string $formName
+   *
    * @return string the name of the form that will handle the task
    * @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_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');
     }
@@ -101,6 +97,18 @@ class CRM_Activity_StateMachine_Search extends CRM_Core_StateMachine {
     return CRM_Utils_String::getClassName($this->_task);
   }
 
+  /**
+   * Should the controller reset the session
+   * In some cases, specifically search we want to remember
+   * state across various actions and want to go back to the
+   * beginning from the final state, but retain the same session
+   * values
+   *
+   * @return boolean
+   */
+  /**
+   * @return bool
+   */
   function shouldReset() {
     return FALSE;
   }