add project attr

This commit is contained in:
DavidBadura
2015-02-06 13:08:13 +01:00
parent 11c9f610a8
commit fa478272b6
5 changed files with 151 additions and 12 deletions

View File

@@ -128,6 +128,14 @@ class TaskManager
$this->update($task);
}
/**
* @return array
*/
public function projects()
{
return $this->taskwarrior->projects();
}
/**
*
*/
@@ -171,17 +179,15 @@ class TaskManager
*/
private function edit(Task $task)
{
$options = [];
$this->taskwarrior->modify(
[
'description' => $task->getDescription(),
'project' => $task->getProject(),
'due' => $task->getDue() ? $task->getDue()->format('Ymd\THis\Z') : null,
],
$task->getUuid()
);
if ($task->getDue()) {
$options[] = 'due:' . $task->getDue()->format('Ymd\THis\Z');
} else {
$options[] = 'due:';
}
$options[] = $task->getDescription();
$this->taskwarrior->command('modify', $task->getUuid(), $options);
$this->update($task);
}