summaryrefslogtreecommitdiffstats
path: root/app/controllers/timelog_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-03-13 14:56:49 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-03-13 14:56:49 +0000
commit8e3d1b694ab47317638b474082cb70e08a8d02e7 (patch)
tree9997cc24910a029fea3e98ed0765566d9c4bb97e /app/controllers/timelog_controller.rb
parente109c9b6b6f314dea19bf92dffa217d962eaa200 (diff)
downloadredmine-8e3d1b694ab47317638b474082cb70e08a8d02e7.tar.gz
redmine-8e3d1b694ab47317638b474082cb70e08a8d02e7.zip
Adds subtasking (#443) including:
* priority, start/due dates, progress, estimate, spent time roll-up to parent issues * descendant issues tree displayed on the issue view with context menu support * issue tree display on the gantt chart * issue tree copy on project copy * unlimited nesting Defining subtasks requires the new permission 'Manage subtasks'. Subtasks can not belong to a different project than the parent task. Implementation is based on scoped nested sets for fast reads and updates. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3573 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/timelog_controller.rb')
-rw-r--r--app/controllers/timelog_controller.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index c08815890..160c19974 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -94,7 +94,7 @@ class TimelogController < ApplicationController
elsif @issue.nil?
sql_condition = @project.project_condition(Setting.display_subprojects_issues?)
else
- sql_condition = "#{TimeEntry.table_name}.issue_id = #{@issue.id}"
+ sql_condition = "#{Issue.table_name}.root_id = #{@issue.root_id} AND #{Issue.table_name}.lft >= #{@issue.lft} AND #{Issue.table_name}.rgt <= #{@issue.rgt}"
end
sql = "SELECT #{sql_select}, tyear, tmonth, tweek, spent_on, SUM(hours) AS hours"
@@ -166,7 +166,7 @@ class TimelogController < ApplicationController
elsif @issue.nil?
cond << @project.project_condition(Setting.display_subprojects_issues?)
else
- cond << ["#{TimeEntry.table_name}.issue_id = ?", @issue.id]
+ cond << "#{Issue.table_name}.root_id = #{@issue.root_id} AND #{Issue.table_name}.lft >= #{@issue.lft} AND #{Issue.table_name}.rgt <= #{@issue.rgt}"
end
retrieve_date_range
@@ -176,7 +176,7 @@ class TimelogController < ApplicationController
respond_to do |format|
format.html {
# Paginate results
- @entry_count = TimeEntry.count(:include => :project, :conditions => cond.conditions)
+ @entry_count = TimeEntry.count(:include => [:project, :issue], :conditions => cond.conditions)
@entry_pages = Paginator.new self, @entry_count, per_page_option, params['page']
@entries = TimeEntry.find(:all,
:include => [:project, :activity, :user, {:issue => :tracker}],
@@ -184,7 +184,7 @@ class TimelogController < ApplicationController
:order => sort_clause,
:limit => @entry_pages.items_per_page,
:offset => @entry_pages.current.offset)
- @total_hours = TimeEntry.sum(:hours, :include => :project, :conditions => cond.conditions).to_f
+ @total_hours = TimeEntry.sum(:hours, :include => [:project, :issue], :conditions => cond.conditions).to_f
render :layout => !request.xhr?
}