TW-1714: Starting recurring task starts all recurrences

- Thanks to Robin Green.
This commit is contained in:
Paul Beckingham 2016-01-11 23:20:33 -05:00
parent d564aac978
commit 7f3db8f201
6 changed files with 17 additions and 8 deletions

View file

@ -59,9 +59,14 @@ int CmdAdd::execute (std::string& output)
context.tdb2.add (task);
// Do not display ID 0, users cannot query by that
if (context.verbose ("new-id") && task.id != 0)
auto status = task.getStatus ();
if (context.verbose ("new-id") &&
(status == Task::pending ||
status == Task::waiting))
output += format (STRING_CMD_ADD_FEEDBACK, task.id) + "\n";
else if (context.verbose ("new-uuid"))
else if (context.verbose ("new-uuid") &&
status != Task::recurring)
output += format (STRING_CMD_ADD_FEEDBACK, task.get ("uuid")) + "\n";
if (context.verbose ("project"))

View file

@ -114,9 +114,14 @@ int CmdDuplicate::execute (std::string&)
++count;
feedback_affected (STRING_CMD_DUPLICATE_TASK, task);
if (context.verbose ("new-id"))
auto status = dup.getStatus ();
if (context.verbose ("new-id") &&
(status == Task::pending ||
status == Task::waiting))
std::cout << format (STRING_CMD_ADD_FEEDBACK, dup.id) + "\n";
else if (context.verbose ("new-uuid"))
else if (context.verbose ("new-uuid") &&
status != Task::recurring)
std::cout << format (STRING_CMD_ADD_FEEDBACK, dup.get ("uuid")) + "\n";
if (context.verbose ("project"))