+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
*/
/**
*/
public function buildQuickForm() {
parent::buildQuickForm();
- // text for sort_name
- $this->addElement('text',
- 'sort_name',
- ts('Contributor Name or Email'),
- CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact',
- 'sort_name'
- )
- );
+ $this->addSortNameField();
$this->_group = CRM_Core_PseudoConstant::nestedGroup();
}
+ /**
+ * Get the label for the sortName field if email searching is on.
+ *
+ * (email searching is a setting under search preferences).
+ *
+ * @return string
+ */
+ protected function getSortNameLabelWithEmail() {
+ return ts('Contributor Name or Email');
+ }
+
+ /**
+ * Get the label for the sortName field if email searching is off.
+ *
+ * (email searching is a setting under search preferences).
+ *
+ * @return string
+ */
+ protected function getSortNameLabelWithOutEmail() {
+ return ts('Contributor Name');
+ }
+
/**
* The post processing of the form gets done here.
*
'invoice_id',
'payment_instrument_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%");
- }
- }
- }
+ CRM_Contact_BAO_Query::processSpecialFormValue($this->_formValues, $specialParams);
$tags = CRM_Utils_Array::value('contact_tags', $this->_formValues);
if ($tags && !is_array($tags)) {