From c854467be589f2f7f9864fcc31a6623612fa371e Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Wed, 29 Nov 2023 15:36:50 +0800 Subject: [PATCH] * Fix bug #40672. --- module/execution/control.php | 3 ++- module/execution/view/task.html.php | 2 +- module/task/model.php | 11 ++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 66fc89d060..af29d50039 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -133,7 +133,8 @@ class execution extends control /* Set browse type. */ $browseType = strtolower($status); - $execution = $this->commonAction($executionID, $status); + $execution = $this->commonAction($executionID, $status); + if($this->config->systemMode == 'PLM') $execution->ipdStage = $this->execution->canStageStart($execution); $executionID = $execution->id; if($execution->type == 'kanban' and $this->config->vision != 'lite' and $this->app->getViewType() != 'json') $this->locate($this->createLink('execution', 'kanban', "executionID=$executionID")); diff --git a/module/execution/view/task.html.php b/module/execution/view/task.html.php index 06dbb8b11c..962d24a151 100644 --- a/module/execution/view/task.html.php +++ b/module/execution/view/task.html.php @@ -15,7 +15,7 @@ include '../../common/view/header.html.php'; include '../../common/view/datatable.fix.html.php'; include '../../common/view/zui3dtable.html.php'; $cols = $this->task->generateCol($orderBy); -$tasks = $this->task->generateRow($tasks, $users, $executionID, $showBranch, $branchGroups, $modulePairs); +$tasks = $this->task->generateRow($tasks, $users, $execution, $showBranch, $branchGroups, $modulePairs); $assignApp = $setModule ? '' : '#app=project'; $sortLink = helper::createLink('execution', 'task', "executionID={$execution->id}&status={$status}¶m={$param}&orderBy={orderBy}&recTotal={$recTotal}&recPerPage={$recPerPage}") . $assignApp; js::set('moduleID', $moduleID); diff --git a/module/task/model.php b/module/task/model.php index 21df78c8bb..9dcf86fa76 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -4296,10 +4296,11 @@ class taskModel extends model * Build task browse action menu. * * @param object $task + * @param object $execution * @access public * @return string */ - public function buildOperateBrowseMenu($task, $execution = '') + public function buildOperateBrowseMenu($task, $execution) { $menu = ''; $params = "taskID=$task->id"; @@ -4644,14 +4645,14 @@ class taskModel extends model * * @param array $tasks * @param array $users - * @param int $executionID + * @param object $execution * @param bool $showBranch * @param array $branchGroups * @param array $modulePairs * @access public * @return array */ - public function generateRow($tasks, $users, $executionID, $showBranch, $branchGroups, $modulePairs) + public function generateRow($tasks, $users, $execution, $showBranch, $branchGroups, $modulePairs) { $userFields = array('assignedTo', 'openedBy', 'closedBy', 'lastEditedBy', 'finishedBy'); $dateFields = array('assignedDate', 'openedDate', 'deadline', 'finishedDate', 'closedDate', 'lastEditedDate', 'canceledDate', 'activatedDate', 'estStarted', 'realStarted', 'replacetypeDate'); @@ -4661,7 +4662,7 @@ class taskModel extends model foreach($tasks as $task) { - $task->actions = '
' . $this->buildOperateBrowseMenu($task) . '
'; + $task->actions = '
' . $this->buildOperateBrowseMenu($task, $execution) . '
'; $task->assignedTo = $this->printAssignedHtml($task, $users, false); $taskName = ''; @@ -4746,7 +4747,7 @@ class taskModel extends model if(!empty($children)) { - $rows = array_merge($rows, $this->generateRow($children, $users, $executionID, $showBranch, $branchGroups, $modulePairs)); + $rows = array_merge($rows, $this->generateRow($children, $users, $execution, $showBranch, $branchGroups, $modulePairs)); } } return $rows;