diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-19 20:01:00 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-19 20:01:00 +0000 |
commit | af92686c62c33d5566241d619b06b03f82ecb269 (patch) | |
tree | 0b7989ac32161c2c768d81d5f2b6df4547983c12 /app/helpers/issues_helper.rb | |
parent | 59c704dcd2a22c43a51a588ea82d85dd3d58ce87 (diff) | |
download | redmine-af92686c62c33d5566241d619b06b03f82ecb269.tar.gz redmine-af92686c62c33d5566241d619b06b03f82ecb269.zip |
Fixed that float custom fields do not use CSV decimal separator (#10364).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11441 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r-- | app/helpers/issues_helper.rb | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 7635c47ff..73ea79cb7 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -372,7 +372,6 @@ module IssuesHelper end def issues_to_csv(issues, project, query, options={}) - decimal_separator = l(:general_csv_decimal_separator) encoding = l(:general_csv_encoding) columns = (options[:columns] == 'all' ? query.available_inline_columns : query.inline_columns) if options[:description] @@ -384,28 +383,9 @@ module IssuesHelper export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv| # csv header fields csv << [ "#" ] + columns.collect {|c| Redmine::CodesetUtil.from_utf8(c.caption.to_s, encoding) } - # csv lines issues.each do |issue| - col_values = columns.collect do |column| - s = if column.is_a?(QueryCustomFieldColumn) - cv = issue.custom_field_values.detect {|v| v.custom_field_id == column.custom_field.id} - show_value(cv) - else - value = column.value(issue) - if value.is_a?(Date) - format_date(value) - elsif value.is_a?(Time) - format_time(value) - elsif value.is_a?(Float) - ("%.2f" % value).gsub('.', decimal_separator) - else - value - end - end - s.to_s - end - csv << [ issue.id.to_s ] + col_values.collect {|c| Redmine::CodesetUtil.from_utf8(c.to_s, encoding) } + csv << [ issue.id.to_s ] + columns.collect {|c| Redmine::CodesetUtil.from_utf8(csv_content(c, issue), encoding) } end end export |