mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-31 19:47:14 +00:00
git-svn-id: https://svn.redmine.org/redmine/trunk@22805 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
3822b633ef
commit
1a96ee225d
@ -80,7 +80,7 @@ module FixedIssuesExtension
|
||||
if @estimated_average.nil?
|
||||
issues_with_total_estimated_hours = select {|c| c.total_estimated_hours.to_f > 0.0}
|
||||
if issues_with_total_estimated_hours.any?
|
||||
average = issues_with_total_estimated_hours.map(&:total_estimated_hours).sum.to_f / issues_with_total_estimated_hours.count
|
||||
average = issues_with_total_estimated_hours.sum(&:total_estimated_hours).to_f / issues_with_total_estimated_hours.count
|
||||
else
|
||||
average = 1.0
|
||||
end
|
||||
@ -100,12 +100,12 @@ module FixedIssuesExtension
|
||||
@issues_progress[open] ||= begin
|
||||
progress = 0
|
||||
if count > 0
|
||||
done = open(open).map {|c|
|
||||
done = open(open).sum do |c|
|
||||
estimated = c.total_estimated_hours.to_f
|
||||
estimated = estimated_average unless estimated > 0.0
|
||||
ratio = c.closed? ? 100 : (c.done_ratio || 0)
|
||||
estimated * ratio
|
||||
}.sum
|
||||
end
|
||||
progress = done / (estimated_average * count)
|
||||
end
|
||||
progress
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user