}
}
+ if (in_array($name, array('prefix_id', 'suffix_id', 'gender_id'))) {
+ if (CRM_Utils_Array::value($field['pseudoconstant']['optionGroupName'], $this->_returnProperties)) {
+ $makeException = TRUE;
+ }
+ }
+
$cfID = CRM_Core_BAO_CustomField::getKeyID($name);
if (
CRM_Utils_Array::value($name, $this->_paramLookup) ||
case 'activity_campaign_id':
case 'activity_engagement_level':
case 'activity_id':
+ case 'activity_result':
case 'source_contact':
CRM_Activity_BAO_Query::whereClauseSingle($values, $this);
return;
$op = 'LIKE';
}
$wc = self::caseImportant($op) ? "LOWER(contact_a.organization_name)" : "contact_a.organization_name";
- $this->_where[$grouping][] = self::buildClause($wc, $op,
- "'$value' AND contact_a.contact_type ='Individual'"
+ $ceWhereClause = self::buildClause($wc, $op,
+ $value
);
+ $ceWhereClause .= " AND contact_a.contact_type = 'Individual'";
+ $this->_where[$grouping][] = $ceWhereClause;
$this->_qill[$grouping][] = "$field[title] $op \"$value\"";
}
elseif ($name === 'email_greeting') {
}
$wc = 'civicrm_website.url';
- $this->_where[$grouping][] = self::buildClause($wc, $op, "'$value'");
+ $this->_where[$grouping][] = $d = self::buildClause($wc, $op, $value);
$this->_qill[$grouping][] = "$field[title] $op \"$value\"";
}
elseif ($name === 'contact_is_deleted') {
list($name, $op, $value, $grouping, $wildcard) = $values;
$pref = array();
- if (!is_array($value)) {
+ if (in_array($op, array( 'IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) {
+ $value = NULL;
+ }
+ elseif (!is_array($value)) {
$v = array();
$value = trim($value, ' ()');
if (strpos($value, CRM_Core_DAO::VALUE_SEPARATOR) !== FALSE) {
$commPref = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method');
$sqlValue = array();
+ $showValue = array();
$sql = "contact_a.preferred_communication_method";
- foreach ($pref as $val) {
- $sqlValue[] = "( $sql like '%" . CRM_Core_DAO::VALUE_SEPARATOR . $val . CRM_Core_DAO::VALUE_SEPARATOR . "%' ) ";
- $showValue[] = $commPref[$val];
+ if (in_array($op, array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) {
+ $sqlValue[] = "{$sql} {$op}";
+ }
+ else {
+ foreach ($pref as $val) {
+ $sqlValue[] = "( $sql like '%" . CRM_Core_DAO::VALUE_SEPARATOR . $val . CRM_Core_DAO::VALUE_SEPARATOR . "%' ) ";
+ $showValue[] = $commPref[$val];
+ }
}
$this->_where[$grouping][] = "( " . implode(' OR ', $sqlValue) . " )";
$this->_qill[$grouping][] = ts('Preferred Communication Method') . " $op " . implode(' ' . ts('or') . ' ', $showValue);
}
$value = CRM_Utils_Type::escape($value, $dataType);
-
// if we dont have a dataType we should assume
if ($dataType == 'String' || $dataType == 'Text') {
$value = "'" . strtolower($value) . "'";