summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-09-26 11:46:24 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-09-26 11:49:56 (GMT)
commit90244f22bbbde9650b11f08efd52b461c787b19f (patch)
tree0fdd3a322a5d83e72674a1df28ffc9bb9aa6f3b6
parent4eb95ceb999148af61a017203bf1d38457243549 (diff)
downloadroundcubemail-plugins-kolab-90244f22bbbde9650b11f08efd52b461c787b19f.tar.gz
Correctly update calendar UI when deleting a calendar with sub-folders and show an according message if confirm dialog (#2283)
-rw-r--r--plugins/calendar/calendar_ui.js19
-rw-r--r--plugins/calendar/drivers/kolab/kolab_driver.php1
-rw-r--r--plugins/calendar/localization/de_CH.inc1
-rw-r--r--plugins/calendar/localization/de_DE.inc1
-rw-r--r--plugins/calendar/localization/en_US.inc1
5 files changed, 22 insertions, 1 deletions
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index 68ff6c9..a73cba5 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -1896,7 +1896,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;
}
@@ -1905,7 +1905,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();
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 19214b9..fe86b68 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -129,6 +129,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
);
}
diff --git a/plugins/calendar/localization/de_CH.inc b/plugins/calendar/localization/de_CH.inc
index d8364bc..5dd69db 100644
--- a/plugins/calendar/localization/de_CH.inc
+++ b/plugins/calendar/localization/de_CH.inc
@@ -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.';
diff --git a/plugins/calendar/localization/de_DE.inc b/plugins/calendar/localization/de_DE.inc
index b8623c7..c393d37 100644
--- a/plugins/calendar/localization/de_DE.inc
+++ b/plugins/calendar/localization/de_DE.inc
@@ -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.';
diff --git a/plugins/calendar/localization/en_US.inc b/plugins/calendar/localization/en_US.inc
index aa598be..71b5217 100644
--- a/plugins/calendar/localization/en_US.inc
+++ b/plugins/calendar/localization/en_US.inc
@@ -167,6 +167,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.';