* Finish task #44496.

This commit is contained in:
tianshujie
2021-11-16 15:07:18 +08:00
parent b74f5ab258
commit d268587e8d
4 changed files with 58 additions and 22 deletions
+28 -7
View File
@@ -711,14 +711,35 @@ class story extends control
$product = $this->product->getByID($productID);
$branchProduct = $product->type == 'normal' ? false : true;
/* Set modules. */
$modules = array('ditto' => $this->lang->story->ditto) + $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch);
/* Set branches and modules. */
$branches = array();
$modules = array();
if($product->type != 'normal')
{
$branches = $this->loadModel('branch')->getPairs($productID);
if($branch === 'all')
{
$modules[0] = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch);
foreach($branches as $branchID => $branchName)
{
$modules[$branchID] = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branchID);
}
}
else
{
$modules[$branch] = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch);
}
}
else
{
$modules[0] = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch);
}
$this->view->modules = $modules;
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id);
$this->view->plans = $this->productplan->getBranchPlanPairs($productID);
$this->view->position[] = html::a($this->createLink('product', 'browse', "product=$product->id&branch=$branch"), $product->name);
$this->view->title = $product->name . $this->lang->colon . $this->lang->story->batchEdit;
$this->view->modules = $modules;
$this->view->branches = $branches;
$this->view->plans = $this->productplan->getBranchPlanPairs($productID);
$this->view->position[] = html::a($this->createLink('product', 'browse', "product=$product->id&branch=$branch"), $product->name);
$this->view->title = $product->name . $this->lang->colon . $this->lang->story->batchEdit;
}
elseif($executionID)
{
+3 -6
View File
@@ -76,15 +76,12 @@ foreach(explode(',', $showFields) as $field)
if($product->type != 'normal')
{
foreach($branches as $branchID => $branchName) $branches[$branchID] = '/' . $product->name . '/' . $branchName;
$branches = array('ditto' => $this->lang->story->ditto) + $branches;
}
$modules = $this->tree->getOptionMenu($story->product, $viewType = 'story', 0, $story->branch);
foreach($modules as $moduleID => $moduleName) $modules[$moduleID] = '/' . $product->name . $moduleName;
$modules = array('ditto' => $this->lang->story->ditto) + $modules;
if(!isset($modules[$story->branch])) $modules[$story->branch] = $this->tree->getOptionMenu($story->product, $viewType = '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);
$productPlans = array('' => '', 'ditto' => $this->lang->story->ditto) + $productPlans;
}
?>
<tr>
@@ -97,7 +94,7 @@ foreach(explode(',', $showFields) as $field)
</td>
<?php endif;?>
<td class='text-left<?php echo zget($visibleFields, 'module')?>'>
<?php echo html::select("modules[$storyID]", $modules, $story->module, "class='form-control chosen'");?>
<?php echo html::select("modules[$storyID]", $modules[$story->branch], $story->module, "class='form-control chosen'");?>
</td>
<td class='text-left<?php echo zget($visibleFields, 'plan', ' hidden')?>'>
<?php
+24 -6
View File
@@ -865,7 +865,6 @@ class testcase extends control
/* Set modules. */
$modules = $this->tree->getOptionMenu($libID, $viewType = 'caselib', $startModuleID = 0, $branch);
$modules = array('ditto' => $this->lang->testcase->ditto) + $modules;
$this->view->modules = $modules;
$this->view->title = $libraries[$libID] . $this->lang->colon . $this->lang->testcase->batchEdit;
@@ -877,11 +876,31 @@ class testcase extends control
if($product->type != 'normal') $branchProduct = true;
/* Set modules. */
$modules = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
$modules = array('ditto' => $this->lang->testcase->ditto) + $modules;
/* Set branches and modules. */
$branches = array();
$modules = array();
if($product->type != 'normal')
{
$branches = $this->loadModel('branch')->getPairs($productID);
if($branch === 'all')
{
$modules[0] = $this->tree->getOptionMenu($productID, $viewType = 'case', 0, $branch);
foreach($branches as $branchID => $branchName)
{
$modules[$branchID] = $this->tree->getOptionMenu($productID, $viewType = 'case', 0, $branchID);
}
}
else
{
$modules[$branch] = $this->tree->getOptionMenu($productID, $viewType = 'case', 0, $branch);
}
}
else
{
$modules[0] = $this->tree->getOptionMenu($productID, $viewType = 'case', 0, $branch);
}
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id);
$this->view->branches = $branches;
$this->view->modules = $modules;
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->title = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit;
@@ -906,7 +925,6 @@ class testcase extends control
$this->view->position[] = html::a($this->server->http_referer, $this->lang->my->testCase);
$this->view->title = $this->lang->testcase->batchEdit;
/* Set modules. */
$productIdList = array();
foreach($cases as $case) $productIdList[$case->product] = $case->product;
+3 -3
View File
@@ -67,6 +67,7 @@
<?php foreach($caseIDList as $caseID):?>
<?php
if(!isset($cases[$caseID])) continue;
$caseBranch = $cases[$caseID]->branch;
if((!$productID and !$cases[$caseID]->lib) or $app->tab != 'qa')
{
$product = $this->product->getByID($cases[$caseID]->product);
@@ -74,10 +75,9 @@
if($product->type != 'normal')
{
foreach($branches as $branchID => $branchName) $branches[$branchID] = '/' . $product->name . '/' . $branchName;
$branches = array('ditto' => $this->lang->story->ditto) + $branches;
}
$modules = $this->tree->getOptionMenu($cases[$caseID]->product, $viewType = 'case', 0, $cases[$caseID]->branch);
$modules[$caseBranch] = $this->tree->getOptionMenu($cases[$caseID]->product, $viewType = 'case', 0, $caseBranch);
}
?>
<tr class='text-center'>
@@ -103,7 +103,7 @@
<?php echo html::select("branches[$caseID]", $branches, $cases[$caseID]->branch, "class='form-control chosen' onchange='loadBranches($branchProductID, this.value, $caseID)', $disabled");?>
</td>
<?php endif;?>
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[$caseID]", $modules, $cases[$caseID]->module, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[$caseID]", $modules[$caseBranch], $cases[$caseID]->module, "class='form-control chosen'");?></td>
<td class='text-left<?php echo zget($visibleFields, 'story', ' hidden')?>' style='overflow:visible'><?php echo html::select("stories[$caseID]", $stories, $cases[$caseID]->story, "class='form-control chosen'");?></td>
<td style='overflow:visible' title='<?php echo $cases[$caseID]->title?>'>
<div class='input-group'>