TW-1432: start/stop can be issued on completed tasks

- Make "start" set status to pending from completed/deleted.
- Add test to "start_NEW.t", which is to be combined with start.t once
  converted from Perl.
This commit is contained in:
Wilhelm Schuermann 2015-05-28 10:11:12 +02:00
parent 9e20f83f24
commit 5f61703588
2 changed files with 69 additions and 0 deletions

View file

@ -79,6 +79,13 @@ int CmdStart::execute (std::string& output)
task.modify (Task::modAnnotate);
task.setAsNow ("start");
Task::status status = task.getStatus ();
if (status == Task::completed || status == Task::deleted)
{
// "waiting" handled by Task::validate(), no special care needed here.
task.setStatus (Task::pending);
}
if (context.config.getBoolean ("journal.time"))
task.addAnnotation (context.config.get ("journal.time.start.annotation"));