From 183bd16df3e3ed22885d4ef536c1cabd18082173 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 4 Aug 2021 16:29:10 +0800 Subject: [PATCH] * Fix bug #13973. --- module/execution/control.php | 2 +- module/project/control.php | 2 +- module/testcase/control.php | 2 +- module/upgrade/model.php | 13 +++++++++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index f62dbed7e6..eaf395ea53 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1758,7 +1758,7 @@ class execution extends control */ public function view($executionID) { - $executionID = (int)$executionID; + $executionID = $this->execution->saveState((int)$executionID, $this->executions); $execution = $this->execution->getById($executionID, true); if(empty($execution) || strpos('stage,sprint', $execution->type) === false) die(js::error($this->lang->notFound) . js::locate('back')); diff --git a/module/project/control.php b/module/project/control.php index 8795e52885..29c2257158 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -558,7 +558,7 @@ class project extends control */ public function view($projectID = 0) { - $projectID = (int)$projectID; + $projectID = $this->project->saveState((int)$projectID, $this->project->getPairsByProgram()); $project = $this->project->getById($projectID); if(empty($project) || strpos('scrum,waterfall', $project->model) === false) die(js::error($this->lang->notFound) . js::locate('back')); diff --git a/module/testcase/control.php b/module/testcase/control.php index 96f74d4eab..fe08fa75b8 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -117,7 +117,7 @@ class testcase extends control /* Set menu, save session. */ if($this->app->openApp == 'project') { - $this->products = array('0' => $this->lang->product->all) + $this->loadModel('project')->getProducts($this->session->project, false); + $this->products = array('0' => $this->lang->product->all) + $this->loadModel('project')->getProducts($projectID, false); $this->loadModel('project')->setMenu($projectID); } else diff --git a/module/upgrade/model.php b/module/upgrade/model.php index ddadd9c477..86e3a038b0 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -4508,7 +4508,6 @@ class upgradeModel extends model if(!$projectID) die(js::alert($this->lang->upgrade->projectEmpty)); $this->dao->update(TABLE_BUG)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec(); - $this->dao->update(TABLE_CASE)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec(); $this->dao->update(TABLE_TESTREPORT)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec(); $this->dao->update(TABLE_TESTSUITE)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec(); $this->dao->update(TABLE_BUILD)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec(); @@ -4519,6 +4518,7 @@ class upgradeModel extends model $this->dao->update(TABLE_BUG)->set('project')->eq($projectID)->where('execution')->in($sprintIdList)->andWhere('project')->eq(0)->exec(); $this->dao->update(TABLE_DOC)->set('project')->eq($projectID)->set('type')->eq('execution')->where("lib IN(SELECT id from " . TABLE_DOCLIB . " WHERE type = 'project' and execution " . helper::dbIN($sprintIdList) . ')')->exec(); $this->dao->update(TABLE_DOCLIB)->set('project')->eq($projectID)->where('type')->eq('execution')->andWhere('execution')->in($sprintIdList)->exec(); + $this->dao->update(TABLE_TESTTASK)->set('project')->eq($projectID)->where('execution')->in($sprintIdList)->exec(); /* Put sprint stories into project story mdoule. */ $sprintStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY) @@ -4539,9 +4539,18 @@ class upgradeModel extends model ->where('t1.execution')->in($sprintIdList) ->fetchAll(); + $sprintCases += $this->dao->select('`case`,product,project,count,version')->from(TABLE_PROJECTCASE)->where('project')->in($sprintIdList)->fetchAll(); + foreach($sprintCases as $projectCase) { - $projectCase->order = $projectCase * 5; + $caes = new stdClass(); + $case->case = $projectCase->case; + $case->order = $projectCase->case * 5; + $case->project = $projectCase->project; + $case->product = $projectCase->product; + $this->dao->replace(TABLE_PROJECTCASE)->data($case)->exec(); + + $projectCase->order = $projectCase->case * 5; $projectCase->project = $projectID; $this->dao->replace(TABLE_PROJECTCASE)->data($projectCase)->exec(); }