Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

restore pdf link for API

as-op0ffe803c8924
diff --git a/lib/api/v3/work_packages/work_package_representer.rb b/lib/api/v3/work_packages/work_package_representer.rb
index 1da7124c794..94aad57bddc 100644
--- a/lib/api/v3/work_packages/work_package_representer.rb
+++ b/lib/api/v3/work_packages/work_package_representer.rb
@@ -122,13 +122,24 @@ module API
}
end
+ link :pdf,
+ cache_if: -> { export_work_packages_allowed? } do
+ next if represented.new_record?
+
+ {
+ href: work_package_path(id: represented.id, format: :pdf),
+ type: "application/pdf",
+ title: "Export as PDF"
+ }
+ end
+
link :generate_pdf,
cache_if: -> { export_work_packages_allowed? } do
next if represented.new_record?
{
href: generate_pdf_dialog_work_package_path(id: represented.id),
- type: "application/pdf",
+ type: "text/html",
title: "Generate PDF"
}
end