}
self::setModeValues();
- if (!array_key_exists($mode, self::$_modeValues)) {
+ // Note $mode might === FALSE because array_search above failed, e.g. for searchPane='location'
+ if (empty(self::$_modeValues[$mode])) {
$mode = CRM_Contact_BAO_Query::MODE_CONTACTS;
}
* driven by the wizard framework
*/
+ $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean');
+
+ $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean');
$this->_groupID = CRM_Utils_Request::retrieve('gid', 'Positive', $this);
$this->_amtgID = CRM_Utils_Request::retrieve('amtgID', 'Positive', $this);
+ $this->_ssID = CRM_Utils_Request::retrieve('ssID', 'Positive', $this);
$this->_sortByCharacter = CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this);
$this->_ufGroupID = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$this->_componentMode = CRM_Utils_Request::retrieve('component_mode', 'Positive', $this, FALSE, CRM_Contact_BAO_Query::MODE_CONTACTS, $_REQUEST);
$this->_operator = CRM_Utils_Request::retrieve('operator', 'String', $this, FALSE, CRM_Contact_BAO_Query::SEARCH_OPERATOR_AND, 'REQUEST');
- $this->loadStandardSearchOptionsFromUrl();
/**
* set the button names
*/
}
// assign context to drive the template display, make sure context is valid
+ $this->_context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this, FALSE, 'search');
if (!CRM_Utils_Array::value($this->_context, self::validContext())) {
$this->_context = 'search';
}
'mailing_unsubscribe',
'mailing_date_low',
'mailing_date_high',
+ 'mailing_job_start_date_low',
+ 'mailing_job_start_date_high',
+ 'mailing_job_start_date_relative',
] as $mailingFilter) {
$type = 'String';
if ($mailingFilter == 'mailing_id' &&
$controller->setDynamicAction($setDynamic);
if ($this->_force) {
-
+ $this->loadMetadata();
$this->postProcess();
/*
$controller->moveFromSessionToTemplate();
}
- /**
- * @return array
- */
- public function &getFormValues() {
- return $this->_formValues;
- }
-
/**
* Common post processing.
*/
return ts('Search');
}
+ /**
+ * Load metadata for fields on the form.
+ *
+ * @throws \CiviCRM_API3_Exception
+ */
+ protected function loadMetadata() {
+ // @todo - check what happens if the person does not have 'access civicontribute' - make sure they
+ // can't by pass acls by passing search criteria in the url.
+ $this->addSearchFieldMetadata(['Contribution' => CRM_Contribute_BAO_Query::getSearchFieldMetadata()]);
+ $this->addSearchFieldMetadata(['ContributionRecur' => CRM_Contribute_BAO_ContributionRecur::getContributionRecurSearchFieldMetadata()]);
+ }
+
}