This commit is contained in:
tianshujie
2022-11-07 09:11:40 +08:00
parent 9f87785a72
commit 2176378af6
5 changed files with 18 additions and 14 deletions

View File

@@ -74,11 +74,13 @@ class caselibModel extends model
* @param int $libID
* @param bool $setImgSize
* @access public
* @return object
* @return object|bool
*/
public function getById($libID, $setImgSize = false)
{
$lib = $this->dao->select('*')->from(TABLE_TESTSUITE)->where('id')->eq((int)$libID)->fetch();
if(!$lib) return false;
$lib = $this->loadModel('file')->replaceImgURL($lib, 'desc');
if($setImgSize) $lib->desc = $this->file->setImgSize($lib->desc);
return $lib;

View File

@@ -2280,6 +2280,9 @@ class execution extends control
$executionID = $this->execution->saveState((int)$executionID, $this->executions);
$execution = $this->execution->getById($executionID, true);
$type = $this->config->vision == 'lite' ? 'kanban' : 'stage,sprint,kanban';
if(empty($execution) || strpos($type, $execution->type) === false) return print(js::error($this->lang->notFound) . js::locate('back'));
$execution->projectInfo = $this->loadModel('project')->getByID($execution->project);
if($this->config->systemMode == 'new')
@@ -2289,9 +2292,6 @@ class execution extends control
$this->view->programList = $this->loadModel('program')->getPairsByList($programList);
}
$type = $this->config->vision == 'lite' ? 'kanban' : 'stage,sprint,kanban';
if(empty($execution) || strpos($type, $execution->type) === false) return print(js::error($this->lang->notFound) . js::locate('back'));
if($execution->type == 'kanban' and defined('RUN_MODE') and RUN_MODE == 'api') return print($this->fetch('execution', 'kanban', "executionID=$executionID"));
$this->app->loadLang('program');

View File

@@ -1237,15 +1237,15 @@ class story extends control
$this->session->set('buildList', $uri, $buildApp);
$this->app->loadLang('bug');
$storyID = (int)$storyID;
$story = $this->story->getById($storyID, $version, true);
$version = empty($version) ? $story->version : $version;
$storyID = (int)$storyID;
$story = $this->story->getById($storyID, $version, true);
$linkModuleName = $this->config->vision == 'lite' ? 'project' : 'product';
if(!$story) return print(js::error($this->lang->notFound) . js::locate($this->createLink($linkModuleName, 'index')));
if(!$this->app->user->admin and strpos(",{$this->app->user->view->products},", ",$story->product,") === false) return print(js::error($this->lang->product->accessDenied) . js::locate('back'));
$story = $this->story->mergeReviewer($story, true);
$version = empty($version) ? $story->version : $version;
$story = $this->story->mergeReviewer($story, true);
$this->story->replaceURLang($story->type);

View File

@@ -951,11 +951,6 @@ class task extends control
*/
public function view($taskID)
{
$this->session->set('executionList', $this->app->getURI(true), 'execution');
$this->commonAction($taskID);
if($this->app->tab == 'project') $this->loadModel('project')->setMenu($this->session->project);
$taskID = (int)$taskID;
$task = $this->task->getById($taskID, true);
if(!$task)
@@ -964,6 +959,11 @@ class task extends control
return print(js::error($this->lang->notFound) . js::locate($this->createLink('execution', 'all')));
}
$this->session->set('executionList', $this->app->getURI(true), 'execution');
$this->commonAction($taskID);
if($this->app->tab == 'project') $this->loadModel('project')->setMenu($this->session->project);
$execution = $this->execution->getById($task->execution);
if(!isonlybody() and $execution->type == 'kanban')
{

View File

@@ -758,13 +758,15 @@ class testcase extends control
$caseID = (int)$caseID;
$case = $this->testcase->getById($caseID, $version);
$case = $this->loadModel('story')->checkNeedConfirm($case);
if(!$case)
{
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => '404 Not found'));
return print(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index')));
}
$case = $this->loadModel('story')->checkNeedConfirm($case);
if($from == 'testtask')
{
$run = $this->loadModel('testtask')->getRunByCase($taskID, $caseID);