This page requires java-script to be enabled. Please adjust your browser-settings.
streber
PM
Login
|
Register
Home
Recent changes
Your Tasks
Efforts
Bookmarks
Overall changes
P
rojects
for
streber commun...
streber
People
Companies
S
earch:
streber
>
Tasks
|
Topics
|
Milestones
|
Versions
|
Files
|
Changes
Help
export tables ...
> Comment
hmmm...
/
#2196
Edit
Bookmark
Delete
Although this solution would work it is not very nice:
It causes too much additional code that has to be updated.
It's works indepent to the rendering of lists (ignores sorting, filtering, etc.)
There is no preview - the result might look different
I would prefer this approach:
On pages featuring one list only (e.g. projViewTasks, companyList, projectList etc.) add an "Export as CSV" link below the table. This link would use the same url as the page with the additional parameter "format=csv"
In renderPage(), renderList(), renderBlock() etc. evaluate this format
Overwrite
ListBlock::render_list()
to check the format parameter and probably ignore the html rendering of columns and render public fields of each object in the list.
This would have following benefits:
You can use the html-interface to customize the exported list
This approach is open for other formats like RSS. XML etc.
It does not require additional code for each object type / list:
There only has to be a generic ListBlock::renderCSV() which is called by
ListBlock::renderList()
.
For all lists that overwrite
ListBlock::renderList()
(there are some) this function has to be called if appropriate. Maybe we should turn
Block::renderList()
into a wrapper function and place its old content into a new function `Block::renderListHtml()ยด
trac
illustrates a similar behavior very well.