Moving tasks - Don't move to completed tasks
Check that the destination is not a completed task before accepting to move tasks to it, as the result makes no sense whatsoever.
This commit is contained in:
parent
c69abbe2b3
commit
4470e6d7d3
1 changed files with 6 additions and 4 deletions
|
@ -6,7 +6,7 @@
|
||||||
* 0 No error
|
* 0 No error
|
||||||
* 1 Deleted tasks
|
* 1 Deleted tasks
|
||||||
* 2 Moved tasks (not in specified container)
|
* 2 Moved tasks (not in specified container)
|
||||||
* 3 Target item/task deleted
|
* 3 Target item/task deleted or completed
|
||||||
* 4 Moving tasks to one of their children
|
* 4 Moving tasks to one of their children
|
||||||
* 5 Dependencies would be broken, and _force is FALSE
|
* 5 Dependencies would be broken, and _force is FALSE
|
||||||
*/
|
*/
|
||||||
|
@ -57,9 +57,11 @@ BEGIN
|
||||||
|
|
||||||
-- Make sure that the destination exists. Also get the target LTC ID.
|
-- Make sure that the destination exists. Also get the target LTC ID.
|
||||||
IF _toTask THEN
|
IF _toTask THEN
|
||||||
SELECT INTO _ltc_dest ltc_id
|
SELECT INTO _ltc_dest _ltc.ltc_id
|
||||||
FROM logical_task_containers
|
FROM logical_task_containers _ltc
|
||||||
WHERE task_id = _toId;
|
LEFT OUTER JOIN completed_tasks _ct
|
||||||
|
USING( task_id )
|
||||||
|
WHERE _ltc.task_id = _toId AND _ct.task_id IS NULL;
|
||||||
ELSE
|
ELSE
|
||||||
SELECT INTO _ltc_dest ltc_id
|
SELECT INTO _ltc_dest ltc_id
|
||||||
FROM logical_task_containers
|
FROM logical_task_containers
|
||||||
|
|
Loading…
Reference in a new issue