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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user