Merge pull request #18 from finnlabs/fix/id_column

Fix id column
pull/6827/head
jonasheinrich 10 years ago
commit 7ae806f248
  1. 4
      lib/open_project/xls_export/patches/work_packages_controller_patch.rb

@ -39,7 +39,7 @@ module OpenProject::XlsExport
sb = SpreadsheetBuilder.new("#{I18n.t(:label_work_package_plural)}") sb = SpreadsheetBuilder.new("#{I18n.t(:label_work_package_plural)}")
formatters = OpenProject::XlsExport::Formatters.for_columns(columns) formatters = OpenProject::XlsExport::Formatters.for_columns(columns)
headers = columns.collect(&:caption).unshift("#") headers = columns.collect(&:caption)
headers << WorkPackage.human_attribute_name(:description) if options[:show_descriptions] headers << WorkPackage.human_attribute_name(:description) if options[:show_descriptions]
sb.add_headers headers, 0 sb.add_headers headers, 0
@ -48,7 +48,7 @@ module OpenProject::XlsExport
cv = formatters[column].format work_package, column cv = formatters[column].format work_package, column
cv = cv.in_time_zone(current_user.time_zone) if cv.is_a?(ActiveSupport::TimeWithZone) cv = cv.in_time_zone(current_user.time_zone) if cv.is_a?(ActiveSupport::TimeWithZone)
(cv.respond_to? :name) ? cv.name : cv (cv.respond_to? :name) ? cv.name : cv
end).unshift(work_package.id) end)
row << work_package.description if options[:show_descriptions] row << work_package.description if options[:show_descriptions]
sb.add_row(row) sb.add_row(row)
end end

Loading…
Cancel
Save