mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
gantt: simplify week day logic in to_pdf() at lib/redmine/helpers/gantt.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@19797 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
0f8df77744
commit
7055dcd767
@ -563,35 +563,29 @@ module Redmine
|
||||
left = subject_width
|
||||
height = header_height
|
||||
day_num = self.date_from
|
||||
wday = self.date_from.cwday
|
||||
pdf.SetFontStyle('B', 7)
|
||||
(self.date_to - self.date_from + 1).to_i.times do
|
||||
(self.date_from..self.date_to).each do |g_date|
|
||||
width = zoom
|
||||
pdf.SetY(y_start + header_height * 2)
|
||||
pdf.SetX(left)
|
||||
pdf.SetTextColor(non_working_week_days.include?(wday) ? 150 : 0)
|
||||
pdf.SetTextColor(non_working_week_days.include?(g_date.cwday) ? 150 : 0)
|
||||
pdf.RDMCell(width, height, day_num.day.to_s, "LTR", 0, "C")
|
||||
left = left + width
|
||||
day_num = day_num + 1
|
||||
wday = wday + 1
|
||||
wday = 1 if wday > 7
|
||||
end
|
||||
end
|
||||
# Days headers
|
||||
if show_days
|
||||
left = subject_width
|
||||
height = header_height
|
||||
wday = self.date_from.cwday
|
||||
pdf.SetFontStyle('B', 7)
|
||||
(self.date_to - self.date_from + 1).to_i.times do
|
||||
(self.date_from..self.date_to).each do |g_date|
|
||||
width = zoom
|
||||
pdf.SetY(y_start + header_height * (show_day_num ? 3 : 2))
|
||||
pdf.SetX(left)
|
||||
pdf.SetTextColor(non_working_week_days.include?(wday) ? 150 : 0)
|
||||
pdf.RDMCell(width, height, day_name(wday).first, "LTR", 0, "C")
|
||||
pdf.SetTextColor(non_working_week_days.include?(g_date.cwday) ? 150 : 0)
|
||||
pdf.RDMCell(width, height, day_name(g_date.cwday).first, "LTR", 0, "C")
|
||||
left = left + width
|
||||
wday = wday + 1
|
||||
wday = 1 if wday > 7
|
||||
end
|
||||
end
|
||||
pdf.SetY(y_start)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user