diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-07-08 07:20:01 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-07-08 07:20:01 +0000 |
commit | d2cc2f9dca3c0877e433f95162300ba02e869377 (patch) | |
tree | 9b18df4d316b5dbbe1c3b678778e1dc250ae6166 | |
parent | e1ff7c18481cd730e461026c31801a7d7f2039ac (diff) | |
download | redmine-d2cc2f9dca3c0877e433f95162300ba02e869377.tar.gz redmine-d2cc2f9dca3c0877e433f95162300ba02e869377.zip |
Fixed that issue counts are 0 on project overview (#26376).
git-svn-id: http://svn.redmine.org/redmine/trunk@16766 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/projects_controller.rb | 3 | ||||
-rw-r--r-- | app/views/projects/show.html.erb | 2 | ||||
-rw-r--r-- | test/functional/projects_controller_test.rb | 10 |
3 files changed, 13 insertions, 2 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 3e3fc69f3..bded5f251 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -147,7 +147,6 @@ class ProjectsController < ApplicationController end @users_by_role = @project.users_by_role - @subprojects = @project.children.visible.to_a @news = @project.news.limit(5).includes(:author, :project).reorder("#{News.table_name}.created_on DESC").to_a @trackers = @project.rolled_up_trackers.visible @@ -160,6 +159,8 @@ class ProjectsController < ApplicationController @total_hours = TimeEntry.visible.where(cond).sum(:hours).to_f end + @subprojects = @project.children.visible.to_a + @key = User.current.rss_key respond_to do |format| diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 7de31023c..2368a29c4 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -59,7 +59,7 @@ <td> <%= link_to (@total_issues_by_tracker[tracker].to_i - @open_issues_by_tracker[tracker].to_i), project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id, :status_id => 'c') %> </td> - <td> + <td class="total"> <%= link_to @total_issues_by_tracker[tracker].to_i, project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id, :status_id => '*') %> </td> </tr> diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index b0feee827..f34627e5b 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -543,6 +543,16 @@ class ProjectsControllerTest < Redmine::ControllerTest assert_select 'a', :text => /Private child/ end + def test_show_by_member_on_leaf_project_should_display_issue_counts + @request.session[:user_id] = 2 + get :show, :params => { + :id => 'onlinestore' + } + assert_response :success + # Make sure there's a > 0 issue count + assert_select 'table.issue-report td.total a', :text => %r{\A[1-9]\d*\z} + end + def test_settings @request.session[:user_id] = 2 # manager get :settings, :params => { |