summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/issue_query.rb3
-rw-r--r--app/models/query.rb8
2 files changed, 8 insertions, 3 deletions
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb
index b167c5d9f..fdb5e30cf 100644
--- a/app/models/issue_query.rb
+++ b/app/models/issue_query.rb
@@ -535,6 +535,9 @@ class IssueQuery < Query
op = (operator == "!p" ? 'NOT IN' : 'IN')
comp = (operator == "=!p" ? '<>' : '=')
"#{Issue.table_name}.id #{op} (SELECT DISTINCT #{IssueRelation.table_name}.#{join_column} FROM #{IssueRelation.table_name}, #{Issue.table_name} relissues WHERE #{IssueRelation.table_name}.relation_type = '#{self.class.connection.quote_string(relation_type)}' AND #{IssueRelation.table_name}.#{target_join_column} = relissues.id AND relissues.project_id #{comp} #{value.first.to_i})"
+ when "*o", "!o"
+ op = (operator == "!o" ? 'NOT IN' : 'IN')
+ "#{Issue.table_name}.id #{op} (SELECT DISTINCT #{IssueRelation.table_name}.#{join_column} FROM #{IssueRelation.table_name}, #{Issue.table_name} relissues WHERE #{IssueRelation.table_name}.relation_type = '#{self.class.connection.quote_string(relation_type)}' AND #{IssueRelation.table_name}.#{target_join_column} = relissues.id AND relissues.status_id IN (SELECT id FROM #{IssueStatus.table_name} WHERE is_closed=#{self.class.connection.quoted_false}))"
end
if relation_options[:sym] == field && !options[:reverse]
diff --git a/app/models/query.rb b/app/models/query.rb
index ed59c5526..0ba7a8c4b 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -203,7 +203,9 @@ class Query < ActiveRecord::Base
"!~" => :label_not_contains,
"=p" => :label_any_issues_in_project,
"=!p" => :label_any_issues_not_in_project,
- "!p" => :label_no_issues_in_project
+ "!p" => :label_no_issues_in_project,
+ "*o" => :label_any_open_issues,
+ "!o" => :label_no_open_issues
}
class_attribute :operators_by_filter_type
@@ -218,7 +220,7 @@ class Query < ActiveRecord::Base
:text => [ "~", "!~", "!*", "*" ],
:integer => [ "=", ">=", "<=", "><", "!*", "*" ],
:float => [ "=", ">=", "<=", "><", "!*", "*" ],
- :relation => ["=", "=p", "=!p", "!p", "!*", "*"],
+ :relation => ["=", "=p", "=!p", "!p", "*o", "!o", "!*", "*"],
:tree => ["=", "~", "!*", "*"]
}
@@ -281,7 +283,7 @@ class Query < ActiveRecord::Base
# filter requires one or more values
(values_for(field) and !values_for(field).first.blank?) or
# filter doesn't require any value
- ["o", "c", "!*", "*", "t", "ld", "w", "lw", "l2w", "m", "lm", "y"].include? operator_for(field)
+ ["o", "c", "!*", "*", "t", "ld", "w", "lw", "l2w", "m", "lm", "y", "*o", "!o"].include? operator_for(field)
end if filters
end