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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export icalendar file on_change hook #51

Merged

Conversation

roquegv
Copy link
Contributor

@roquegv roquegv commented Jul 31, 2023

issue #50

This is how it works:
Kazam_screencast_00061

This is the generated file (the original file was compressed into .zip because GitHub does not allow .ics files):
Urlaubskalender499864.zip

Observation:

  • The export function will be triggered when there is a change in a Leave Application document, particularly when it is in a "Approved" status.
  • The File is attached to the last Leave Application in "Approved" status, which triggered the function call.
  • The generated filename is always unique, because the content's hash is suffixed to the original filename. This behavior cannot be changed using the standard frappe.utils.file_manager.save_file function. If we always need the same filename, then we should follow a different function and this may take a while to make it working appropriately.

@marcus-wiegand
Copy link
Collaborator

marcus-wiegand commented Aug 1, 2023

ical Data:

BEGIN:VCALENDAR
BEGIN:VEVENT
SUMMARY:HR-EMP-00001 - Sick Leave
DTSTART;VALUE=DATE:20230804
DTEND;VALUE=DATE:20230804
DESCRIPTION:cold
END:VEVENT
BEGIN:VEVENT
SUMMARY:HR-EMP-00001 - Sick Leave
DTSTART;VALUE=DATE:20230802
DTEND;VALUE=DATE:20230802
DESCRIPTION:cold
END:VEVENT
BEGIN:VEVENT
SUMMARY:HR-EMP-00001 - Sick Leave
DTSTART;VALUE=DATE:20230801
DTEND;VALUE=DATE:20230801
DESCRIPTION:flu
END:VEVENT
BEGIN:VEVENT
SUMMARY:HR-EMP-00001 - Sick Leave
DTSTART;VALUE=DATE:20230803
DTEND;VALUE=DATE:20230803
DESCRIPTION:fever
END:VEVENT
END:VCALENDAR

@marcus-wiegand marcus-wiegand merged commit b210bee into phamos-eu:develop Aug 1, 2023
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.

None yet

2 participants