Merge branch dev/task-146247 of zentao/zentaopms (#10135)

This commit is contained in:
刘刚
2025-07-03 10:18:35 +08:00
committed by Gitfox
2 changed files with 15 additions and 7 deletions
+5 -3
View File
@@ -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);
+10 -4
View File
@@ -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');
@@ -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]);
}