* [bug#52568,done,1h] Add vision for compatibling with viewing drill data.

This commit is contained in:
daitingting
2024-07-17 17:51:15 +08:00
committed by 綦新志
parent 64adbc1a74
commit 84a42e2a20
3 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -334,7 +334,7 @@ class task extends control
*/
public function view(int $taskID)
{
$task = $this->task->getById($taskID, true);
$task = $this->task->getById($taskID, true, $vision = 'all'); // TODO: $vision is for compatibling with viewing drill data.
if(!$task)
{
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found'));
@@ -343,7 +343,7 @@ class task extends control
if(!$this->loadModel('common')->checkPrivByObject('execution', $task->execution)) return $this->sendError($this->lang->execution->accessDenied, $this->createLink('execution', 'all'));
/* 为视图设置常用的公共变量和设置菜单为任务所属执行. Set common variables to view and set menu to the execution of the task. */
$this->taskZen->commonAction($taskID);
$this->taskZen->commonAction($taskID, $vision = 'all');
/* 如果当前主导航是项目,则设置菜单为会话中保存的项目. Set menu to project which saved in session if current app tab is project. */
if($this->app->tab == 'project') $this->loadModel('project')->setMenu($this->session->project);
+3 -2
View File
@@ -1240,13 +1240,14 @@ class taskModel extends model
* @access public
* @return false|object
*/
public function getByID(int $taskID, bool $setImgSize = false): false|object
public function getByID(int $taskID, bool $setImgSize = false, $vision = ''): false|object
{
if($vision == '') $vision = $this->config->vision; // TODO: $vision is for compatibling with viewing drill data.
$task = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.version AS latestStoryVersion, t2.status AS storyStatus')
->from(TABLE_TASK)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->where('t1.id')->eq($taskID)
->andWhere('t1.vision')->eq($this->config->vision)
->beginIf($vision != 'all')->andWhere('t1.vision')->eq($this->config->vision)->fi()
->fetch();
if(!$task) return false;
+2 -2
View File
@@ -889,9 +889,9 @@ class taskZen extends task
* @access protected
* @return void
*/
protected function commonAction(int $taskID): void
protected function commonAction(int $taskID, string $vision = ''): void
{
$this->view->task = $this->task->getByID($taskID);
$this->view->task = $this->task->getByID($taskID, true, $vision);
$this->view->execution = $this->execution->getByID($this->view->task->execution);
$this->view->members = $this->loadModel('user')->getTeamMemberPairs($this->view->execution->id, 'execution','nodeleted');
$this->view->actions = $this->loadModel('action')->getList('task', $taskID);