From e675eaedab189b31b4aac0e83732f24ed954b69b Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 6 Dec 2019 00:24:41 +0000 Subject: [PATCH] Fix that spent time report CSV shows translation missing text if custom fields are involved (#32500). Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@19341 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/timelog_helper.rb | 2 +- test/functional/timelog_report_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb index 019b441a0..2c3e500a5 100644 --- a/app/helpers/timelog_helper.rb +++ b/app/helpers/timelog_helper.rb @@ -79,7 +79,7 @@ module TimelogHelper def report_to_csv(report) Redmine::Export::CSV.generate(:encoding => params[:encoding]) do |csv| # Column headers - headers = report.criteria.collect {|criteria| l(report.available_criteria[criteria][:label]) } + headers = report.criteria.collect {|criteria| l_or_humanize(report.available_criteria[criteria][:label]) } headers += report.periods headers << l(:label_total_time) csv << headers diff --git a/test/functional/timelog_report_test.rb b/test/functional/timelog_report_test.rb index a643522d3..842307050 100644 --- a/test/functional/timelog_report_test.rb +++ b/test/functional/timelog_report_test.rb @@ -247,14 +247,14 @@ class TimelogReportTest < Redmine::ControllerTest :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", - :criteria => ["project", "user", "activity"], + :criteria => ["project", "user", "cf_10"], :format => "csv" } assert_response :success assert_equal 'text/csv', @response.content_type lines = @response.body.chomp.split("\n") # Headers - assert_equal 'Project,User,Activity,2007-3,2007-4,Total time', lines.first + assert_equal 'Project,User,Overtime,2007-3,2007-4,Total time', lines.first # Total row assert_equal 'Total time,"","",154.25,8.65,162.90', lines.last end -- 2.39.5