<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
* The params that are sent to the query
*
* @var array
- * @access protected
*/
protected $_queryParams;
/**
* Are we restricting ourselves to a single contact
*
- * @access protected
* @var boolean
*/
protected $_single = FALSE;
/**
* Are we restricting ourselves to a single contact
*
- * @access protected
* @var boolean
*/
protected $_limit = NULL;
/**
* Prefix for the controller
- *
*/
protected $_prefix = "contribute_";
* Processing needed for buildForm and later
*
* @return void
- * @access public
- */ 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,
$this->assign('contributionSummary', $this->get('summary'));
}
- function setDefaultValues() {
- if (empty($this->_defaults
-['contribution_status'])) {
+ public function setDefaultValues() {
+ if (empty($this->_defaults['contribution_status'])) {
$this->_defaults['contribution_status'][1] = 1;
}
return $this->_defaults;
/**
* Build the form object
*
- * @access public
*
* @return void
*/
- function buildQuickForm() {
+ public function buildQuickForm() {
parent::buildQuickForm();
// text for sort_name
$this->addElement('text',
* @param
*
* @return void
- * @access public
*/
- function postProcess() {
+ public function postProcess() {
if ($this->_done) {
return;
}
}
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),
$controller->run();
}
- function fixFormValues() {
+ public function fixFormValues() {
// if this search has been forced
// then see if there are any get values, and if so over-ride the post values
// note that this means that GET over-rides POST :)
* Return a descriptive name for the page, used in wizard header
*
* @return string
- * @access public
*/
public function getTitle() {
return ts('Find Contributions');
}
}
-