From 46d3c90d34a1627497e51baff090d903f396b626 Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 2 Jul 2025 14:10:39 +0800 Subject: [PATCH 1/2] * [task#146247,done,0.5h] Adjust spell mistake. --- module/task/control.php | 8 +++++--- module/task/zen.php | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 87629c1bc4..57e7de3ed8 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -276,7 +276,7 @@ class task extends control $this->view->task = $task; $this->view->title = $this->view->execution->name . $this->lang->hyphen . $this->lang->task->assign; - $this->taskZen->buildUsersAndMembersToFrom($executionID, $taskID); + $this->taskZen->buildUsersAndMembersToForm($executionID, $taskID); $this->display(); } @@ -316,7 +316,9 @@ class task extends control { if($this->post->taskIdList) { + a($this->post->taskIdList); $taskData = $this->taskZen->buildTasksForBatchAssignTo($this->post->taskIdList, $assignedTo); + a($taskData);exit; foreach($taskData as $task) { $this->task->assign($task); @@ -472,7 +474,7 @@ class task extends control $this->view->assignedTo = !empty($task->team) ? $this->task->getAssignedTo4Multi($task->team, $task) : $assignedTo; $this->view->canRecordEffort = $this->task->canOperateEffort($task); $this->view->currentTeam = $currentTeam; - $this->taskZen->buildUsersAndMembersToFrom($task->execution, $taskID); + $this->taskZen->buildUsersAndMembersToForm($task->execution, $taskID); $this->display(); } @@ -647,7 +649,7 @@ class task extends control $task->myConsumed = zget($currentTeam, 'consumed', 0); } - $this->taskZen->buildUsersAndMembersToFrom($task->execution, $taskID); + $this->taskZen->buildUsersAndMembersToForm($task->execution, $taskID); $this->view->title = $this->view->execution->name . $this->lang->hyphen .$this->lang->task->finish; $this->view->canRecordEffort = $this->task->canOperateEffort($task); diff --git a/module/task/zen.php b/module/task/zen.php index 47b41016b3..5b793ac604 100644 --- a/module/task/zen.php +++ b/module/task/zen.php @@ -375,14 +375,14 @@ class taskZen extends task /** * 构建指派给表单。 - * Build from for assignTo page. + * Build form for assignTo page. * * @param int $executionID * @param int $taskID * @access protected * @return void */ - protected function buildUsersAndMembersToFrom(int $executionID, int $taskID): void + protected function buildUsersAndMembersToForm(int $executionID, int $taskID): void { $task = $this->task->getByID($taskID); $projectModel = $this->dao->findById($task->project)->from(TABLE_PROJECT)->fetch('model'); From ff33df3d97439e5b0721c42fb98fa670fbb6575c Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 2 Jul 2025 16:30:20 +0800 Subject: [PATCH 2/2] * [task#146247,done,1h] Process batch assign function for multiple tasks. --- module/task/zen.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/module/task/zen.php b/module/task/zen.php index 5b793ac604..68f120f3a7 100644 --- a/module/task/zen.php +++ b/module/task/zen.php @@ -611,8 +611,14 @@ class taskZen extends task /* Filter tasks. */ foreach($tasks as $taskID => $task) { - if(isset($multipleTasks[$taskID]) && $task->assignedTo != $this->app->user->account && $task->mode == 'linear') unset($tasks[$taskID]); - if(isset($multipleTasks[$taskID]) && !isset($multipleTasks[$taskID][$this->post->assignedTo])) unset($tasks[$taskID]); + /* 不是完成,取消状态的多人任务不能指派。*/ + /* Multiple tasks that are not finished or canceled cannot be assigned. */ + if(isset($multipleTasks[$taskID]) && strpos('wait,doing,pause', $task->status) !== false) unset($tasks[$taskID]); + + /* 多人任务不能指派给任务团队外的人。*/ + /* Multiple tasks cannot be assigned to users that are not in the task team. */ + if(isset($multipleTasks[$taskID]) && !isset($multipleTasks[$taskID][$assignedTo])) unset($tasks[$taskID]); + if($task->status == 'closed') unset($tasks[$taskID]); }