<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2020 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
+ | Copyright CiviCRM LLC. All rights reserved. |
| |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2020
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
*/
/**
* Processing needed for buildForm and later.
*
* @return void
+ *
+ * @throws \CRM_Core_Exception
+ * @throws \CiviCRM_API3_Exception
*/
public function preProcess() {
$this->set('searchFormName', 'Search');
$this->_done = FALSE;
- $this->loadStandardSearchOptionsFromUrl();
- $this->loadFormValues();
-
- if ($this->_force) {
- $this->postProcess();
- $this->set('force', 0);
- }
+ parent::preProcess();
$this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues, 0, FALSE, NULL, ['event_id']);
$selector = new CRM_Event_Selector_Search($this->_queryParams,
* @param
*
* @return void
+ * @throws \CRM_Core_Exception
*/
public function postProcess() {
if ($this->_done) {
}
$this->_done = TRUE;
- $formValues = [];
-
- if (!empty($_POST)) {
- $formValues = $this->controller->exportValues($this->_name);
- CRM_Contact_BAO_Query::processSpecialFormValue($this->_formValues, ['participant_status_id']);
- }
-
- if (empty($formValues)) {
- $formValues = $this->controller->exportValues($this->_name);
- }
+ $formValues = $this->getFormValues();
$this->submit($formValues);
}
}
}
- /**
- * @return null
- */
- public function getFormValues() {
- return NULL;
- }
-
/**
* Return a descriptive name for the page, used in wizard header
*
return ts('Find Participants');
}
+ /**
+ * Set the metadata for the form.
+ *
+ * @throws \CiviCRM_API3_Exception
+ */
+ protected function setSearchMetadata() {
+ $this->addSearchFieldMetadata(['Participant' => CRM_Event_BAO_Query::getSearchFieldMetadata()]);
+ }
+
+ /**
+ * Set the default form values.
+ *
+ *
+ * @return array
+ * the default array reference
+ */
+ public function setDefaultValues() {
+ parent::setDefaultValues();
+ return $this->_formValues;
+ }
+
}