} elsif (lc($op) eq 'not in') {
$sql .= " NOT IN (". join(",", map { $_->toSQL } @$val).")";
+ } elsif (lc($op) eq '= any') {
+ $val = $$val[0] if (ref($val) eq 'ARRAY');
+ $val = $val->toSQL;
+ $sql = "$val = ANY (".$self->SUPER::toSQL.")";
+
+ } elsif (lc($op) eq '<> any') {
+ $val = $$val[0] if (ref($val) eq 'ARRAY');
+ $val = $val->toSQL;
+ $sql = "$val <> ANY (".$self->SUPER::toSQL.")";
+
} elsif (lc($op) eq 'is blank') {
$sql = '('. $self->SUPER::toSQL ." IS NULL OR ". $self->SUPER::toSQL ." = '')";
"FILTERS_LABEL_NOT_NULL": "Is not NULL",
"FILTERS_LABEL_NULL_BLANK": "Is NULL or Blank",
"FILTERS_LABEL_NOT_NULL_BLANK": "Is not NULL or Blank",
+ "FILTERS_LABEL_EQ_ANY": "Equals Any",
+ "FILTERS_LABEL_NE_ANY": "Does Not Equal Any",
"FOLDERS_TEMPLATES": "Templates",
"FOLDERS_TEMPLATE": "Template",
"OPERATORS_IS_NOT_NULL": "Is not NULL",
"OPERATORS_NULL_BLANK": "Is NULL or Blank",
"OPERATORS_NOT_NULL_BLANK": "Is not NULL or Blank",
+ "OPERATORS_EQ_ANY": "Equals Any",
+ "OPERATORS_NE_ANY": "Does Not Equal Any",
"SOURCE_BROWSE_AGGREGATE": "Aggregate",
"SOURCE_BROWSE_NON_AGGREGATE": "Non-Aggregate",
'is not blank' : {
label : rpt_strings.FILTERS_LABEL_NOT_NULL_BLANK
+ },
+
+ '= any' : {
+ label : rpt_strings.FILTERS_LABEL_EQ_ANY
+ },
+
+ '<> any' : {
+ label : rpt_strings.FILTERS_LABEL_NE_ANY
}
}
'is not blank' : {
label : rpt_strings.OPERATORS_NOT_NULL_BLANK
+ },
+
+ '= any' : {
+ labels : { 'array' : rpt_strings.OPERATORS_EQ_ANY }
+ },
+
+ '<> any' : {
+ labels : { 'array' : rpt_strings.OPERATORS_NE_ANY }
}
}
alias : field_label,
join : jointype,
datatype : datatype,
- op : '=',
+ op : (datatype == 'array') ? '= any' : '=',
op_label : rpt_strings.TEMPLATE_CONF_EQUALS,
op_value : {}
};
for (var i in OILS_RPT_FILTERS) {
var o = OILS_RPT_FILTERS[i];
- menu.appendChild(
- createMenuItem(
- { label : o.label,
- onmouseup : "changeOperator({op:'"+i+"',label:'"+o.label+"'})"
- }
- )
- );
+ if (o.label) {
+ menu.appendChild(
+ createMenuItem(
+ { label : o.label,
+ onmouseup : "changeOperator({op:'"+i+"',label:'"+o.label+"'})"
+ }
+ )
+ );
+ }
+
if (o.labels) {
var keys = getKeys(o.labels);
for ( var k in keys ) {
dojo.requireLocalization("openils.reports", "reports");
var rpt_strings = dojo.i18n.getLocalization("openils.reports", "reports");
+var OILS_RPT_DTYPE_ARRAY = 'array';
var OILS_RPT_DTYPE_STRING = 'text';
var OILS_RPT_DTYPE_MONEY = 'money';
var OILS_RPT_DTYPE_BOOL = 'bool';