kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
181 lines
5.8 KiB
181 lines
5.8 KiB
11 years ago
|
OpenProject PDF Export Plugin
|
||
|
===========================
|
||
11 years ago
|
|
||
11 years ago
|
This Plugin adds features which enable the configuration and generation of printable export card PDFs,
|
||
|
especially useful to export story cards from the plugin "OpenProject Backlogs":https://www.openproject.org/projects/plugin-backlogs
|
||
11 years ago
|
|
||
|
|
||
11 years ago
|
Requirements
|
||
|
------------
|
||
|
|
||
11 years ago
|
The OpenProject PDF Export plugin requires the [OpenProject Core](https://github.com/opf/openproject/) in
|
||
11 years ago
|
version greater or equal to *3.0.0*.
|
||
11 years ago
|
|
||
|
Tests for this plugin require `pdf-inspector`, so just add the following line to
|
||
10 years ago
|
OpenProject's `Gemfile.plugin` :
|
||
11 years ago
|
|
||
|
`gem "pdf-inspector", "~>1.0.0", :group => :test`
|
||
|
|
||
|
|
||
|
Installation
|
||
|
------------
|
||
|
|
||
|
For OpenProject PDF Export itself you need to add the following line to the
|
||
9 years ago
|
`Gemfile.plugins` of the project which is using the plugin (if you use a different OpenProject version than OpenProject 5, adapt `:branch => "stable/5"` to your OpenProject version):
|
||
11 years ago
|
|
||
9 years ago
|
`gem "openproject-pdf_export", git: "https://github.com/finnlabs/openproject-pdf_export.git", :branch => "stable/5"`
|
||
11 years ago
|
|
||
|
Afterwards, run:
|
||
|
|
||
|
`bundle install`
|
||
|
|
||
|
This plugin contains migrations. To migrate the database, run:
|
||
|
|
||
|
`rake db:migrate`
|
||
|
|
||
11 years ago
|
There is a seed file to load a default ExportCardConfiguration model, although this is not strictly required.
|
||
11 years ago
|
|
||
|
|
||
|
Deinstallation
|
||
|
--------------
|
||
|
|
||
|
Remove the line
|
||
|
|
||
9 years ago
|
`gem "openproject-pdf_export", git: "https://github.com/finnlabs/openproject-pdf_export.git", :branch => "stable/5"`
|
||
11 years ago
|
|
||
|
from the file `Gemfile.plugins` and run:
|
||
|
|
||
|
`bundle install`
|
||
|
|
||
|
Please not that this leaves plugin data in the database. Currently, we do not
|
||
|
support full uninstall of the plugin.
|
||
|
|
||
|
Usage
|
||
|
------------
|
||
|
|
||
11 years ago
|
The plugin provides an admin interface for ExportCardConfiguration CRUD. Existing ExportCardConfigurations can then be used to export data in PDF form, the configuration defining the layout of the card and the specific data which appears in it. The DocumentGenerator init takes a ExportCardConfiguration and an array of any object. It is left to the developer to make sure the fields in the config match the given data. A ExportCardConfiguration currently allows for the following fields to be defined:
|
||
11 years ago
|
|
||
|
Name - A unique identifier for the configuration.
|
||
11 years ago
|
Per Page - The number of export cards which will appear on each page of the exported PDF.
|
||
11 years ago
|
Page Size - Currently we only support A4 paper size.
|
||
|
Orientation - Portrait of Landscape.
|
||
11 years ago
|
Rows - A YAML text block which defines in detail what should appear in each row and column of the export cards.
|
||
11 years ago
|
|
||
|
The following sample YAML shows the required form and all of the available configuration options:
|
||
|
|
||
11 years ago
|
<pre>
|
||
11 years ago
|
group1:
|
||
|
has_border: false
|
||
11 years ago
|
height: 200
|
||
11 years ago
|
rows:
|
||
|
row1:
|
||
11 years ago
|
height: 50
|
||
11 years ago
|
priority: 1
|
||
|
columns:
|
||
|
id:
|
||
|
has_label: false
|
||
|
min_font_size: 10
|
||
|
max_font_size: 20
|
||
|
font_size: 20
|
||
|
font_style: bold
|
||
|
text_align: left
|
||
|
minimum_lines: 2
|
||
|
render_if_empty: false
|
||
|
width: 30%
|
||
|
due_date:
|
||
|
has_label: false
|
||
|
font_size: 15
|
||
|
font_style: italic
|
||
|
minimum_lines: 2
|
||
|
render_if_empty: false
|
||
|
width: 70%
|
||
|
row2:
|
||
|
priority: 2
|
||
|
columns:
|
||
|
status:
|
||
|
has_label: true
|
||
11 years ago
|
indented: true
|
||
11 years ago
|
font_size: 15
|
||
|
font_style: normal
|
||
|
minimum_lines: 1
|
||
|
render_if_empty: true
|
||
|
group2:
|
||
|
has_border: true
|
||
|
rows:
|
||
|
row1:
|
||
11 years ago
|
height: 80
|
||
11 years ago
|
priority: 2
|
||
|
columns:
|
||
|
description:
|
||
|
has_label: true
|
||
11 years ago
|
indented: false
|
||
11 years ago
|
font_size: 15
|
||
|
font_style: normal
|
||
|
minimum_lines: 1
|
||
|
render_if_empty: true
|
||
|
row2:
|
||
|
priority: 2
|
||
|
columns:
|
||
|
status:
|
||
|
has_label: true
|
||
|
font_size: 15
|
||
|
font_style: normal
|
||
|
minimum_lines: 1
|
||
|
render_if_empty: true
|
||
11 years ago
|
row2:
|
||
|
priority: 2
|
||
|
columns:
|
||
|
custom_field_name:
|
||
|
has_label: true
|
||
|
font_size: 15
|
||
|
minimum_lines: 1
|
||
11 years ago
|
group3:
|
||
|
rows:
|
||
|
row1:
|
||
|
priority: 2
|
||
|
columns:
|
||
|
children:
|
||
|
has_label: true
|
||
|
has_count: true
|
||
|
indented: true
|
||
|
font_size: 15
|
||
|
font_style: normal
|
||
|
minimum_lines: 1
|
||
|
render_if_empty: true
|
||
11 years ago
|
|
||
11 years ago
|
</pre>
|
||
11 years ago
|
The config is divided into groups. A group can have a height property which will enforce the minimum height of the group in pixels. The has_border property can be set to true which will draw a border around the rows in the group.
|
||
11 years ago
|
|
||
11 years ago
|
Any number of rows can be defined. The font_size and minimum_lines properties define how much height on the card is given to the row. The plugin will attempt to assign enough space to each of the rows, however space will be assigned based on the priorities of the the rows, with rows with lower priority (higher numbers) being reduced and removed first if there is not enough for all the data. The row height can be forced by giving a value, in pixels, for the row height property. This will override the assigned row height.
|
||
11 years ago
|
|
||
11 years ago
|
The name of the column informs the plugin which data should be read from the model (status, due_date, id, etc.). There can be any number of columns per row. Custom field names can also be used. Columns are given an equal share of the row width unless a specific width % is given. If there is more text in the column than can fit into its assinged space on the card then the text will be truncated.
|
||
11 years ago
|
|
||
11 years ago
|
Bug Reporting
|
||
|
-------------
|
||
|
|
||
|
If you find any bugs, you can create a bug ticket at
|
||
|
|
||
11 years ago
|
https://www.openproject.org/projects/pdf-export
|
||
11 years ago
|
|
||
|
|
||
|
Development
|
||
|
-----------
|
||
|
|
||
|
To contribute, you can create pull request on the official repository at
|
||
|
`https://github.com/finnlabs/openproject-pdf_export`
|
||
|
|
||
|
|
||
|
Credits
|
||
|
-------
|
||
|
|
||
11 years ago
|
We would like to thank
|
||
11 years ago
|
|
||
|
* Deutsche Telekom AG (opensource@telekom.de) for project sponsorhip
|
||
|
|
||
|
Licence
|
||
|
-------
|
||
|
|
||
11 years ago
|
Copyright (C)2014 the OpenProject Foundation (OPF)<br />
|
||
11 years ago
|
|
||
|
This plugin is licensed under the GNU GPL v3. See doc/COPYRIGHT.md and doc/GPL.txt for details.
|