]> source.dussan.org Git - redmine.git/commitdiff
r18535@gaspard (orig r1799): jplang | 2008-09-11 19:08:00 +0200
authorNicolas Chuche <nicolas.chuche@barna.be>
Sun, 14 Sep 2008 15:32:21 +0000 (15:32 +0000)
committerNicolas Chuche <nicolas.chuche@barna.be>
Sun, 14 Sep 2008 15:32:21 +0000 (15:32 +0000)
 Changes versions retrieval on gantt chart.

git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1835 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb

index 7d39e45528168dd8d0eac2a2cc86810f8a5f9151..04f78092bb284c6d979ecce51ec2e1c653365ae5 100644 (file)
@@ -339,11 +339,10 @@ class IssuesController < ApplicationController
                            :include => [:tracker, :status, :assigned_to, :priority, :project, :fixed_version], 
                            :conditions => ["(#{@query.statement}) AND (((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)", @gantt.date_from, @gantt.date_to, @gantt.date_from, @gantt.date_to, @gantt.date_from, @gantt.date_to]
                            )
-      # Related versions
-      version_ids = events.collect(&:fixed_version_id).compact.uniq
-      events += Version.find_all_by_id(version_ids, :include => :project,
-                                                    :conditions => ["effective_date BETWEEN ? AND ?", @gantt.date_from, @gantt.date_to]) unless version_ids.empty?
-      
+      # Versions
+      events += Version.find(:all, :include => :project,
+                                   :conditions => ["(#{@query.project_statement}) AND effective_date BETWEEN ? AND ?", @gantt.date_from, @gantt.date_to])
+                                   
       @gantt.events = events
     end