Merge pull request #4711 from opf/feature/disable_export_formats

only define core export formats in core
pull/4713/head
Oliver Günther 8 years ago committed by GitHub
commit 57eaa5d0cf
  1. 21
      app/controllers/api/experimental/work_packages_controller.rb

@ -83,18 +83,15 @@ module Api
end
def export_formats
export_formats = [{ identifier: 'atom', format: 'atom', label_locale: 'label_format_atom' },
{ identifier: 'pdf', format: 'pdf', label_locale: 'label_format_pdf' },
{ identifier: 'pdf-descr', format: 'pdf', label_locale: 'label_format_pdf_with_descriptions', flags: ['show_descriptions'] },
{ identifier: 'csv', format: 'csv', label_locale: 'label_format_csv' }]
# TODO: This does not belong here and should be replaced by a hook that
# aggregates possible formats from the plug-ins.
if Redmine::Plugin.all.sort.map(&:id).include?(:openproject_xls_export)
export_formats.push(identifier: 'xls', format: 'xls', label_locale: 'label_format_xls')
export_formats.push(identifier: 'xls-descr', format: 'xls', label_locale: 'label_format_xls_with_descriptions', flags: ['show_descriptions'])
export_formats.push(identifier: 'xls', format: 'xls', label_locale: 'label_format_xls_with_relations', flags: ['show_relations'])
end
export_formats
[
{ identifier: 'atom', format: 'atom', label_locale: 'label_format_atom' },
{ identifier: 'pdf', format: 'pdf', label_locale: 'label_format_pdf' },
{
identifier: 'pdf-descr', format: 'pdf',
label_locale: 'label_format_pdf_with_descriptions', flags: ['show_descriptions']
},
{ identifier: 'csv', format: 'csv', label_locale: 'label_format_csv' }
]
end
end
end

Loading…
Cancel
Save