3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * Class CRM_Event_StateMachine_Search
15 class CRM_Event_StateMachine_Search
extends CRM_Core_StateMachine
{
18 * The task that the wizard is currently processing.
27 * @param CRM_Core_Controller $controller
30 public function __construct($controller, $action = CRM_Core_Action
::NONE
) {
31 parent
::__construct($controller, $action);
35 $this->_pages
['CRM_Event_Form_Search'] = NULL;
36 list($task, $result) = $this->taskName($controller, 'Search');
39 if (is_array($task)) {
40 foreach ($task as $t) {
41 $this->_pages
[$t] = NULL;
45 $this->_pages
[$task] = NULL;
49 $this->_pages
['CRM_Event_Form_Task_Result'] = NULL;
52 $this->addSequentialPages($this->_pages
, $action);
56 * Determine the form name based on the action. This allows us
57 * to avoid using conditional state machine, much more efficient
60 * @param CRM_Core_Controller $controller
61 * The controller object.
63 * @param string $formName
66 * the name of the form that will handle the task
68 public function taskName($controller, $formName = 'Search') {
69 // total hack, check POST vars and then session to determine stuff
70 $value = $_POST['task'] ??
NULL;
72 $value = $this->_controller
->get('task');
74 $this->_controller
->set('task', $value);
75 return CRM_Event_Task
::getTask($value);
79 * Return the form name of the task.
83 public function getTaskFormName() {
84 return CRM_Utils_String
::getClassName($this->_task
);
88 * Since this is a state machine for search and we want to come back to the same state
89 * we dont want to issue a reset of the state session when we are done processing a task
91 public function shouldReset() {