/**
* Prefix for the controller
- *
*/
protected $_prefix = "contribute_";
* Processing needed for buildForm and later
*
* @return void
- */ function preProcess() {
+ */
+ public function preProcess() {
$this->set('searchFormName', 'Search');
/**
* driven by the wizard framework
*/
- $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
- $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
- $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
+ $this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
+ $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
+ $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this);
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search');
$this->assign("context", $this->_context);
);
}
- $this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
+ $this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues, 1);
$selector = new CRM_Contribute_Selector_Search($this->_queryParams,
$this->_action,
NULL,
}
public function setDefaultValues() {
- if (empty($this->_defaults
-['contribution_status'])) {
+ if (empty($this->_defaults['contribution_status'])) {
$this->_defaults['contribution_status'][1] = 1;
}
return $this->_defaults;
}
foreach (array(
- 'contribution_amount_low', 'contribution_amount_high') as $f) {
+ 'contribution_amount_low',
+ 'contribution_amount_high',
+ ) as $f) {
if (isset($this->_formValues[$f])) {
$this->_formValues[$f] = CRM_Utils_Rule::cleanMoney($this->_formValues[$f]);
}
$config = CRM_Core_Config::singleton();
if (!empty($_POST)) {
- // CRM-13848
- $financialType = CRM_Utils_Array::value('financial_type_id', $this->_formValues);
- if ($financialType && is_array($financialType)) {
- unset($this->_formValues['financial_type_id']);
- foreach($financialType as $notImportant => $typeID) {
- $this->_formValues['financial_type_id'][$typeID] = 1;
+ $specialParams = array(
+ 'financial_type_id',
+ 'contribution_soft_credit_type_id',
+ 'contribution_status_id',
+ 'contribution_source',
+ 'contribution_trxn_id',
+ );
+ foreach ($specialParams as $element) {
+ $value = CRM_Utils_Array::value($element, $this->_formValues);
+ if ($value) {
+ if (is_array($value)) {
+ $this->_formValues[$element] = array('IN' => $value);
+ }
+ else {
+ $this->_formValues[$element] = array('LIKE' => "%$value%");
+ }
}
}
if ($tags && is_array($tags)) {
unset($this->_formValues['contact_tags']);
- foreach($tags as $notImportant => $tagID) {
+ foreach ($tags as $notImportant => $tagID) {
$this->_formValues['contact_tags'][$tagID] = 1;
}
}
-
if (!$config->groupTree) {
$group = CRM_Utils_Array::value('group', $this->_formValues);
if ($group && !is_array($group)) {
if ($group && is_array($group)) {
unset($this->_formValues['group']);
- foreach($group as $notImportant => $groupID) {
+ foreach ($group as $notImportant => $groupID) {
$this->_formValues['group'][$groupID] = 1;
}
}
return;
}
-
$sortID = NULL;
if ($this->get(CRM_Utils_Sort::SORT_ID)) {
$sortID = CRM_Utils_Sort::sortIDValue($this->get(CRM_Utils_Sort::SORT_ID),