Skip to content
25 changes: 12 additions & 13 deletions config/prefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,21 +312,20 @@
$sync[] = $default;
$GLOBALS['prefs']->setValue('sync_lists', serialize($sync));
}
if ($GLOBALS['conf']['activesync']['enabled'] && !$GLOBALS['prefs']->getValue('activesync_no_multiplex')) {
if ($GLOBALS['conf']['activesync']['enabled']
&& $GLOBALS['prefs']->getValue('activesync_no_multiplex')) {
try {
$sm = $GLOBALS['injector']->getInstance('Horde_ActiveSyncState');
$sm->setLogger($GLOBALS['injector']->getInstance('Horde_Log_Logger'));
$devices = $sm->listDevices($GLOBALS['registry']->getAuth());
foreach ($devices as $device) {
$sm->removeState([
'devId' => $device['device_id'],
'id' => Horde_Core_ActiveSync_Driver::TASKS_FOLDER_UID,
'user' => $GLOBALS['registry']->getAuth(),
]);
}
$GLOBALS['notification']->push(_("All state removed for your ActiveSync devices. They will resynchronize next time they connect to the server."));
Nag::pruneActiveSyncTaskCache();
Nag::touchActiveSyncDeviceCaches();
$GLOBALS['notification']->push(
_("Task list sync preferences were saved. Your device will update task list folders on the next folder sync."),
'horde.message'
);
} catch (Horde_ActiveSync_Exception $e) {
$GLOBALS['notification']->push(_("There was an error communicating with the ActiveSync server: %s"), $e->getMessage(), 'horde.error');
$GLOBALS['notification']->push(
sprintf(_("There was an error communicating with the ActiveSync server: %s"), $e->getMessage()),
'horde.error'
);
}
}
},
Expand Down
17 changes: 7 additions & 10 deletions lib/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,13 @@ public function getTasklist($name)
*/
public function addTasklist($name, $description = '', $color = '', array $params = [])
{
$tasklist = Nag::addTasklist(['name' => $name, 'description' => $description, 'color' => $color]);

$name = $tasklist->getName();
if (!empty($params['synchronize'])) {
$sync = @unserialize($GLOBALS['prefs']->getValue('sync_lists'));
$sync[] = $name;
$GLOBALS['prefs']->setValue('sync_lists', serialize($sync));
}
$tasklist = Nag::addTasklist(
['name' => $name, 'description' => $description, 'color' => $color],
true,
!empty($params['synchronize'])
);

return $name;
return $tasklist->getName();
}

/**
Expand Down Expand Up @@ -274,7 +271,7 @@ public function updateAttendee($response, $sender = null)
public function deleteTasklist($id)
{
$tasklist = $GLOBALS['nag_shares']->getShare($id);
return Nag::deleteTasklist($tasklist);
Nag::deleteTasklist($tasklist);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Form/CreateTaskList.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ public function execute()
$info[$key] = $this->_vars->get($key);
}

return Nag::addTasklist($info);
return Nag::addTasklist($info, true, true);
}
}
Loading
Loading