summaryrefslogtreecommitdiffstats
path: root/app/models/issue_query.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-11-07 09:20:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-11-07 09:20:36 +0000
commitd3d7678c7689ed6c90fd6058b16c18fc7130c0cf (patch)
treefb6d5b7457a8f8ca0c67e56b2896f1a5ff086fbb /app/models/issue_query.rb
parent8123006bb3a43c3dd1cab8f849c51b79362c6b3a (diff)
downloadredmine-d3d7678c7689ed6c90fd6058b16c18fc7130c0cf.tar.gz
redmine-d3d7678c7689ed6c90fd6058b16c18fc7130c0cf.zip
Ability to filter issues blocked by any/no open issues (#16621).
Patch by Arthur Andersen. git-svn-id: http://svn.redmine.org/redmine/trunk@14809 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_query.rb')
-rw-r--r--app/models/issue_query.rb3
1 files changed, 3 insertions, 0 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]