owncloud/calendar — pull request #288 by ben-denham (2014-01-06 01:14:26+00:00)
Title: Added calendar-user preferences.

These changes allow a user to hide/show and change the display name and colour of a calendar that is shared with them, without affecting how the calendar is displayed to other users.

It does this by storing calendar-user preferences for each calendar a user has access to (whether it is owned by them or shared with them or a group they belong to) in a new "clndr_calendar_user_preferences" database table.

Therefore, the "cldnr_calendars.active" column has been removed, because that setting is now stored per user in "clndr_calendar_user_preferences.active". However, the "cldnr_calendars.calendarcolor" and "cldnr_calendars.displayname" have been retained to serve as default preferences for the calendar.

When a user loses access to a calendar (e.g. it is unshared with them), their preferences are retained in the database. That way, if the user regains access to a calendar that used to be shared with them, their old preferences will still be applied to the calendar.

Because retaining these unused preferences could create a lot of obsolete rows in the database, a new button has also been added in the calendar settings for administrators to "Delete unused calendar preferences", which will delete any preferences where the user no longer has access to the calendar.

This fixes https://github.com/owncloud/calendar/issues/21 and https://github.com/owncloud/calendar/issues/131, and was mentioned in https://github.com/owncloud/calendar/pull/265#issuecomment-31618521.