summaryrefslogtreecommitdiffstats
path: root/lib/redmine/helpers/gantt.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-04 13:59:29 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-04 13:59:29 +0000
commit73b25dd2b444c31b4a2070b55b1b61688e6e4a16 (patch)
tree52fdae2dd58547b2cd89661d85dda38ccd5783d6 /lib/redmine/helpers/gantt.rb
parent807952bdd91ae5ac493cd97ee42179fa41f383ee (diff)
downloadredmine-73b25dd2b444c31b4a2070b55b1b61688e6e4a16.tar.gz
redmine-73b25dd2b444c31b4a2070b55b1b61688e6e4a16.zip
add empty line after guard clause to lib/redmine/helpers/gantt.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20571 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/helpers/gantt.rb')
-rw-r--r--lib/redmine/helpers/gantt.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb
index 7cefff825..0936eb782 100644
--- a/lib/redmine/helpers/gantt.rb
+++ b/lib/redmine/helpers/gantt.rb
@@ -115,6 +115,7 @@ module Redmine
# 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 = projects.inject(0) {|total, p| total += number_of_rows_on_project(p)}
rows > @max_rows ? @max_rows : rows
end
@@ -123,6 +124,7 @@ module Redmine
# the Gantt chart. This will recurse for each subproject.
def number_of_rows_on_project(project)
return 0 unless projects.include?(project)
+
count = 1
count += project_issues(project).size
count += project_versions(project).size
@@ -160,6 +162,7 @@ module Redmine
# and that should be displayed, grouped by issue ids.
def relations
return @relations if @relations
+
if issues.any?
issue_ids = issues.map(&:id)
@relations = IssueRelation.
@@ -173,6 +176,7 @@ module Redmine
# Return all the project nodes that will be displayed
def projects
return @projects if @projects
+
ids = issues.collect(&:project).uniq.collect(&:id)
if ids.any?
# All issues projects and their visible ancestors