Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review export lifecycle for plugin injection #702

Closed
simone-gasparini opened this issue Apr 12, 2019 · 9 comments 路 Fixed by #703
Closed

Review export lifecycle for plugin injection #702

simone-gasparini opened this issue Apr 12, 2019 · 9 comments 路 Fixed by #703

Comments

@simone-gasparini
Copy link
Contributor

Add ExportSubscriber to dispatch event for plugin based export module.
PR will follow.
Help needed 馃槃

@kevinpapst
Copy link
Member

Are you sure you need a EventSubscriber?
The service already finds automatically all tagged exporter:
https://github.com/kevinpapst/kimai2/blob/master/config/services.yaml#L71
I'd always prefer a build-time logic (custom CompilerPass if necessary) over an EventSubscriber ... if possible.

@simone-gasparini
Copy link
Contributor Author

Now the export types are hardcoded in ExportQuery.php, I've added the ability to load the export ids dynamically.

simone-gasparini added a commit to DualBit/kimai2 that referenced this issue Apr 12, 2019
@simone-gasparini
Copy link
Contributor Author

With this commits I've created a fully functional export plugin.

@kevinpapst
Copy link
Member

Nice job! Which format do you export?

@simone-gasparini
Copy link
Contributor Author

It's another html export but in a custom format for an our customer

@kevinpapst
Copy link
Member

I wonder if we should rework the export to allow templates (like invoice) instead of doing it this way. Might be a more common request.

@simone-gasparini
Copy link
Contributor Author

I don鈥檛 think that the export can be done by template only. In my case I have done all the timesheet elaboration in php and it鈥檚 not possible to do that in template/javascript. Plugin integration is essential, templating can be a secondary solution, because if you have to elaborate timesheet data or add something like translation, with template only way it can鈥檛 be done.

@kevinpapst
Copy link
Member

Long term plan for the export: there should be some options (probably shown in a modal after clicking one of the buttons) that will change how/which data is passed to the renderer... but this can probably never satisfy everyone.

But good argument why a template won't work in this case.

@lock
Copy link

lock bot commented Jun 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.

@lock lock bot locked and limited conversation to collaborators Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants