add start&stop

This commit is contained in:
DavidBadura
2015-04-23 19:33:10 +00:00
parent f4ba78f822
commit 9f3ea62916
4 changed files with 83 additions and 5 deletions

View File

@@ -155,6 +155,32 @@ class TaskManager
$this->refresh($task);
}
/**
* @param Task $task
*/
public function start(Task $task)
{
if (!$task->getUuid()) {
return;
}
$this->taskwarrior->start($task->getUuid());
$this->refresh($task);
}
/**
* @param Task $task
*/
public function stop(Task $task)
{
if (!$task->getUuid()) {
return;
}
$this->taskwarrior->stop($task->getUuid());
$this->refresh($task);
}
/**
* @param Task $task
*/
@@ -313,6 +339,7 @@ class TaskManager
$this->setValue($old, 'urgency', $new->getUrgency());
$this->setValue($old, 'status', $new->getStatus());
$this->setValue($old, 'modified', $new->getModified());
$this->setValue($old, 'start', $new->getStart());
if ($new->isPending()) { // fix reopen problem
$this->setValue($old, 'end', null);