##// END OF EJS Templates
Makes Version#start_date return the minimum start_date of its issues....
Jean-Philippe Lang -
r4460:df9ea2413605
parent child
Show More
@@ -454,7 +454,7 class Project < ActiveRecord::Base
454 [
454 [
455 issues.minimum('start_date'),
455 issues.minimum('start_date'),
456 shared_versions.collect(&:effective_date),
456 shared_versions.collect(&:effective_date),
457 shared_versions.collect {|v| v.fixed_issues.minimum('start_date')}
457 shared_versions.collect(&:start_date)
458 ].flatten.compact.min
458 ].flatten.compact.min
459 end
459 end
460
460
@@ -43,7 +43,7 class Version < ActiveRecord::Base
43 end
43 end
44
44
45 def start_date
45 def start_date
46 effective_date
46 @start_date ||= fixed_issues.minimum('start_date')
47 end
47 end
48
48
49 def due_date
49 def due_date
@@ -77,8 +77,7 class Version < ActiveRecord::Base
77 def behind_schedule?
77 def behind_schedule?
78 if completed_pourcent == 100
78 if completed_pourcent == 100
79 return false
79 return false
80 elsif due_date && fixed_issues.present? && fixed_issues.minimum('start_date') # TODO: should use #start_date but that method is wrong...
80 elsif due_date && start_date
81 start_date = fixed_issues.minimum('start_date')
82 done_date = start_date + ((due_date - start_date+1)* completed_pourcent/100).floor
81 done_date = start_date + ((due_date - start_date+1)* completed_pourcent/100).floor
83 return done_date <= Date.today
82 return done_date <= Date.today
84 else
83 else
@@ -319,7 +319,7 module Redmine
319 options[:zoom] ||= 1
319 options[:zoom] ||= 1
320 options[:g_width] ||= (self.date_to - self.date_from + 1) * options[:zoom]
320 options[:g_width] ||= (self.date_to - self.date_from + 1) * options[:zoom]
321
321
322 coords = coordinates(version.fixed_issues.minimum('start_date'), version.due_date, version.completed_pourcent, options[:zoom])
322 coords = coordinates(version.start_date, version.due_date, version.completed_pourcent, options[:zoom])
323 label = "#{h version } #{h version.completed_pourcent.to_i.to_s}%"
323 label = "#{h version } #{h version.completed_pourcent.to_i.to_s}%"
324 label = h("#{version.project} -") + label unless @project && @project == version.project
324 label = h("#{version.project} -") + label unless @project && @project == version.project
325
325
General Comments 0
You need to be logged in to leave comments. Login now