if (empty($this->_instanceValues)) {
CRM_Core_Error::fatal("Report could not be loaded.");
}
-
+ $this->_title = $this->_instanceValues['title'];
if (!empty($this->_instanceValues['permission']) &&
(!(CRM_Core_Permission::check($this->_instanceValues['permission']) ||
CRM_Core_Permission::check('administer Reports')
break;
default:
if ($daoOrBaoName &&
- (array_key_exists('pseudoconstant', $this->_columns[$tableName][$fieldGrp][$fieldName])
- || array_key_exists('enumValues', $this->_columns[$tableName][$fieldGrp][$fieldName]))
- ) {
+ array_key_exists('pseudoconstant', $this->_columns[$tableName][$fieldGrp][$fieldName])) {
// with multiple options operator-type is generally multi-select
$this->_columns[$tableName][$fieldGrp][$fieldName]['operatorType'] = CRM_Report_Form::OP_MULTISELECT;
if (!array_key_exists('options', $this->_columns[$tableName][$fieldGrp][$fieldName])) {
// multiple options for a column is stored as ^A{val1}^A{val2}^A
return array(
'mhas' => ts('Is one of'),
+ 'mnot' => ts('Is not one of'),
);
default:
$clause = "{$field['dbAlias']} REGEXP '[[:<:]]" . implode('|', $value) . "[[:>:]]'";
}
break;
+
+ case 'mnot':
+ // mnot == multiple is not one of
+ if ($value !== NULL && count($value) > 0) {
+ $sqlOP = $this->getSQLOperator($op);
+ $clause = "( {$field['dbAlias']} NOT REGEXP '[[:<:]]" . implode('|', $value) . "[[:>:]]' OR {$field['dbAlias']} IS NULL )";
+ }
+ break;
case 'sw':
case 'ew':
}
elseif (array_key_exists('extends', $table)) {
// For custom fields referenced in $this->_customGroupExtends
- $fields = $table['fields'];
+ $fields = CRM_Utils_Array::value('fields', $table, array());
}
if (!empty($fields) && is_array($fields)) {
foreach ($fields as $fieldName => $field) {
$val[$key] = $options[$valIds];
}
}
- $pair[$op] = (count($val) == 1) ? (($op == 'notin') ? ts('Is Not') : ts('Is')) : CRM_Utils_Array::value($op, $pair);
+ $pair[$op] = (count($val) == 1) ? (($op == 'notin' || $op == 'mnot') ? ts('Is Not') : ts('Is')) : CRM_Utils_Array::value($op, $pair);
$val = implode(', ', $val);
$value = "{$pair[$op]} " . $val;
}