elseif ($field['pseudoconstant']) {
$this->optionValueQuery(
$name, $op, $value, $grouping,
- CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', $field['dbName']),
+ CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', $field['name']),
$field,
$field['title'],
'String',
TRUE
);
- if ($name == 'gender') {
+ if ($name == 'gender_id') {
self::$_openedPanes[ts('Demographics')] = TRUE;
}
}
// its a string, lets get the int value
$value = array_search($value, $selectValues);
}
- $wc = self::caseImportant($op) && ! $useIDsOnly ? "LOWER({$field['where']})" : "{$field['where']}";
+ if ($useIDsOnly) {
+ list($tableName, $fieldName) = explode('.', $field['where'], 2);
+ if ($tableName == 'civicrm_contact') {
+ $wc = "contact_a.$fieldName";
+ }
+ }
+ else {
+ $wc = self::caseImportant($op) ? "LOWER({$field['where']})" : "{$field['where']}";
+ }
$this->_where[$grouping][] = self::buildClause($wc, $op, $value, $dataType);
$this->_qill[$grouping][] = $label . " $op '$qill'";
}
| This file is a part of CiviCRM. |
| |
| CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
+s | under the terms of the GNU Affero General Public License |
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
| |
| CiviCRM is distributed in the hope that it will be useful, but |
array('id' => "civicrm_gender_{$var}_{$key}")
);
}
- $form->addGroup($genderOptions, 'gender', ts('Gender'));
+ $form->addGroup($genderOptions, 'gender_id', ts('Gender'));
CRM_Core_Form_Date::buildDateRange($form, 'birth_date', 1, '_low', '_high', ts('From'), FALSE, FALSE, 'birth');
$groupID = CRM_Utils_Array::key('1', $this->_formValues['group']);
$pseudoconstants = array();
- // get all the pseudoconstant values
- foreach ($this->_fields as $name => $values) {
- if (isset($this->_fields[$name]['pseudoconstant'])) {
- $pseudoconstants[$name] =
- array(
- 'dbName' => $this->_fields[$name]['name'],
- 'values' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', $name),
- );
+ if (!empty($this->_fields)) {
+ // get all the pseudoconstant values
+ foreach ($this->_fields as $name => $values) {
+ if (isset($this->_fields[$name]['pseudoconstant'])) {
+ $pseudoconstants[$name] =
+ array(
+ 'dbName' => $this->_fields[$name]['name'],
+ 'values' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', $name),
+ );
+ }
}
}
</tr>
<tr>
<td>
- {$form.gender.label}<br />
- {$form.gender.html}<span class="crm-clear-link">(<a href="#" title="unselect" onclick="unselectRadio('gender', 'Advanced'); return false;" >{ts}clear{/ts}</a>)</span>
+ {$form.gender_id.label}<br />
+ {$form.gender_id.html}<span class="crm-clear-link">(<a href="#" title="unselect" onclick="unselectRadio('gender_id', 'Advanced'); return false;" >{ts}clear{/ts}</a>)</span>
</td>
</tr>
</table>