Correctly update calendar UI when deleting a calendar with sub-folders and show an according message if confirm dialog (#2283)
This commit is contained in:
parent
83edac179a
commit
c891f82269
5 changed files with 22 additions and 1 deletions
|
@ -1911,7 +1911,7 @@ function rcube_calendar_ui(settings)
|
|||
|
||||
this.calendar_remove = function(calendar)
|
||||
{
|
||||
if (confirm(rcmail.gettext('deletecalendarconfirm', 'calendar'))) {
|
||||
if (confirm(rcmail.gettext(calendar.children ? 'deletecalendarconfirmrecursive' : 'deletecalendarconfirm', 'calendar'))) {
|
||||
rcmail.http_post('calendar', { action:'remove', c:{ id:calendar.id } });
|
||||
return true;
|
||||
}
|
||||
|
@ -1920,7 +1920,24 @@ function rcube_calendar_ui(settings)
|
|||
|
||||
this.calendar_destroy_source = function(id)
|
||||
{
|
||||
var delete_ids = [];
|
||||
|
||||
if (this.calendars[id]) {
|
||||
// find sub-calendars
|
||||
if (this.calendars[id].children) {
|
||||
for (var child_id in this.calendars) {
|
||||
if (String(child_id).indexOf(id) == 0)
|
||||
delete_ids.push(child_id);
|
||||
}
|
||||
}
|
||||
else {
|
||||
delete_ids.push(id);
|
||||
}
|
||||
}
|
||||
|
||||
// delete all calendars in the list
|
||||
for (var i=0; i < delete_ids.length; i++) {
|
||||
id = delete_ids[i];
|
||||
fc.fullCalendar('removeEventSource', this.calendars[id]);
|
||||
$(rcmail.get_folder_li(id, 'rcmlical')).remove();
|
||||
$('#edit-calendar option[value="'+id+'"]').remove();
|
||||
|
|
|
@ -122,6 +122,7 @@ class kolab_driver extends calendar_driver
|
|||
'default' => $cal->storage->default,
|
||||
'active' => $cal->storage->is_active(),
|
||||
'owner' => $cal->get_owner(),
|
||||
'children' => true, // TODO: determine if that folder indeed has child folders
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -167,6 +167,7 @@ $labels['tabsharing'] = 'Freigabe';
|
|||
// messages
|
||||
$labels['deleteventconfirm'] = 'Möchten Sie diesen Termin wirklich löschen?';
|
||||
$labels['deletecalendarconfirm'] = 'Möchten Sie diesen Kalender mit allen Terminen wirklich löschen?';
|
||||
$labels['deletecalendarconfirmrecursive'] = 'Möchten Sie diesen Kalender mit allen Terminen und Unter-Kalendern wirklich löschen?';
|
||||
$labels['savingdata'] = 'Speichere Daten...';
|
||||
$labels['errorsaving'] = 'Fehler beim Speichern.';
|
||||
$labels['operationfailed'] = 'Die Aktion ist fehlgeschlagen.';
|
||||
|
|
|
@ -167,6 +167,7 @@ $labels['tabsharing'] = 'Freigabe';
|
|||
// messages
|
||||
$labels['deleteventconfirm'] = 'Möchten Sie diesen Termin wirklich löschen?';
|
||||
$labels['deletecalendarconfirm'] = 'Möchten Sie diesen Kalender mit allen Terminen wirklich löschen?';
|
||||
$labels['deletecalendarconfirmrecursive'] = 'Möchten Sie diesen Kalender mit allen Terminen und Unter-Kalendern wirklich löschen?';
|
||||
$labels['savingdata'] = 'Speichere Daten...';
|
||||
$labels['errorsaving'] = 'Fehler beim Speichern.';
|
||||
$labels['operationfailed'] = 'Die Aktion ist fehlgeschlagen.';
|
||||
|
|
|
@ -172,6 +172,7 @@ $labels['tabsharing'] = 'Sharing';
|
|||
// messages
|
||||
$labels['deleteventconfirm'] = 'Do you really want to delete this event?';
|
||||
$labels['deletecalendarconfirm'] = 'Do you really want to delete this calendar with all its events?';
|
||||
$labels['deletecalendarconfirmrecursive'] = 'Do you really want to delete this calendar with all its events and sub-calendars?';
|
||||
$labels['savingdata'] = 'Saving data...';
|
||||
$labels['errorsaving'] = 'Failed to save changes.';
|
||||
$labels['operationfailed'] = 'The requested operation failed.';
|
||||
|
|
Loading…
Add table
Reference in a new issue