Adds an application setting to choose whether or not subprojects issues should be displayed by default on the issue list, calendar and gantt (r1178). Default is true.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1198 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-03-06 08:32:56 +00:00
parent e951d84584
commit 533994e5ea
27 changed files with 43 additions and 8 deletions
+13 -6
View File
@@ -261,12 +261,19 @@ class Query < ActiveRecord::Base
clause = ''
if project && !@project.active_children.empty?
ids = [project.id]
if has_filter?("subproject_id") && operator_for("subproject_id") == "="
# include the selected subprojects
ids += values_for("subproject_id").each(&:to_i)
else
# include all the subprojects unless 'none' is selected
ids += project.active_children.collect{|p| p.id} unless has_filter?("subproject_id") && operator_for("subproject_id") == "!*"
if has_filter?("subproject_id")
case operator_for("subproject_id")
when '='
# include the selected subprojects
ids += values_for("subproject_id").each(&:to_i)
when '!*'
# main project only
else
# all subprojects
ids += project.active_children.collect{|p| p.id}
end
elsif Setting.display_subprojects_issues?
ids += project.active_children.collect{|p| p.id}
end
clause << "#{Issue.table_name}.project_id IN (%s)" % ids.join(',')
elsif project