Changeset View
Changeset View
Standalone View
Standalone View
plugins/calendar/calendar.php
Show First 20 Lines • Show All 782 Lines • ▼ Show 20 Lines | switch ($action) { | ||||
break; | break; | ||||
case "delete": | case "delete": | ||||
if ($success = $this->driver->delete_calendar($cal)) | if ($success = $this->driver->delete_calendar($cal)) | ||||
$this->rc->output->command('plugin.destroy_source', array('id' => $cal['id'])); | $this->rc->output->command('plugin.destroy_source', array('id' => $cal['id'])); | ||||
break; | break; | ||||
case "subscribe": | case "subscribe": | ||||
if (!$this->driver->subscribe_calendar($cal)) | if (!$this->driver->subscribe_calendar($cal)) | ||||
$this->rc->output->show_message($this->gettext('errorsaving'), 'error'); | $this->rc->output->show_message($this->gettext('errorsaving'), 'error'); | ||||
else { | |||||
$calendars = $this->driver->list_calendars(); | |||||
$calendar = $calendars[$cal['id']]; | |||||
// find parent folder and check if it's a "user calendar" | |||||
// if it's also activated we need to refresh it (#5340) | |||||
while ($calendar['parent']) { | |||||
if (isset($calendars[$calendar['parent']])) | |||||
$calendar = $calendars[$calendar['parent']]; | |||||
else | |||||
break; | |||||
} | |||||
if ($calendar['id'] != $cal['id'] && $calendar['active'] && $calendar['group'] == "other user") | |||||
$this->rc->output->command('plugin.refresh_source', $calendar['id']); | |||||
} | |||||
return; | return; | ||||
case "search": | case "search": | ||||
$results = array(); | $results = array(); | ||||
$color_mode = $this->rc->config->get('calendar_event_coloring', $this->defaults['calendar_event_coloring']); | $color_mode = $this->rc->config->get('calendar_event_coloring', $this->defaults['calendar_event_coloring']); | ||||
$query = rcube_utils::get_input_value('q', rcube_utils::INPUT_GPC); | $query = rcube_utils::get_input_value('q', rcube_utils::INPUT_GPC); | ||||
$source = rcube_utils::get_input_value('source', rcube_utils::INPUT_GPC); | $source = rcube_utils::get_input_value('source', rcube_utils::INPUT_GPC); | ||||
foreach ((array) $this->driver->search_calendars($query, $source) as $id => $prop) { | foreach ((array) $this->driver->search_calendars($query, $source) as $id => $prop) { | ||||
▲ Show 20 Lines • Show All 2,539 Lines • Show Last 20 Lines |