implement the attributes "deletable" and "editable_name" for calendars
This commit is contained in:
parent
766088b19a
commit
3df123b0b8
2 changed files with 21 additions and 20 deletions
|
@ -2953,7 +2953,7 @@ function rcube_calendar_ui(settings)
|
|||
$dialog = $('<iframe>').attr('src', rcmail.url('calendar', params)).on('load', function() {
|
||||
var contents = $(this).contents();
|
||||
contents.find('#calendar-name')
|
||||
.prop('disabled', !calendar.editable)
|
||||
.prop('disabled', !calendar.editable && !calendar.editable_name)
|
||||
.val(calendar.editname || calendar.name)
|
||||
.select();
|
||||
contents.find('#calendar-color')
|
||||
|
@ -3607,7 +3607,7 @@ function rcube_calendar_ui(settings)
|
|||
if (node && node.id && me.calendars[node.id]) {
|
||||
me.select_calendar(node.id, true);
|
||||
rcmail.enable_command('calendar-edit', 'calendar-showurl', 'calendar-showfburl', true);
|
||||
rcmail.enable_command('calendar-delete', me.calendars[node.id].editable);
|
||||
rcmail.enable_command('calendar-delete', me.calendars[node.id].editable || me.calendars[node.id].deletable);
|
||||
rcmail.enable_command('calendar-remove', me.calendars[node.id] && me.calendars[node.id].removable);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -141,7 +141,6 @@ class caldav_driver extends calendar_driver
|
|||
|
||||
if($arr['is_ical']) {
|
||||
$this->sync_clients[$arr['id']] = new ical_sync($arr);
|
||||
$arr["readonly"] = true;
|
||||
$arr["editable"] = false;
|
||||
$arr["deletable"] = true;
|
||||
$arr["editable_name"] = true;
|
||||
|
@ -194,6 +193,7 @@ class caldav_driver extends calendar_driver
|
|||
'active' => !in_array($id, $hidden),
|
||||
'group' => 'x-birthdays',
|
||||
'editable' => false,
|
||||
'editable_name' => true,
|
||||
'default' => false,
|
||||
'children' => false,
|
||||
);
|
||||
|
@ -880,19 +880,20 @@ class caldav_driver extends calendar_driver
|
|||
}
|
||||
|
||||
// compose vcalendar-style recurrencue rule from structured data
|
||||
$rrule = $event['recurrence'] ? libcalendaring::to_rrule($event['recurrence']) : '';
|
||||
$rrule = !empty($event['recurrence']) ? libcalendaring::to_rrule($event['recurrence']) : '';
|
||||
|
||||
$sensitivity = strtolower($event['sensitivity']);
|
||||
$free_busy = strtolower($event['free_busy']);
|
||||
|
||||
$event['_recurrence'] = rtrim($rrule, ';');
|
||||
$event['free_busy'] = intval($this->free_busy_map[strtolower($event['free_busy'])]);
|
||||
$event['sensitivity'] = intval($this->sensitivity_map[strtolower($event['sensitivity'])]);
|
||||
$event['free_busy'] = isset($this->free_busy_map[$free_busy]) ? $this->free_busy_map[$free_busy] : null;
|
||||
$event['sensitivity'] = isset($this->sensitivity_map[$sensitivity]) ? $this->sensitivity_map[$sensitivity] : null;
|
||||
$event['all_day'] = !empty($event['allday']) ? 1 : 0;
|
||||
|
||||
if ($event['free_busy'] == 'tentative') {
|
||||
$event['status'] = 'TENTATIVE';
|
||||
}
|
||||
|
||||
if (isset($event['allday'])) {
|
||||
$event['all_day'] = $event['allday'] ? 1 : 0;
|
||||
}
|
||||
|
||||
// compute absolute time to notify the user
|
||||
$event['notifyat'] = $this->_get_notification($event);
|
||||
|
||||
|
|
Loading…
Reference in a new issue