///////////////////////////////////////////////////////////////////////////
| 127 | |
| 128 | //////////////////////////////////////////////////////////////////////////////// |
| 129 | int CmdModify::modifyAndUpdate(Task& before, Task& after, |
| 130 | std::map<std::string, std::string>* projectChanges /* = NULL */) { |
| 131 | // This task. |
| 132 | auto count = 1; |
| 133 | |
| 134 | updateRecurrenceMask(after); |
| 135 | feedback_affected("Modifying task {1} '{2}'.", after); |
| 136 | feedback_unblocked(after); |
| 137 | Context::getContext().tdb2.modify(after); |
| 138 | if (Context::getContext().verbose("project") && projectChanges) |
| 139 | (*projectChanges)[after.get("project")] = onProjectChange(before, after); |
| 140 | |
| 141 | // Task has siblings - modify them. |
| 142 | if (after.has("parent")) count += modifyRecurrenceSiblings(after, projectChanges); |
| 143 | |
| 144 | // Task has child tasks - modify them. |
| 145 | else if (after.get("status") == "recurring") |
| 146 | count += modifyRecurrenceParent(after, projectChanges); |
| 147 | |
| 148 | return count; |
| 149 | } |
| 150 | |
| 151 | //////////////////////////////////////////////////////////////////////////////// |
| 152 | int CmdModify::modifyRecurrenceSiblings( |
no test coverage detected