summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-06-27 18:59:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-06-27 18:59:36 +0000
commit184be9d0e3aff4e5166d7ea3d35aeb55a81162ee (patch)
tree02f388384fa0f7d3a62896f54ee10ca1eb7a2ea2
parent7eb3b186c4f23f17965efb713c24edd88788e6c8 (diff)
downloadredmine-184be9d0e3aff4e5166d7ea3d35aeb55a81162ee.tar.gz
redmine-184be9d0e3aff4e5166d7ea3d35aeb55a81162ee.zip
Fixed: time report doesn't take account of the project for time calculations
git-svn-id: http://redmine.rubyforge.org/svn/trunk@575 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/timelog_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index bed6b1c07..01c4ddca9 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -64,7 +64,8 @@ class TimelogController < ApplicationController
sql = "SELECT #{sql_select}, tyear, tmonth, tweek, SUM(hours) AS hours"
sql << " FROM #{TimeEntry.table_name} LEFT JOIN #{Issue.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id"
- sql << " WHERE 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 << " WHERE #{TimeEntry.table_name}.project_id = %s" % @project.id
+ 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"
@hours = ActiveRecord::Base.connection.select_all(sql)