From 8eeafcdd5ec0690cb8ce15addc3ec16721b1874e Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Wed, 15 Apr 2020 14:24:04 +0000 Subject: [PATCH] Merged r19702 and r19703 from trunk to 4.1-stable (#33273). git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19704 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/queries_helper.rb | 4 ++-- test/functional/issues_controller_test.rb | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index 991ef93c8..a4e474990 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -167,7 +167,7 @@ module QueriesHelper def total_tag(column, value) label = content_tag('span', "#{column.caption}:") value = - if [:hours, :spent_hours, :total_spent_hours, :estimated_hours].include? column.name + if [:hours, :spent_hours, :total_spent_hours, :estimated_hours, :total_estimated_hours].include? column.name format_hours(value) else format_object(value) @@ -238,7 +238,7 @@ module QueriesHelper 'span', value.to_s(item) {|other| link_to_issue(other, :subject => false, :tracker => false)}.html_safe, :class => value.css_classes_for(item)) - when :hours, :estimated_hours + when :hours, :estimated_hours, :total_estimated_hours format_hours(value) when :spent_hours link_to_if(value > 0, format_hours(value), project_time_entries_path(item.project, :issue_id => "#{item.id}")) diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index dee8060ec..c6adfbc10 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -1720,6 +1720,22 @@ class IssuesControllerTest < Redmine::ControllerTest end end + def test_index_should_respect_timespan_format + with_settings :timespan_format => 'minutes' do + get( + :index, + :params => { + :set_filter => 1, + :c => %w(estimated_hours total_estimated_hours spent_hours total_spent_hours) + } + ) + assert_select 'table.issues tr#issue-1 td.estimated_hours', :text => '200:00' + assert_select 'table.issues tr#issue-1 td.total_estimated_hours', :text => '200:00' + assert_select 'table.issues tr#issue-1 td.spent_hours', :text => '154:15' + assert_select 'table.issues tr#issue-1 td.total_spent_hours', :text => '154:15' + end + end + def test_show_by_anonymous get :show, :params => { :id => 1 -- 2.39.5