* Optimize code for task #61174.

This commit is contained in:
liumengyi
2022-07-19 09:52:15 +08:00
parent fc00015a6d
commit cd4d9d2a6e
2 changed files with 12 additions and 8 deletions
+7 -2
View File
@@ -1205,8 +1205,13 @@ class story extends control
*/
public function view($storyID, $version = 0, $param = 0)
{
$uri = $this->app->getURI(true);
$this->session->set('productList', $uri . "#app={$this->app->tab}", 'product');
$uri = $this->app->getURI(true);
$tab = $this->app->tab;
$buildApp = $tab == 'product' ? 'project' : $tab;
$releaseApp = $tab == 'execution' ? 'product' : $tab;
$this->session->set('productList', $uri . "#app={$tab}", 'product');
$this->session->set('releaseList', $uri, $releaseApp);
$this->session->set('buildList', $uri, $buildApp);
$storyID = (int)$storyID;
$story = $this->story->getById($storyID, $version, true);
+5 -6
View File
@@ -497,11 +497,10 @@
<td class='pd-0'>
<ul class='list-unstyled'>
<?php
$misc = isonlybody() ? "showinonlybody" : "class='iframe' data-width='80%'";
$tab = $app->tab == 'product' ? 'project' : $app->tab;
foreach($builds as $build)
{
echo "<li title='$build->id $build->name'>" . html::a($this->createLink('build', 'view', "buildID=$build->id", '', true), "#$build->id $build->name", '', $misc) . '</li>';
echo "<li title='$build->id $build->name'>" . html::a($this->createLink('build', 'view', "buildID=$build->id"), "#$build->id $build->name", '', "data-app='{$tab}'") . '</li>';
}
?>
</ul>
@@ -512,11 +511,11 @@
<td class='pd-0'>
<ul class='list-unstyled'>
<?php
$misc = isonlybody() ? "showinonlybody" : "class='iframe' data-width='80%'";
$releaseModule = $app->tab == 'project' ? 'projectrelease' : 'release';
$tab = $app->tab == 'execution' ? 'product' : $app->tab;
foreach($releases as $release)
{
echo "<li title='$release->id $release->name'>" . html::a($this->createLink('release', 'view', "release=$release->id", '', true), "#$release->id $release->name", '', $misc) . '</li>';
echo "<li title='$release->id $release->name'>" . html::a($this->createLink($releaseModule, 'view', "release=$release->id"), "#$release->id $release->name", '', "data-app='{$tab}'") . '</li>';
}
?>
</ul>