这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@JohnXLivingston
Copy link
Contributor

This plugin can be used to customize exports (especially icalendar exports).
This commit includes some basic features, more could be added later.

Current features:

  • Possibility to change the ical Classification for each events.
  • Possibility to add some custom lines in ical events.

@JohnXLivingston
Copy link
Contributor Author

Hello,

A little bit more context to this PR: it is related to this one: #467
In our project, we implemented some "private" or "public" events, using an additional field.
With the previous PR, we tweaked the display, to show a lock icon on private events.

With this PR, we can change the "CLASS" attribute in ical events, to set it to "PUBLIC" or "PRIVATE", using a custom plugin.

@JohnXLivingston JohnXLivingston marked this pull request as draft June 4, 2025 10:07
@JohnXLivingston
Copy link
Contributor Author

Oops, there are some missing files, because of the gitignore. I will fix this PR later today.

@JohnXLivingston JohnXLivingston marked this pull request as ready for review June 4, 2025 13:29
@JohnXLivingston
Copy link
Contributor Author

Oops, there are some missing files, because of the gitignore. I will fix this PR later today.

Fixed! Ready for comments, or for merge :)

@JohnVillalovos JohnVillalovos force-pushed the feature_export_plugin branch 2 times, most recently from be26c48 to 4793e38 Compare June 7, 2025 04:23
@JohnVillalovos
Copy link
Contributor

Thanks @JohnXLivingston Can you fix the issues that the CI is flagging. Has to do with the commit messages.

Please see: https://github.com/LibreBooking/app/blob/develop/CONTRIBUTING.md#commit-message-guidelines for more information. Please let me know if you have any questions.

@JohnVillalovos JohnVillalovos requested a review from Copilot June 7, 2025 04:24

This comment was marked as outdated.

@JohnXLivingston JohnXLivingston force-pushed the feature_export_plugin branch from 4793e38 to ec83f2c Compare June 9, 2025 08:42
@JohnXLivingston
Copy link
Contributor Author

Thanks @JohnXLivingston Can you fix the issues that the CI is flagging. Has to do with the commit messages.

Please see: https://github.com/LibreBooking/app/blob/develop/CONTRIBUTING.md#commit-message-guidelines for more information. Please let me know if you have any questions.

Done!

@JohnVillalovos JohnVillalovos requested a review from Copilot June 9, 2025 14:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Introduce a new Export plugin to customize iCalendar exports with per-event classification and extra lines.

  • Define IExportFactory and default ExportFactory, plus a sample plugin.
  • Update PluginManager, reservation view, and template to apply export plugin outputs.
  • Extend configuration, presenter, page, and tests for export plugin selection.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tpl/Export/ical.tpl Use {$reservation->Classification} and inject optional extra lines
lib/Application/Export/ExportFactory.php Add IExportFactory interface and default ExportFactory
lib/Application/Schedule/iCalendarReservationView.php Load export plugin, set Classification and ExtraIcalLines
lib/Common/PluginManager.php Add LoadExport() method to load export plugins
lib/Config/ConfigKeys.php Introduce PLUGIN_EXPORT constant
lib/Application/Export/namespace.php Require the export factory namespace file
plugins/Export/ExportExample/ExportExample.php Provide a basic export plugin example
config/config.dist.php & config/config.devel.php Add Export entry under plugin settings
Presenters/Admin/ManageConfigurationPresenter.php Hook SetExportPluginValues($plugins['Export'])
Pages/Admin/ManageConfigurationPage.php Declare and implement SetExportPluginValues
tests/Presenters/Admin/ManageConfigurationPresenterTest.php Add stub for SetExportPluginValues
Comments suppressed due to low confidence (3)

lib/Application/Export/ExportFactory.php:13

  • Correct the spelling of "Optionnaly" to "Optionally" in the doc comment.
*     Optionnaly returns some lines to add to the iCalendar event.

lib/Application/Export/ExportFactory.php:33

  • Correct the spelling of "Optionnaly" to "Optionally" in the doc comment.
*     Optionnaly returns some lines to add to the iCalendar event.

tests/Presenters/Admin/ManageConfigurationPresenterTest.php:328

  • Implement this test stub with assertions to verify that SetExportPluginValues correctly passes export plugin values to the page.
public function SetExportPluginValues($values)

@JohnVillalovos
Copy link
Contributor

@JohnXLivingston Thanks for the PR. I left some comments and questions.

@JohnVillalovos
Copy link
Contributor

Also could the git commit message subject say it is for Calendar Export. Which it appears to be for me. Unless I am mistaken.

@JohnXLivingston JohnXLivingston force-pushed the feature_export_plugin branch from ec83f2c to 2fc1e76 Compare June 9, 2025 15:08
This plugin is used to customize exports (for now icalendar exports).
For now, only some basic features are implemented, more could be
added later.

Current features:
* Possibility to change the ical Classification for each events.
* Possibility to add some custom lines in ical events.
@JohnXLivingston JohnXLivingston force-pushed the feature_export_plugin branch from 2fc1e76 to 835a123 Compare June 9, 2025 15:09
Copy link
Contributor

@JohnVillalovos JohnVillalovos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Thanks @JohnXLivingston

@JohnVillalovos JohnVillalovos merged commit e966248 into LibreBooking:develop Jun 9, 2025
7 checks passed
@JohnXLivingston
Copy link
Contributor Author

Thank you very much for the merge !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants