"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/redmine/helpers/gantt.rb" between
redmine-4.1.0.tar.gz and redmine-4.1.1.tar.gz

About: Redmine is a flexible project management and bug-tracking web application (using the Ruby on Rails framework). It supports also project wikis and forums, documents management, and multiple version control systems.

gantt.rb  (redmine-4.1.0):gantt.rb  (redmine-4.1.1)
skipping to change at line 154 skipping to change at line 154
# Renders the selected column of the Gantt chart, the right side of subjec ts. # Renders the selected column of the Gantt chart, the right side of subjec ts.
def selected_column_content(options={}) def selected_column_content(options={})
render(options.merge(:only => :selected_columns)) unless @columns.has_ke y?(options[:column].name) render(options.merge(:only => :selected_columns)) unless @columns.has_ke y?(options[:column].name)
@columns[options[:column].name] @columns[options[:column].name]
end end
# Returns issues that will be rendered # Returns issues that will be rendered
def issues def issues
@issues ||= @query.issues( @issues ||= @query.issues(
:include => [:assigned_to, :tracker, :priority, :category, :fixed_vers ion], :include => [:assigned_to, :tracker, :priority, :category, :fixed_vers ion],
:order => "#{Project.table_name}.lft ASC, #{Issue.table_name}.id ASC", :order => ["#{Project.table_name}.lft ASC", "#{Issue.table_name}.id AS C"],
:limit => @max_rows :limit => @max_rows
) )
end end
# Returns a hash of the relations between the issues that are present on t he gantt # Returns a hash of the relations between the issues that are present on t he gantt
# and that should be displayed, grouped by issue ids. # and that should be displayed, grouped by issue ids.
def relations def relations
return @relations if @relations return @relations if @relations
if issues.any? if issues.any?
issue_ids = issues.map(&:id) issue_ids = issues.map(&:id)
skipping to change at line 634 skipping to change at line 634
zoom ||= @zoom zoom ||= @zoom
coords = {} coords = {}
if start_date && end_date && start_date < self.date_to && end_date > sel f.date_from if start_date && end_date && start_date < self.date_to && end_date > sel f.date_from
if start_date > self.date_from if start_date > self.date_from
coords[:start] = start_date - self.date_from coords[:start] = start_date - self.date_from
coords[:bar_start] = start_date - self.date_from coords[:bar_start] = start_date - self.date_from
else else
coords[:bar_start] = 0 coords[:bar_start] = 0
end end
if end_date < self.date_to if end_date < self.date_to
coords[:end] = end_date - self.date_from coords[:end] = end_date - self.date_from + 1
coords[:bar_end] = end_date - self.date_from + 1 coords[:bar_end] = end_date - self.date_from + 1
else else
coords[:bar_end] = self.date_to - self.date_from + 1 coords[:bar_end] = self.date_to - self.date_from + 1
end end
if progress if progress
progress_date = calc_progress_date(start_date, end_date, progress) progress_date = calc_progress_date(start_date, end_date, progress)
if progress_date > self.date_from && progress_date > start_date if progress_date > self.date_from && progress_date > start_date
if progress_date < self.date_to if progress_date < self.date_to
coords[:bar_progress_end] = progress_date - self.date_from coords[:bar_progress_end] = progress_date - self.date_from
else else
skipping to change at line 900 skipping to change at line 900
style << "left:#{coords[:start]}px;" style << "left:#{coords[:start]}px;"
style << "width:15px;" style << "width:15px;"
output << view.content_tag(:div, '&nbsp;'.html_safe, output << view.content_tag(:div, '&nbsp;'.html_safe,
:style => style, :style => style,
:class => "#{css} marker starting", :class => "#{css} marker starting",
:data => data_options) :data => data_options)
end end
if coords[:end] if coords[:end]
style = +"" style = +""
style << "top:#{params[:top]}px;" style << "top:#{params[:top]}px;"
style << "left:#{coords[:end] + params[:zoom]}px;" style << "left:#{coords[:end]}px;"
style << "width:15px;" style << "width:15px;"
output << view.content_tag(:div, '&nbsp;'.html_safe, output << view.content_tag(:div, '&nbsp;'.html_safe,
:style => style, :style => style,
:class => "#{css} marker ending", :class => "#{css} marker ending",
:data => data_options) :data => data_options)
end end
end end
# Renders the label on the right # Renders the label on the right
if label if label
style = +"" style = +""
skipping to change at line 948 skipping to change at line 948
end end
def pdf_task(params, coords, markers, label, object) def pdf_task(params, coords, markers, label, object)
cell_height_ratio = params[:pdf].get_cell_height_ratio() cell_height_ratio = params[:pdf].get_cell_height_ratio()
params[:pdf].set_cell_height_ratio(0.1) params[:pdf].set_cell_height_ratio(0.1)
height = 2 height = 2
height /= 2 if markers height /= 2 if markers
# Renders the task bar, with progress and late # Renders the task bar, with progress and late
if coords[:bar_start] && coords[:bar_end] if coords[:bar_start] && coords[:bar_end]
width = [1, coords[:bar_end] - coords[:bar_start]].max
params[:pdf].SetY(params[:top] + 1.5) params[:pdf].SetY(params[:top] + 1.5)
params[:pdf].SetX(params[:subject_width] + coords[:bar_start]) params[:pdf].SetX(params[:subject_width] + coords[:bar_start])
params[:pdf].SetFillColor(200, 200, 200) params[:pdf].SetFillColor(200, 200, 200)
params[:pdf].RDMCell(coords[:bar_end] - coords[:bar_start], height, "" , 0, 0, "", 1) params[:pdf].RDMCell(width, height, "", 0, 0, "", 1)
if coords[:bar_late_end] if coords[:bar_late_end]
width = [1, coords[:bar_late_end] - coords[:bar_start]].max
params[:pdf].SetY(params[:top] + 1.5) params[:pdf].SetY(params[:top] + 1.5)
params[:pdf].SetX(params[:subject_width] + coords[:bar_start]) params[:pdf].SetX(params[:subject_width] + coords[:bar_start])
params[:pdf].SetFillColor(255, 100, 100) params[:pdf].SetFillColor(255, 100, 100)
params[:pdf].RDMCell(coords[:bar_late_end] - coords[:bar_start], hei ght, "", 0, 0, "", 1) params[:pdf].RDMCell(width, height, "", 0, 0, "", 1)
end end
if coords[:bar_progress_end] if coords[:bar_progress_end]
width = [1, coords[:bar_progress_end] - coords[:bar_start]].max
params[:pdf].SetY(params[:top] + 1.5) params[:pdf].SetY(params[:top] + 1.5)
params[:pdf].SetX(params[:subject_width] + coords[:bar_start]) params[:pdf].SetX(params[:subject_width] + coords[:bar_start])
params[:pdf].SetFillColor(90, 200, 90) params[:pdf].SetFillColor(90, 200, 90)
params[:pdf].RDMCell(coords[:bar_progress_end] - coords[:bar_start], height, "", 0, 0, "", 1) params[:pdf].RDMCell(width, height, "", 0, 0, "", 1)
end end
end end
# Renders the markers # Renders the markers
if markers if markers
if coords[:start] if coords[:start]
params[:pdf].SetY(params[:top] + 1) params[:pdf].SetY(params[:top] + 1)
params[:pdf].SetX(params[:subject_width] + coords[:start] - 1) params[:pdf].SetX(params[:subject_width] + coords[:start] - 1)
params[:pdf].SetFillColor(50, 50, 200) params[:pdf].SetFillColor(50, 50, 200)
params[:pdf].RDMCell(2, 2, "", 0, 0, "", 1) params[:pdf].RDMCell(2, 2, "", 0, 0, "", 1)
end end
skipping to change at line 1034 skipping to change at line 1037
y = params[:top] - height / 2 y = params[:top] - height / 2
params[:image].fill('blue') params[:image].fill('blue')
params[:image].draw('polygon %d,%d %d,%d %d,%d %d,%d' % [ params[:image].draw('polygon %d,%d %d,%d %d,%d %d,%d' % [
x - 4, y, x - 4, y,
x, y - 4, x, y - 4,
x + 4, y, x + 4, y,
x, y + 4 x, y + 4
]) ])
end end
if coords[:end] if coords[:end]
x = params[:subject_width] + coords[:end] + params[:zoom] x = params[:subject_width] + coords[:end]
y = params[:top] - height / 2 y = params[:top] - height / 2
params[:image].fill('blue') params[:image].fill('blue')
params[:image].draw('polygon %d,%d %d,%d %d,%d %d,%d' % [ params[:image].draw('polygon %d,%d %d,%d %d,%d %d,%d' % [
x - 4, y, x - 4, y,
x, y - 4, x, y - 4,
x + 4, y, x + 4, y,
x, y + 4 x, y + 4
]) ])
end end
end end
 End of changes. 10 change blocks. 
7 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)