Project

General

Profile

Defect #25828 » redmine_project_overview_workaround.patch

workaround for project overview and tracker totals - Leo Antunes, 2017-05-16 17:30

View differences:

redmine/app/controllers/projects_controller.rb 2017-05-16 17:25:19.880653954 +0200
137 137
    @users_by_role = @project.users_by_role
138 138
    @subprojects = @project.children.visible.to_a
139 139
    @news = @project.news.limit(5).includes(:author, :project).reorder("#{News.table_name}.created_on DESC").to_a
140
    @trackers = @project.rolled_up_trackers.visible
140
    @trackers = @project.rolled_up_trackers
141 141
    cond = @project.project_condition(Setting.display_subprojects_issues?)
142
    @open_issues_by_tracker = Issue.visible.open.where(cond).group(:tracker).count
143
    @total_issues_by_tracker = Issue.visible.where(cond).group(:tracker).count
142
    @open_issues_by_tracker = Issue.joins(:project).open.where(cond).group(:tracker).count
143
    @total_issues_by_tracker = Issue.joins(:project).where(cond).group(:tracker).count
144 144
    if User.current.allowed_to_view_all_time_entries?(@project)
145 145
      @total_hours = TimeEntry.visible.where(cond).sum(:hours).to_f
(1-1/2)