+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
class CRM_Member_Form_Search extends CRM_Core_Form_Search {
/**
- * The params that are sent to the query
+ * The params that are sent to the query.
*
* @var array
*/
protected $_queryParams;
/**
- * Are we restricting ourselves to a single contact
+ * Are we restricting ourselves to a single contact.
*
* @var boolean
*/
protected $_single = FALSE;
/**
- * Are we restricting ourselves to a single contact
+ * Are we restricting ourselves to a single contact.
*
* @var boolean
*/
protected $_limit = NULL;
- protected $_defaults;
-
/**
- * Prefix for the controller
+ * Prefix for the controller.
*/
protected $_prefix = "member_";
/**
- * Processing needed for buildForm and later
+ * Processing needed for buildForm and later.
*
* @return void
*/
}
/**
- * Build the form object
+ * Build the form object.
*
*
* @return void
$this->_formValues["member_test"] = 0;
}
- CRM_Core_BAO_CustomValue::fixFieldValueOfTypeMemo($this->_formValues);
+ $specialParams = array(
+ 'membership_status_id',
+ 'membership_type_id',
+ );
+ foreach ($specialParams as $element) {
+ $value = CRM_Utils_Array::value($element, $this->_formValues);
+ if (!empty($value) && is_array($value)) {
+ $this->_formValues[$element] = array('IN' => $value);
+ }
+ }
+
+ CRM_Core_BAO_CustomValue::fixCustomFieldValue($this->_formValues);
$this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
);
if ($status) {
$status = explode(',', $status);
- $tempStatus = array();
- foreach ($status as $value) {
- $tempStatus[$value] = 1;
- }
- $this->_formValues['member_status_id'] = $tempStatus;
- $this->_defaults['member_status_id'] = $tempStatus;
+ $this->_formValues['status_id'] = $this->_defaults['status_id'] = (array) $status;
}
$membershipType = CRM_Utils_Request::retrieve('type', 'String',
);
if ($membershipType) {
- $this->_formValues['member_membership_type_id'] = array($membershipType => 1);
- $this->_defaults['member_membership_type_id'] = array($membershipType => 1);
+ $this->_formValues['membership_type_id'] = array($membershipType);
+ $this->_defaults['membership_type_id'] = array($membershipType);
}
$cid = CRM_Utils_Request::retrieve('cid', 'Positive',