From 4023defab4b6078bf3781b58e76b31b43682bdbe Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 8 Nov 2024 10:10:11 +0800 Subject: [PATCH] * [pref story #69167] Adjust get to and cc list. --- module/task/model.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index 6aee914ec9..294ecf221f 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -2085,19 +2085,15 @@ class taskModel extends model $assignedTo = $teamList; } + if(empty($assignedTo) && empty($mailto)) return false; + /* If the assignor is empty, consider the first one with the cc as the assignor. */ - if(empty($assignedTo)) - { - if(empty($mailto)) return false; + if(empty($assignedTo)) $assignedTo = array_shift($mailto); - $assignedTo = array_shift($mailto); - } - elseif(strtolower($assignedTo) == 'closed') - { - /* If the assignor is closed, treat the completion person as the assignor. */ - $assignedTo = $task->finishedBy; - } + /* If the assignor is closed, treat the completion person as the assignor. */ + if(strtolower($assignedTo) == 'closed') $assignedTo = $task->finishedBy; + /* If the child task is paused, closed or canceled, append the mailto from parent task. */ if(in_array($action, array('paused', 'closed', 'canceled')) && $task->parent > 0) { $parentTasks = $this->dao->select('id,assignedTo,finishedBy,mailto')->from(TABLE_TASK)->where('id')->in($task->path)->fetchAll('id');