+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
+ | Copyright CiviCRM LLC (c) 2004-2020 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC (c) 2004-2020
*/
/**
$this->loadStandardSearchOptionsFromUrl();
- // get user submitted values
- // get it from controller only if form has been submitted, else preProcess has set this
- if (!empty($_POST)) {
- $this->_formValues = $this->controller->exportValues($this->_name);
- }
- else {
- $this->_formValues = $this->get('formValues');
- }
+ $this->_formValues = $this->getFormValues();
//membership ID
$memberShipId = CRM_Utils_Request::retrieve('memberId', 'Positive', $this);
}
if ($this->_force) {
- // Search field metadata is normally added in buildForm but we are bypassing that in this flow
- // (I've always found the flow kinda confusing & perhaps that is the problem but this mitigates)
- $this->addSearchFieldMetadata(['Contribution' => CRM_Contribute_BAO_Query::getSearchFieldMetadata()]);
- $this->addSearchFieldMetadata(['ContributionRecur' => CRM_Contribute_BAO_ContributionRecur::getContributionRecurSearchFieldMetadata()]);
- $this->postProcess();
- $this->set('force', 0);
+ $this->handleForcedSearch();
}
$sortID = NULL;
return ts('Find Contributions');
}
+ /**
+ * Set the metadata for the form.
+ *
+ * @throws \CiviCRM_API3_Exception
+ */
+ protected function setSearchMetadata() {
+ $this->addSearchFieldMetadata(['Contribution' => CRM_Contribute_BAO_Query::getSearchFieldMetadata()]);
+ $this->addSearchFieldMetadata(['ContributionRecur' => CRM_Contribute_BAO_ContributionRecur::getContributionRecurSearchFieldMetadata()]);
+ }
+
}