Project

General

Profile

Feature #4050 » 0001-New-CSV-API.patch

Alexey Froloff, 2009-10-18 12:51

View differences:

app/helpers/issues_helper.rb
147 147
    ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')    
148 148
    decimal_separator = l(:general_csv_decimal_separator)
149 149
    export = StringIO.new
150
    CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
150
    CSV(export, :col_sep => l(:general_csv_separator)) do |csv|
151 151
      # csv header fields
152 152
      headers = [ "#",
153 153
                  l(:field_status), 
app/helpers/timelog_helper.rb
69 69
    decimal_separator = l(:general_csv_decimal_separator)
70 70
    custom_fields = TimeEntryCustomField.find(:all)
71 71
    export = StringIO.new
72
    CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
72
    CSV(export, :col_sep => l(:general_csv_separator)) do |csv|
73 73
      # csv header fields
74 74
      headers = [l(:field_spent_on),
75 75
                 l(:field_user),
......
112 112
  
113 113
  def report_to_csv(criterias, periods, hours)
114 114
    export = StringIO.new
115
    CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
115
    CSV(export, :col_sep => l(:general_csv_separator)) do |csv|
116 116
      # Column headers
117 117
      headers = criterias.collect {|criteria| l(@available_criterias[criteria][:label]) }
118 118
      headers += periods
(5-5/14)