Need to load the tasklists *after* we save the changes.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 5 Jul 2010 17:55:08 +0000 (13:55 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 5 Jul 2010 17:55:08 +0000 (13:55 -0400)
Otherwise, Kronolith::readPermsForm() will overwrite the changes to the share.
Additionally, we can get rid of the perms check here since tasks/updateTasklist will throw
a Horde_Exception_PermissionDenied exception (via Nag::updateTasklist).

kronolith/lib/Ajax/Application.php

index d965016..06350d3 100644 (file)
@@ -672,13 +672,9 @@ class Kronolith_Ajax_Application extends Horde_Ajax_Application_Base
 
             // Update a task list.
             $calendar_id = substr($calendar_id, 6);
-            $tasklists = $GLOBALS['registry']->tasks->listTasklists(true, Horde_Perms::EDIT);
-            if (!isset($tasklists[$calendar_id])) {
-                $GLOBALS['notification']->push(_("You are not allowed to change this task list."), 'horde.error');
-                return $result;
-            }
             try {
                 $GLOBALS['registry']->tasks->updateTasklist($calendar_id, $calendar);
+                $tasklists = $GLOBALS['registry']->tasks->listTasklists(true, Horde_Perms::EDIT);
                 Kronolith::readPermsForm($tasklists[$calendar_id]);
                 $result->perms = Kronolith::permissionToJson($tasklists[$calendar_id]->getPermission());
             } catch (Exception $e) {