summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-05-25 13:26:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-05-25 13:26:21 +0000
commita92749ef93bbcc4e9a1116bd58d750de3054f78a (patch)
treee42bd285b71f477904b3813a5cb872c216a6c7d9 /app/controllers
parent03f0236a6ee995363c54f958d66a0abbf0d3a827 (diff)
downloadredmine-a92749ef93bbcc4e9a1116bd58d750de3054f78a.tar.gz
redmine-a92749ef93bbcc4e9a1116bd58d750de3054f78a.zip
Gantt chart: display issues that don't have a due date if they are assigned to a version with a date (#184).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1455 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects_controller.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 34ce734a5..07b29fa25 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -382,11 +382,18 @@ class ProjectsController < ApplicationController
@events = []
@project.issues_with_subprojects(@with_subprojects) do
+ # Issues that have start and due dates
@events += Issue.find(:all,
:order => "start_date, due_date",
:include => [:tracker, :status, :assigned_to, :priority, :project],
:conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_date>?)) and start_date is not null and due_date is not null and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')}))", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to]
) unless @selected_tracker_ids.empty?
+ # Issues that don't have a due date but that are assigned to a version with a date
+ @events += Issue.find(:all,
+ :order => "start_date, effective_date",
+ :include => [:tracker, :status, :assigned_to, :priority, :project, :fixed_version],
+ :conditions => ["(((start_date>=? and start_date<=?) or (effective_date>=? and effective_date<=?) or (start_date<? and effective_date>?)) and start_date is not null and due_date is null and effective_date is not null and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')}))", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to]
+ ) unless @selected_tracker_ids.empty?
@events += Version.find(:all, :include => :project,
:conditions => ["effective_date BETWEEN ? AND ?", @date_from, @date_to])
end