If 'Display subprojects issues on main projects' is set to false:

* do not include subprojects in the issue count of the parent project overview (#939)
* do not include subproject timelogs on the parent project (#848)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1298 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-03-27 18:22:12 +00:00
parent ef80597c39
commit 8960200409
3 changed files with 13 additions and 5 deletions
+6
View File
@@ -124,6 +124,12 @@ class Project < ActiveRecord::Base
statements.empty? ? base_statement : "((#{base_statement}) AND (#{statements.join(' OR ')}))"
end
def project_condition(with_subprojects)
cond = "#{Project.table_name}.id = #{id}"
cond = "(#{cond} OR #{Project.table_name}.parent_id = #{id})" if with_subprojects
cond
end
def self.find(*args)
if args.first && args.first.is_a?(String) && !args.first.match(/^\d*$/)
project = find_by_identifier(*args)