From 23329c7df6ad202f08d8a99f74a8bb0c931646ac Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 13 Mar 2024 09:06:26 +0800 Subject: [PATCH] * Fix bug#46664. --- lib/zin/wg/backbtn/v1.php | 6 +++--- module/story/tao.php | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/zin/wg/backbtn/v1.php b/lib/zin/wg/backbtn/v1.php index 1209e309cc..16f5705336 100644 --- a/lib/zin/wg/backbtn/v1.php +++ b/lib/zin/wg/backbtn/v1.php @@ -43,10 +43,10 @@ class backBtn extends btn global $app; $backs = array( - 'task' => 'execution-task,my-work,my-contribute,execution-tree,execution-grouptask,project-execution,product-track,repo-view', + 'task' => 'execution-task,my-work,my-contribute,execution-tree,execution-grouptask,project-execution,product-track,repo-view,story-change', 'story' => 'product-browse,projectstory-story,execution-story,my-work,my-contribute,productplan-view,build-view,projectbuild-view,product-track,repo-view', - 'bug' => 'bug-browse,project-bug,my-work,my-contribute,execution-bug,bug-view,qa-index,execution-task,product-track,execution-task,task-view,repo-view', - 'testcase' => 'testcase-browse,project-testcase,my-work,my-contribute,execution-testcase,testtask-cases,testsuite-view,product-browse,testcase-view,qa-index,caselib-browse,product-track', + 'bug' => 'bug-browse,project-bug,my-work,my-contribute,execution-bug,bug-view,qa-index,execution-task,product-track,execution-task,task-view,repo-view,story-change', + 'testcase' => 'testcase-browse,project-testcase,my-work,my-contribute,execution-testcase,testtask-cases,testsuite-view,product-browse,testcase-view,qa-index,caselib-browse,product-track,story-change', 'testsuite' => 'testsuite-browse,testsuite-view,', 'testtask' => 'testtask-browse,testtask-cases,qa-index,testcase-browse,', 'testreport' => 'testreport-browse,project-testreport,execution-testreport,execution-testtask', diff --git a/module/story/tao.php b/module/story/tao.php index d3641bc216..1d5ccea75f 100644 --- a/module/story/tao.php +++ b/module/story/tao.php @@ -1442,14 +1442,15 @@ class storyTao extends storyModel $this->app->loadLang('task'); $this->config->story->affect = new stdclass(); $this->config->story->affect->projects = new stdclass(); - $this->config->story->affect->projects->fields[] = array('name' => 'id', 'title' => $this->lang->task->id); - $this->config->story->affect->projects->fields[] = array('name' => 'name', 'title' => $this->lang->task->name, 'link' => helper::createLink('task', 'view', 'id={id}')); - $this->config->story->affect->projects->fields[] = array('name' => 'assignedTo', 'title' => $this->lang->task->assignedTo); - $this->config->story->affect->projects->fields[] = array('name' => 'consumed', 'title' => $this->lang->task->consumed); - $this->config->story->affect->projects->fields[] = array('name' => 'left', 'title' => $this->lang->task->left); + $this->config->story->affect->projects->fields['id'] = array('name' => 'id', 'title' => $this->lang->task->id); + $this->config->story->affect->projects->fields['name'] = array('name' => 'name', 'title' => $this->lang->task->name, 'link' => helper::createLink('task', 'view', 'id={id}')); + $this->config->story->affect->projects->fields['assignedTo'] = array('name' => 'assignedTo', 'title' => $this->lang->task->assignedTo); + $this->config->story->affect->projects->fields['consumed'] = array('name' => 'consumed', 'title' => $this->lang->task->consumed); + $this->config->story->affect->projects->fields['left'] = array('name' => 'left', 'title' => $this->lang->task->left); if(empty($story->executions)) return $story; - foreach($story->executions as $executionID => $execution) if($execution->status == 'done') unset($story->executions[$executionID]); + $storyExecutions = $story->executions; + foreach($storyExecutions as $executionID => $execution) if($execution->status == 'done') unset($story->executions[$executionID]); $story->teams = $this->dao->select('account, root')->from(TABLE_TEAM)->where('root')->in(array_keys($story->executions))->andWhere('type')->eq('execution')->fetchGroup('root'); foreach($story->tasks as $executionTasks) @@ -1458,6 +1459,11 @@ class storyTao extends storyModel { $task->status = $this->processStatus('task', $task); $task->assignedTo = zget($users, $task->assignedTo); + if(isset($storyExecutions[$task->execution])) + { + $taskExecution = $storyExecutions[$task->execution]; + if(!$taskExecution->multiple) $this->config->story->affect->projects->fields['name']['link'] .= '#app=project'; + } } } return $story;