From c8e1be3c1c7ee1f71a6e8bbbf56db0943894c59f Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 24 Sep 2024 09:51:35 +0800 Subject: [PATCH] * [task#129029,doing,0.5h] add assign action for bug, story and task data. --- module/bug/model.php | 1 + module/story/model.php | 2 ++ module/task/model.php | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/module/bug/model.php b/module/bug/model.php index 0365b18b7d..9b9c7b3fd1 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -38,6 +38,7 @@ class bugModel extends model $action = $from == 'sonarqube' ? 'fromSonarqube' : 'Opened'; $this->loadModel('action')->create('bug', $bugID, $action); + if(!empty($bug->assignedTo)) $this->action->create('bug', $bugID, 'Assigned', '', $bug->assignedTo); /* Add score for create. */ if(!empty($bug->case)) diff --git a/module/story/model.php b/module/story/model.php index fd30ae9512..d1e97cbbb9 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -573,6 +573,7 @@ class storyModel extends model $action = $bugID == 0 ? (empty($storyFrom) ? 'Opened' : 'From' . ucfirst($storyFrom)) : 'Frombug'; $this->action->create('story', $storyID, $action, '', $extra); if($story->status == 'reviewing') $this->action->create('story', $storyID, 'submitReview'); + if(!empty($story->assignedTo)) $this->action->create('story', $storyID, 'Assigned', '', $story->assignedTo); if($todoID > 0) { @@ -731,6 +732,7 @@ class storyModel extends model $this->executeHooks($storyID); $this->action->create('story', $storyID, 'Opened', ''); + if(!empty($story->assignedTo)) $this->action->create('story', $storyID, 'Assigned', '', $story->assignedTo); $storyIdList[$i] = $storyID; } diff --git a/module/task/model.php b/module/task/model.php index 57eaf5e42e..66d50ae637 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -947,7 +947,11 @@ class taskModel extends model if(dao::isError()) return false; - if($createAction) $this->loadModel('action')->create('task', $taskID, 'Opened', ''); + if($createAction) + { + $this->loadModel('action')->create('task', $taskID, 'Opened', ''); + if(!empty($task->assignedTo)) $this->action->create('task', $taskID, 'Assigned', '', $task->assignedTo); + } $this->loadModel('file')->updateObjectID($this->post->uid, $taskID, 'task'); $this->loadModel('score')->create('task', 'create', $taskID); if(dao::isError()) return false;