Fix deletion of task lists with sub-folders (similar as in bug #2283)
This commit is contained in:
parent
9520dddc4c
commit
803510b4f1
5 changed files with 32 additions and 10 deletions
|
@ -118,6 +118,7 @@ class tasklist_kolab_driver extends tasklist_driver
|
|||
'active' => $folder->is_active(),
|
||||
'parentfolder' => $path_imap,
|
||||
'default' => $folder->default,
|
||||
'children' => true, // TODO: determine if that folder indeed has child folders
|
||||
'class_name' => trim($folder->get_namespace() . ($folder->default ? ' default' : '')),
|
||||
);
|
||||
$this->lists[$tasklist['id']] = $tasklist;
|
||||
|
|
|
@ -67,3 +67,4 @@ $labels['invalidstartduedates'] = 'Beginn der Aufgabe darf nicht grösser als da
|
|||
$labels['deletetasktconfirm'] = 'Möchten Sie diese Aufgabe wirklich löschen?';
|
||||
$labels['deleteparenttasktconfirm'] = 'Möchten Sie diese Aufgabe inklusive aller Teilaufgaben wirklich löschen?';
|
||||
$labels['deletelistconfirm'] = 'Möchten Sie diese Liste mit allen Aufgaben wirklich löschen?';
|
||||
$labels['deletelistconfirmrecursive'] = 'Möchten Sie diese Liste mit allen Aufgaben und Unter-Listen wirklich löschen?';
|
||||
|
|
|
@ -67,3 +67,4 @@ $labels['invalidstartduedates'] = 'Beginn der Aufgabe darf nicht größer als da
|
|||
$labels['deletetasktconfirm'] = 'Möchten Sie diese Aufgabe wirklich löschen?';
|
||||
$labels['deleteparenttasktconfirm'] = 'Möchten Sie diese Aufgabe inklusive aller Teilaufgaben wirklich löschen?';
|
||||
$labels['deletelistconfirm'] = 'Möchten Sie diese Liste mit allen Aufgaben wirklich löschen?';
|
||||
$labels['deletelistconfirmrecursive'] = 'Möchten Sie diese Liste mit allen Aufgaben und Unter-Listen wirklich löschen?';
|
|
@ -66,3 +66,4 @@ $labels['invalidstartduedates'] = 'Start date must not be greater than due date.
|
|||
$labels['deletetasktconfirm'] = 'Do you really want to delete this task?';
|
||||
$labels['deleteparenttasktconfirm'] = 'Do you really want to delete this task and all its subtasks?';
|
||||
$labels['deletelistconfirm'] = 'Do you really want to delete this list with all its tasks?';
|
||||
$labels['deletelistconfirmrecursive'] = 'Do you really want to delete this list with all its sub-lists and tasks?';
|
||||
|
|
|
@ -1467,7 +1467,7 @@ function rcube_tasklist_ui(settings)
|
|||
function list_remove(id)
|
||||
{
|
||||
var list = me.tasklists[id];
|
||||
if (list && list.editable && confirm(rcmail.gettext('deletelistconfirm', 'tasklist'))) {
|
||||
if (list && list.editable && confirm(rcmail.gettext(list.children ? 'deletelistconfirmrecursive' : 'deletelistconfirm', 'tasklist'))) {
|
||||
saving_lock = rcmail.set_busy(true, 'tasklist.savingdata');
|
||||
rcmail.http_post('tasklist', { action:'remove', l:{ id:list.id } });
|
||||
return true;
|
||||
|
@ -1480,17 +1480,35 @@ function rcube_tasklist_ui(settings)
|
|||
*/
|
||||
function destroy_list(prop)
|
||||
{
|
||||
var list = me.tasklists[prop.id],
|
||||
li = rcmail.get_folder_li(prop.id, 'rcmlitasklist');
|
||||
var li, delete_ids = [],
|
||||
list = me.tasklists[prop.id];
|
||||
|
||||
if (li) {
|
||||
$(li).remove();
|
||||
// find sub-lists
|
||||
if (list && list.children) {
|
||||
for (var child_id in me.tasklists) {
|
||||
if (String(child_id).indexOf(prop.id) == 0)
|
||||
delete_ids.push(child_id);
|
||||
}
|
||||
}
|
||||
if (list) {
|
||||
list.active = false;
|
||||
// delete me.tasklists[prop.id];
|
||||
unlock_saving();
|
||||
remove_tasks(list.id);
|
||||
else {
|
||||
delete_ids.push(prop.id);
|
||||
}
|
||||
|
||||
// delete all calendars in the list
|
||||
for (var i=0; i < delete_ids.length; i++) {
|
||||
id = delete_ids[i];
|
||||
list = me.tasklists[id];
|
||||
li = rcmail.get_folder_li(id, 'rcmlitasklist');
|
||||
|
||||
if (li) {
|
||||
$(li).remove();
|
||||
}
|
||||
if (list) {
|
||||
list.active = false;
|
||||
// delete me.tasklists[prop.id];
|
||||
unlock_saving();
|
||||
remove_tasks(list.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue