* @package CRM
* @copyright CiviCRM LLC (c) 2004-2013
* $Id$
-nnnnnnnnn *
+ *
*/
/**
continue;
}
+ if ($field['pseudoconstant']) {
+ continue;
+ }
+
// redirect to activity select clause
if (substr($name, 0, 9) == 'activity_') {
CRM_Activity_BAO_Query::select($this);
}
}
- // check if there is a value, if so also add to where Clause
+ // Check if there is a value, if so also add to where Clause
$addWhere = FALSE;
if ($this->_params) {
$nm = $elementName;
$this->filterRelatedContacts($from, $where, $having);
}
+ // CRM_Core_Error::debug($this);
return array($select, $from, $where, $having);
}
static function select(&$query) {
if (!empty($query->_params) || !empty($query->_returnProperties)) {
$field = self::getFields();
- foreach ($field as $name => $title) {
- list($tableName, $fieldName) = explode('.', $title['where']);
+ foreach ($field as $name => $values) {
+ if ($values['pseudoconstant']) {
+ continue;
+ }
+ list($tableName, $fieldName) = explode('.', $values['where']);
if (CRM_Utils_Array::value($name, $query->_returnProperties)) {
$query->_select["{$name}_id"] = "{$name}.value as {$name}_id";
$query->_element["{$name}_id"] = 1;