summaryrefslogtreecommitdiffstats
path: root/app/controllers/timelog_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-03-27 18:22:12 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-03-27 18:22:12 +0000
commit89602004098de22c59e668ad814969f5f12cd80b (patch)
tree7947dff042afeab4a171b8f10c15d1fe45133719 /app/controllers/timelog_controller.rb
parentef80597c39e02d5e209f5c3dadcf27096b21120b (diff)
downloadredmine-89602004098de22c59e668ad814969f5f12cd80b.tar.gz
redmine-89602004098de22c59e668ad814969f5f12cd80b.zip
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
Diffstat (limited to 'app/controllers/timelog_controller.rb')
-rw-r--r--app/controllers/timelog_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index d767037eb..8cfe225d1 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -72,7 +72,7 @@ class TimelogController < ApplicationController
sql << " FROM #{TimeEntry.table_name}"
sql << " LEFT JOIN #{Issue.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id"
sql << " LEFT JOIN #{Project.table_name} ON #{TimeEntry.table_name}.project_id = #{Project.table_name}.id"
- sql << " WHERE (#{Project.table_name}.id = %s OR #{Project.table_name}.parent_id = %s)" % [@project.id, @project.id]
+ sql << " WHERE (%s)" % @project.project_condition(Setting.display_subprojects_issues?)
sql << " AND (%s)" % Project.allowed_to_condition(User.current, :view_time_entries)
sql << " AND spent_on BETWEEN '%s' AND '%s'" % [ActiveRecord::Base.connection.quoted_date(@date_from.to_time), ActiveRecord::Base.connection.quoted_date(@date_to.to_time)]
sql << " GROUP BY #{sql_group_by}, tyear, tmonth, tweek"
@@ -159,7 +159,7 @@ class TimelogController < ApplicationController
@from, @to = @to, @from if @from && @to && @from > @to
cond = ARCondition.new
- cond << (@issue.nil? ? ["(#{Project.table_name}.id = ? OR #{Project.table_name}.parent_id = ?)", @project.id, @project.id] :
+ cond << (@issue.nil? ? @project.project_condition(Setting.display_subprojects_issues?) :
["#{TimeEntry.table_name}.issue_id = ?", @issue.id])
if @from