Skip to content
Snippets Groups Projects
Commit a87ba7c0 authored by Kurund Jalmi's avatar Kurund Jalmi
Browse files

Revert "CRM-13996 - Search views - hack to fix prefix, gender, suffix"

This reverts commit e30e8c3c.
parent c3cfb269
Branches
Tags
No related merge requests found
......@@ -634,14 +634,9 @@ class CRM_Contact_BAO_Query {
}
}
}
// Fixme: this stuff does not need to be hard-coded, should be retrieved from schema metadata
if (in_array($name, array('prefix_id', 'suffix_id', 'gender_id'))) {
if (
// Hack for default search view
!empty($this->_returnProperties[$field['pseudoconstant']['optionGroupName']]) ||
// Hack for profile search view
!empty($this->_returnProperties[$name])
) {
if (CRM_Utils_Array::value($field['pseudoconstant']['optionGroupName'], $this->_returnProperties)) {
$makeException = TRUE;
}
}
......@@ -759,31 +754,13 @@ class CRM_Contact_BAO_Query {
}
elseif ($fieldName != 'id') {
if ($fieldName == 'prefix_id') {
// Hack - profile views use different field name than normal views!
$this->_pseudoConstantsSelect['prefix_id'] =
$this->_pseudoConstantsSelect['individual_prefix'] = array(
'pseudoField' => 'prefix_id',
'idCol' => "prefix_id",
'bao' => 'CRM_Contact_BAO_Contact'
);
$this->_pseudoConstantsSelect['individual_prefix'] = array('pseudoField' => 'prefix_id', 'idCol' => "prefix_id", 'bao' => 'CRM_Contact_BAO_Contact');
}
if ($fieldName == 'suffix_id') {
// Hack - profile views use different field name than normal views!
$this->_pseudoConstantsSelect['suffix_id'] =
$this->_pseudoConstantsSelect['individual_suffix'] = array(
'pseudoField' => 'suffix_id',
'idCol' => "suffix_id",
'bao' => 'CRM_Contact_BAO_Contact'
);
$this->_pseudoConstantsSelect['individual_suffix'] = array('pseudoField' => 'suffix_id', 'idCol' => "suffix_id", 'bao' => 'CRM_Contact_BAO_Contact');
}
if ($fieldName == 'gender_id') {
// Hack - profile views use different field name than normal views!
$this->_pseudoConstantsSelect['gender_id'] =
$this->_pseudoConstantsSelect['gender'] = array(
'pseudoField' => 'gender_id',
'idCol' => "gender_id",
'bao' => 'CRM_Contact_BAO_Contact'
);
$this->_pseudoConstantsSelect['gender'] = array('pseudoField' => 'gender_id', 'idCol' => "gender_id", 'bao' => 'CRM_Contact_BAO_Contact');
}
$this->_select[$name] = "contact_a.{$fieldName} as `$name`";
}
......@@ -5196,7 +5173,6 @@ AND displayRelType.is_active = 1
/**
* convert the pseudo constants id's to their names
* FIXME: Get rid of hard-coded references to fields, should be retrievable from schema metadata
*
* @param reference parameter $dao
* @param bool $return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment