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(),
|
'active' => $folder->is_active(),
|
||||||
'parentfolder' => $path_imap,
|
'parentfolder' => $path_imap,
|
||||||
'default' => $folder->default,
|
'default' => $folder->default,
|
||||||
|
'children' => true, // TODO: determine if that folder indeed has child folders
|
||||||
'class_name' => trim($folder->get_namespace() . ($folder->default ? ' default' : '')),
|
'class_name' => trim($folder->get_namespace() . ($folder->default ? ' default' : '')),
|
||||||
);
|
);
|
||||||
$this->lists[$tasklist['id']] = $tasklist;
|
$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['deletetasktconfirm'] = 'Möchten Sie diese Aufgabe wirklich löschen?';
|
||||||
$labels['deleteparenttasktconfirm'] = 'Möchten Sie diese Aufgabe inklusive aller Teilaufgaben 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['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['deletetasktconfirm'] = 'Möchten Sie diese Aufgabe wirklich löschen?';
|
||||||
$labels['deleteparenttasktconfirm'] = 'Möchten Sie diese Aufgabe inklusive aller Teilaufgaben 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['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['deletetasktconfirm'] = 'Do you really want to delete this task?';
|
||||||
$labels['deleteparenttasktconfirm'] = 'Do you really want to delete this task and all its subtasks?';
|
$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['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)
|
function list_remove(id)
|
||||||
{
|
{
|
||||||
var list = me.tasklists[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');
|
saving_lock = rcmail.set_busy(true, 'tasklist.savingdata');
|
||||||
rcmail.http_post('tasklist', { action:'remove', l:{ id:list.id } });
|
rcmail.http_post('tasklist', { action:'remove', l:{ id:list.id } });
|
||||||
return true;
|
return true;
|
||||||
|
@ -1480,17 +1480,35 @@ function rcube_tasklist_ui(settings)
|
||||||
*/
|
*/
|
||||||
function destroy_list(prop)
|
function destroy_list(prop)
|
||||||
{
|
{
|
||||||
var list = me.tasklists[prop.id],
|
var li, delete_ids = [],
|
||||||
li = rcmail.get_folder_li(prop.id, 'rcmlitasklist');
|
list = me.tasklists[prop.id];
|
||||||
|
|
||||||
if (li) {
|
// find sub-lists
|
||||||
$(li).remove();
|
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) {
|
else {
|
||||||
list.active = false;
|
delete_ids.push(prop.id);
|
||||||
// delete me.tasklists[prop.id];
|
}
|
||||||
unlock_saving();
|
|
||||||
remove_tasks(list.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