diff --git a/plugins/tasklist/drivers/database/tasklist_database_driver.php b/plugins/tasklist/drivers/database/tasklist_database_driver.php index 3c5ad384..7d4c0f11 100644 --- a/plugins/tasklist/drivers/database/tasklist_database_driver.php +++ b/plugins/tasklist/drivers/database/tasklist_database_driver.php @@ -103,7 +103,7 @@ class tasklist_database_driver extends tasklist_driver * @return mixed ID of the new list on success, False on error * @see tasklist_driver::create_list() */ - public function create_list($prop) + public function create_list(&$prop) { $result = $this->rc->db->query( "INSERT INTO " . $this->db_lists . " @@ -128,7 +128,7 @@ class tasklist_database_driver extends tasklist_driver * @return boolean True on success, Fales on failure * @see tasklist_driver::edit_list() */ - public function edit_list($prop) + public function edit_list(&$prop) { $query = $this->rc->db->query( "UPDATE " . $this->db_lists . " diff --git a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php index 89de0890..b2d3d56b 100644 --- a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php +++ b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php @@ -173,7 +173,7 @@ class tasklist_kolab_driver extends tasklist_driver * showalarms: True if alarms are enabled * @return mixed ID of the new list on success, False on error */ - public function create_list($prop) + public function create_list(&$prop) { $prop['type'] = 'task' . ($prop['default'] ? '.default' : ''); $prop['active'] = true; // activate folder by default @@ -196,6 +196,10 @@ class tasklist_kolab_driver extends tasklist_driver if ($prefs['kolab_tasklists'][$id]) $this->rc->user->save_prefs($prefs); + // force page reload to properly render folder hierarchy + if (!empty($prop['parent'])) + $prop['_reload'] = true; + return $id; } @@ -209,7 +213,7 @@ class tasklist_kolab_driver extends tasklist_driver * showalarms: True if alarms are enabled (if supported) * @return boolean True on success, Fales on failure */ - public function edit_list($prop) + public function edit_list(&$prop) { if ($prop['id'] && ($folder = $this->folders[$prop['id']])) { $prop['oldname'] = $folder->name; @@ -234,6 +238,10 @@ class tasklist_kolab_driver extends tasklist_driver if ($prefs['kolab_tasklists'][$id]) $this->rc->user->save_prefs($prefs); + // force page reload if folder name/hierarchy changed + if ($newfolder != $prop['oldname']) + $prop['_reload'] = true; + return $id; } diff --git a/plugins/tasklist/drivers/tasklist_driver.php b/plugins/tasklist/drivers/tasklist_driver.php index 9e6fee82..ee5a161d 100644 --- a/plugins/tasklist/drivers/tasklist_driver.php +++ b/plugins/tasklist/drivers/tasklist_driver.php @@ -75,7 +75,7 @@ abstract class tasklist_driver * showalarms: True if alarms are enabled * @return mixed ID of the new list on success, False on error */ - abstract function create_list($prop); + abstract function create_list(&$prop); /** * Update properties of an existing tasklist @@ -87,7 +87,7 @@ abstract class tasklist_driver * showalarms: True if alarms are enabled (if supported) * @return boolean True on success, Fales on failure */ - abstract function edit_list($prop); + abstract function edit_list(&$prop); /** * Set active/subscribed state of a list diff --git a/plugins/tasklist/tasklist.js b/plugins/tasklist/tasklist.js index 9cdac3dd..c592e3d9 100644 --- a/plugins/tasklist/tasklist.js +++ b/plugins/tasklist/tasklist.js @@ -1749,6 +1749,11 @@ function rcube_tasklist_ui(settings) */ function insert_list(prop) { + if (prop._reload) { + rcmail.redirect(rcmail.url('')); + return; + } + var li = $('
  • ').attr('id', 'rcmlitasklist'+prop.id) .append('') .append(' ') @@ -1766,11 +1771,17 @@ function rcube_tasklist_ui(settings) var id = prop.oldid || prop.id, li = rcmail.get_folder_li(id, 'rcmlitasklist'); + if (prop._reload) { + rcmail.redirect(rcmail.url('')); + return; + } + if (me.tasklists[id] && li) { delete me.tasklists[id]; me.tasklists[prop.id] = prop; - $(li).data('id', prop.id); - $('#'+li.id+' input').data('id', prop.id); + $(li).data('id', prop.id) + .attr('id', 'rcmlitasklist'+prop.id) + .find('input').data('id', prop.id); $('.listname', li).html(Q(prop.name)); } }