Fix so only editable calendars can be set as the default calendar
This commit is contained in:
parent
6fabd5a00e
commit
8f7f68e9c4
2 changed files with 6 additions and 5 deletions
|
@ -530,9 +530,10 @@ class calendar extends rcube_plugin
|
|||
return $p;
|
||||
}
|
||||
// default calendar selection
|
||||
$field_id = 'rcmfd_default_calendar';
|
||||
$field_id = 'rcmfd_default_calendar';
|
||||
$filter = calendar_driver::FILTER_PERSONAL | calendar_driver::FILTER_ACTIVE | calendar_driver::FILTER_INSERTABLE;
|
||||
$select_cal = new html_select(array('name' => '_default_calendar', 'id' => $field_id, 'is_escaped' => true));
|
||||
foreach ((array)$this->driver->list_calendars(calendar_driver::FILTER_PERSONAL | calendar_driver::FILTER_ACTIVE) as $id => $prop) {
|
||||
foreach ((array)$this->driver->list_calendars($filter) as $id => $prop) {
|
||||
$select_cal->add($prop['name'], strval($id));
|
||||
if ($prop['default'])
|
||||
$default_calendar = $id;
|
||||
|
|
|
@ -221,7 +221,7 @@ class kolab_driver extends calendar_driver
|
|||
}
|
||||
|
||||
// list virtual calendars showing invitations
|
||||
if ($this->rc->config->get('kolab_invitation_calendars')) {
|
||||
if ($this->rc->config->get('kolab_invitation_calendars') && !($filter & self::FILTER_INSERTABLE)) {
|
||||
foreach (array(self::INVITATIONS_CALENDAR_PENDING, self::INVITATIONS_CALENDAR_DECLINED) as $id) {
|
||||
$cal = new kolab_invitation_calendar($id, $this->cal);
|
||||
$this->calendars[$cal->id] = $cal;
|
||||
|
@ -256,7 +256,7 @@ class kolab_driver extends calendar_driver
|
|||
}
|
||||
|
||||
// append the virtual birthdays calendar
|
||||
if ($this->rc->config->get('calendar_contact_birthdays', false)) {
|
||||
if ($this->rc->config->get('calendar_contact_birthdays', false) && !($filter & self::FILTER_INSERTABLE)) {
|
||||
$id = self::BIRTHDAY_CALENDAR_ID;
|
||||
$prefs = $this->rc->config->get('kolab_calendars', array()); // read local prefs
|
||||
if (!($filter & self::FILTER_ACTIVE) || $prefs[$id]['active']) {
|
||||
|
@ -312,7 +312,7 @@ class kolab_driver extends calendar_driver
|
|||
if (($filter & self::FILTER_WRITEABLE) && !$cal->editable) {
|
||||
continue;
|
||||
}
|
||||
if (($filter & self::FILTER_INSERTABLE) && !$cal->insert) {
|
||||
if (($filter & self::FILTER_INSERTABLE) && !$cal->editable) {
|
||||
continue;
|
||||
}
|
||||
if (($filter & self::FILTER_ACTIVE) && !$cal->is_active()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue