Bug 28795

This commit is contained in:
曾刚
2022-10-21 07:59:09 +00:00
committed by 王怡栋
parent ea7ed2c31b
commit d2771a1dea
4 changed files with 25 additions and 5 deletions
+3 -2
View File
@@ -919,15 +919,16 @@ class execution extends control
* View a story.
*
* @param int $storyID
* @param int $executionID
* @access public
* @return void
*/
public function storyView($storyID)
public function storyView($storyID, $executionID = 0)
{
$this->session->set('productList', $this->app->getURI(true), 'product');
$story = $this->loadModel('story')->getByID($storyID);
echo $this->fetch('story', 'view', "storyID=$storyID&version=$story->version&param=" . $this->session->execution);
echo $this->fetch('story', 'view', "storyID=$storyID&version=$story->version&param=" . ($executionID ? $executionID : $this->session->execution));
}
/**
+19 -1
View File
@@ -318,7 +318,7 @@ class file extends control
$this->view->method = $method;
$this->view->showDelete = $showDelete;
if(strpos('view,edit', $method) !== false) return $this->display('file', 'viewfiles');
if(strpos('view,edit', $method) !== false and $this->app->clientDevice != 'mobile') return $this->display('file', 'viewfiles');
$this->display();
}
@@ -353,8 +353,26 @@ class file extends control
if($file->objectType == 'testcase' and $file->title != $fileName) $this->file->updateTestcaseVersion($file);
$newFile = $this->file->getByID($fileID);
if($this->app->clientDevice == 'mobile') return print(js::reload('parent.parent'));
echo json_encode($newFile);
}
if($this->app->clientDevice == 'mobile')
{
$file = $this->file->getById($fileID);
if(strrpos($file->title, '.') !== false)
{
/* Fix the file name exe.exe */
$title = explode('.', $file->title);
$extension = end($title);
if($file->extension == 'txt' && $extension != $file->extension) $file->extension = $extension;
array_pop($title);
$file->title = join('.', $title);
}
$this->view->file = $file;
$this->display();
}
}
/**
+2 -1
View File
@@ -1262,7 +1262,8 @@ class story extends control
$from = $this->app->tab;
if($from == 'execution')
{
$this->execution->setMenu($param);
$result = $this->execution->setMenu($param);
if($result) return;
}
elseif($from == 'project')
{
+1 -1
View File
@@ -4646,7 +4646,7 @@ class storyModel extends model
}
elseif($tab == 'execution')
{
$storyLink = helper::createLink('execution', 'storyView', "storyID=$story->id");
$storyLink = helper::createLink('execution', 'storyView', "storyID=$story->id&execution={$this->session->execution}");
$canView = common::hasPriv('execution', 'storyView');
}