initially this checkbox will be unchecked and the "Available Moodle Calendars" section will be hidden
when user enables the checkbox and saves changes, we should create a calendar in Office (if it doesn't exist already) and name it after the site name (e.g. "Contoso University"). This calendar will be used for all moodle events.
Also, on save changes, we should display the "Available Moodle Calendars" section as it does today and in the "Sync with" dropdown, the newly created Moodle calendar should be selected by default
rename "Sync with" to "Name of Outlook calendar to sync with"
if user disables the checkbox and saves changes, do not delete the calendar we have created. Hide the Available Moodle calendar section.
For every new event in Moodle:
For course events, prefix the event with the Course Name e.g. “Quantum Mechanics: quiz 1"
For global events, prefix with moodle site name e.g. "Contoso University: Convocation"
For personal event, prefix with "Personal:" e.g. "Personal: Coffee break"
For events where we create meeting requests in Office, add people to the event BUT set request responses for the meeting request as “no”. So the meeting appears as accepted already.
Go to calendar sync settings page. The "enable calendar sync" checkbox should be off and no settings should be visible below that.
Enable checkbox and save changes.
This should create a calendar in Office with the same name as the moodle site name.
The sync settings below the checkbox should now be visible like before. The newly created calendar should be the default calendar to sync with.
When calendar sync runs, if enable calendar settings is on, then events will get synced. Otherwise not.
For each site event, the name of the event will be prefixed with the site name.
For each course event, prefix is the name of the course.
For each personal event, the prefix is "personal".
For course events, we create meeting request in Office. For those, the "response requested" should be false so students aren't required to accept the meeting request. The event gets automatically added to their calendars.
the event body should contain a link back to the moodle event.
if the name of the Moodle site changes, the name of the calendar in Office should also change during the sync process.
If the user disables calendar sync, we don't delete the Office calendar and don't delete the individual calendar sync records (for personal / site / course etc.) in Moodle so if they enable sync again, those settings will remain and everything works same as before.
Rest of the sync functionality should work the same way as before.
Upgrade:
when upgrading from previous version of plugin, if the user had enabled calendar sync for any courses or site or personal calendar at all, then we set the "enable calendar settings" to enabled and create a calendar in Office, but don't change the calendar that the user is syncing with. Otherwise the "enable calendar sync" setting remains off.
In the Outlook Calendar Sync settings page:
For every new event in Moodle: