Browse Source

Gantt bars with start date and end date on the same day don't become red by overdue (#13521).

Patch by Mizuki ISHIKAWA.


git-svn-id: http://svn.redmine.org/redmine/trunk@17294 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.0.0
Go MAEDA 6 years ago
parent
commit
8b0bfbbc8b
2 changed files with 17 additions and 3 deletions
  1. 3
    3
      lib/redmine/helpers/gantt.rb
  2. 14
    0
      test/unit/lib/redmine/helpers/gantt_test.rb

+ 3
- 3
lib/redmine/helpers/gantt.rb View File

@@ -595,11 +595,11 @@ module Redmine
coords[:bar_progress_end] = self.date_to - self.date_from + 1
end
end
if progress_date < User.current.today
late_date = [User.current.today, end_date].min
if progress_date <= User.current.today
late_date = [User.current.today, end_date].min + 1
if late_date > self.date_from && late_date > start_date
if late_date < self.date_to
coords[:bar_late_end] = late_date - self.date_from + 1
coords[:bar_late_end] = late_date - self.date_from
else
coords[:bar_late_end] = self.date_to - self.date_from + 1
end

+ 14
- 0
test/unit/lib/redmine/helpers/gantt_test.rb View File

@@ -353,6 +353,20 @@ class Redmine::Helpers::GanttHelperTest < Redmine::HelperTest
assert_select 'div.task_late[style*="width:30px"]', 1
end

test "#line late line should be the same width as task_todo if start date and end date are the same day" do
create_gantt
@output_buffer = @gantt.line(today - 7, today - 7, 0, false, 'line', :format => :html, :zoom => 4)
assert_select 'div.task_late[style*="width:2px"]', 1
assert_select 'div.task_todo[style*="width:2px"]', 1
end

test "#line late line should be the same width as task_todo if start date and today are the same day" do
create_gantt
@output_buffer = @gantt.line(today, today, 0, false, 'line', :format => :html, :zoom => 4)
assert_select 'div.task_late[style*="width:2px"]', 1
assert_select 'div.task_todo[style*="width:2px"]', 1
end

test "#line done line should start from the starting point on the left" do
create_gantt
@output_buffer = @gantt.line(today - 7, today + 7, 30, false, 'line', :format => :html, :zoom => 4)

Loading…
Cancel
Save