Defect #7352 » gantt.rb.patch
| lib/redmine/helpers/gantt.rb (working copy) | ||
|---|---|---|
|
common_params.merge({:year => (date_from >> months).year, :month => (date_from >> months).month, :zoom => zoom, :months => months })
|
||
|
end
|
||
|
### Extracted from the HTML view/helpers
|
||
|
# Returns the list of projects to render
|
||
|
def project_list
|
||
|
projects = @project ? [@project] : Project.roots.visible.has_module('issue_tracking')
|
||
|
@query && @query.has_filter?('project_id') ? projects & Project.find(@query.values_for('project_id')) : projects
|
||
|
end
|
||
|
|
||
|
### Extracted from the HTML view/helpers
|
||
|
# Returns the number of rows that will be rendered on the Gantt chart
|
||
|
def number_of_rows
|
||
|
return @number_of_rows if @number_of_rows
|
||
|
|
||
|
rows = if @project
|
||
|
number_of_rows_on_project(@project)
|
||
|
else
|
||
|
Project.roots.visible.has_module('issue_tracking').inject(0) do |total, project|
|
||
|
total += number_of_rows_on_project(project)
|
||
|
end
|
||
|
rows = project_list().each do |total, project|
|
||
|
total += number_of_rows_on_project(project)
|
||
|
end
|
||
|
|
||
|
rows > @max_rows ? @max_rows : rows
|
||
| ... | ... | |
|
@subjects = '' unless options[:only] == :lines
|
||
|
@lines = '' unless options[:only] == :subjects
|
||
|
@number_of_rows = 0
|
||
|
|
||
|
if @project
|
||
|
render_project(@project, options)
|
||
|
else
|
||
|
Project.roots.visible.has_module('issue_tracking').each do |project|
|
||
|
render_project(project, options)
|
||
|
break if abort?
|
||
|
end
|
||
|
|
||
|
project_list().each do |project|
|
||
|
render_project(project, options)
|
||
|
break if abort?
|
||
|
end
|
||
|
|
||
|
|
||
|
@subjects_rendered = true unless options[:only] == :lines
|
||
|
@lines_rendered = true unless options[:only] == :subjects
|
||
|
|
||
| ... | ... | |
|
output
|
||
|
end
|
||
|
def line_for_issue(issue, options)
|
||
|
def line_for_issue(issue, options)
|
||
|
# Skip issues that don't have a due_before (due_date or version's due_date)
|
||
|
if issue.is_a?(Issue) && issue.due_before
|
||
|
coords = coordinates(issue.start_date, issue.due_before, issue.done_ratio, options[:zoom])
|
||