* Modify code.

This commit is contained in:
tianshujie
2021-11-18 14:48:21 +08:00
parent 5e473398be
commit 22fdf1f0fc
5 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ foreach(explode(',', $showFields) as $field)
foreach($branches as $branchID => $branchName) $branches[$branchID] = '/' . $product->name . '/' . $branchName;
}
if(!isset($modules[$story->branch])) $modules[$story->branch] = $this->tree->getOptionMenu($story->product, $viewType = 'story', 0, $story->branch);
if(!isset($modules[$story->branch])) $modules[$story->branch] = $this->tree->getOptionMenu($story->product, 'story', 0, $story->branch);
foreach($modules[$story->branch] as $moduleID => $moduleName) $modules[$story->branch][$moduleID] = '/' . $product->name . $moduleName;
$productPlans = $this->productplan->getPairs($story->product, $branch);
+4 -4
View File
@@ -522,9 +522,9 @@ class testcase extends control
$this->app->tab == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($this->products, $productID, $branch);
/* Set story list. */
$story = $storyID ? $this->story->getByID($storyID) : '';
$storyList = $this->loadModel('story')->getProductStoryPairs($productID, $branch === 'all' ? 0 : $branch);
$storyList += $storyID ? array($storyID => $story->id . ':' . $story->title) : array('');
$story = $storyID ? $this->story->getByID($storyID) : '';
$storyPairs = $this->loadModel('story')->getProductStoryPairs($productID, $branch === 'all' ? 0 : $branch);
$storyPairs += $storyID ? array($storyID => $story->id . ':' . $story->title) : array('');
/* Set module option menu. */
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch === 'all' ? 0 : $branch);
@@ -553,7 +553,7 @@ class testcase extends control
$this->view->product = $product;
$this->view->productID = $productID;
$this->view->story = $story;
$this->view->storyList = $storyList;
$this->view->storyPairs = $storyPairs;
$this->view->productName = $this->products[$productID];
$this->view->moduleOptionMenu = $moduleOptionMenu;
$this->view->currentModuleID = $currentModuleID;
+1 -1
View File
@@ -43,7 +43,7 @@ $(function()
{
removeDitto(); //Remove 'ditto' in first row.
$('#subNavbar li[data-id="testcase"]').addClass('active');
if($("[name^='story']").length > 0)
if(hasStory)
{
$("[name^='story']").each(function()
{
+1 -1
View File
@@ -84,7 +84,7 @@
<td class="text-center"><?php echo $i+1;?></td>
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branch[$i]", $branches, $branch, "class='form-control' onchange='setModules(this.value, $productID, $i)'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("module[$i]", $moduleOptionMenu, $currentModuleID, "class='form-control chosen' onchange='loadStories($productID, this.value, $i)'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?>' style='overflow:visible'> <?php echo html::select("story[$i]", $storyList, $story ? $story->id : '', 'class="form-control chosen"');?></td>
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?>' style='overflow:visible'> <?php echo html::select("story[$i]", $storyPairs, $story ? $story->id : '', 'class="form-control chosen"');?></td>
<td style='overflow:visible'>
<div class="input-control has-icon-right">
<?php echo html::input("title[$i]", '', "class='form-control title-import'");?>
+2 -1
View File
@@ -68,7 +68,7 @@
<?php foreach($caseIDList as $caseID):?>
<?php
if(!isset($cases[$caseID])) continue;
$caseBranch = $cases[$caseID]->branch;
$caseBranch = isset($cases[$caseID]->branch) ? $cases[$caseID]->branch : 0;
if((!$productID and !$cases[$caseID]->lib) or $app->tab != 'qa')
{
$product = $this->product->getByID($cases[$caseID]->product);
@@ -141,4 +141,5 @@
</form>
<?php endif;?>
</div>
<?php js::set('hasStory', isset($visibleFields['story']));?>
<?php include '../../common/view/footer.html.php';?>