* adjust for link case build

This commit is contained in:
pengjiangxiu
2017-03-16 10:29:17 +08:00
parent 70dae03a82
commit 91ebea1734
5 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -655,7 +655,7 @@ class testtask extends control
$this->view->position[] = $this->lang->testtask->common;
$this->view->position[] = $this->lang->testtask->linkCase;
$testTask = $this->testtask->getRelatedTestTasks($productID, $param);
$testTask = $this->testtask->getRelatedTestTasks($productID, $taskID);
/* Get cases. */
$cases = $this->testtask->getLinkableCases($productID, $task, $taskID, $type, $param, $pager);
+1 -1
View File
@@ -74,7 +74,7 @@ $lang->testtask->priList[2] = '2';
$lang->testtask->priList[4] = '4';
$lang->testtask->unlinkedCases = '未关联';
$lang->testtask->linkByVersion = '按版本复制';
$lang->testtask->linkByVersion = '复制版本';
$lang->testtask->linkByStory = '按需求关联';
$lang->testtask->linkByBug = '按Bug关联';
$lang->testtask->linkBySuite = '按套件关联';
+3 -2
View File
@@ -203,7 +203,7 @@ class testtaskModel extends model
if($type == 'all') $cases = $this->getAllLinkableCases($task, $query, $linkedCases, $pager);
if($type == 'bystory') $cases = $this->getLinkableCasesByStory($productID, $task, $query, $linkedCases, $pager);
if($type == 'bybug') $cases = $this->getLinkableCasesByBug($productID, $task, $query, $linkedCases, $pager);
if($type == 'bysuite') $cases = $this->getLinkableCasesBySuite($productID, $query, $param, $linkedCases, $pager);
if($type == 'bysuite') $cases = $this->getLinkableCasesBySuite($productID, $task, $query, $param, $linkedCases, $pager);
if($type == 'bybuild') $cases = $this->getLinkableCasesByTestTask($param, $linkedCases, $pager);
return $cases;
@@ -296,6 +296,7 @@ class testtaskModel extends model
* Get linkable cases by suite.
*
* @param int $productID
* @param object $task
* @param string $query
* @param string $suite
* @param array $linkedCases
@@ -303,7 +304,7 @@ class testtaskModel extends model
* @access public
* @return array
*/
public function getLinkableCasesBySuite($productID, $query, $suite, $linkedCases, $pager)
public function getLinkableCasesBySuite($productID, $task, $query, $suite, $linkedCases, $pager)
{
return $this->dao->select('t1.*,t2.version as version')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_SUITECASE)->alias('t2')->on('t1.id=t2.case')
+1 -1
View File
@@ -48,7 +48,7 @@
<div class='actions'>
<?php
echo "<div class='btn-group'>";
common::printIcon('testtask', 'linkCase', "taskID=$task->id&type=all&param=$taskID", '', 'button', 'link');
common::printIcon('testtask', 'linkCase', "taskID=$task->id", '', 'button', 'link');
common::printIcon('testcase', 'export', "productID=$productID&orderBy=`case`_desc&taskID=$task->id", '', 'button', '', '', 'iframe export');
echo '</div>';
echo "<div class='btn-group'>";
+16 -17
View File
@@ -22,23 +22,6 @@
$lang->testtask->linkCase = $lang->testtask->linkByStory;
common::printIcon('testtask', 'linkCase', "taskID=$taskID&type=bystory", '', 'button', '', '', 'btn-primary btn-sm');
echo "<span class='dropdown'>";
echo "<button class='btn btn-primary btn-sm' type='button' data-toggle='dropdown'>{$lang->testtask->linkByVersion} <span class='caret'></span></button>";
echo "<ul class='dropdown-menu' style='max-height:240px;overflow-y:auto'>";
if($testTask)
{
foreach($testTask as $tmpID => $tmpTitle)
{
$active = ($type == 'bybuild' and (int)$param == $tmpID) ? "class='active'" : '';
echo "<li $active>" . html::a(inlink('linkCase', "taskID=$taskID&type=bybuild&param=$tmpID"), $tmpTitle) . "</li>";
}
}
else
{
echo "<li>" . html::a('###', $lang->testtask->noticeNoOther) . "</li>";
}
echo "</ul></span>";
echo "<span class='dropdown'>";
echo "<button class='btn btn-primary btn-sm' type='button' data-toggle='dropdown'>{$lang->testtask->linkBySuite} <span class='caret'></span></button>";
echo "<ul class='dropdown-menu' style='max-height:240px;overflow-y:auto'>";
@@ -58,6 +41,22 @@
}
echo "</ul></span>";
echo "<span class='dropdown'>";
echo "<button class='btn btn-primary btn-sm' type='button' data-toggle='dropdown'>{$lang->testtask->linkByVersion} <span class='caret'></span></button>";
echo "<ul class='dropdown-menu' style='max-height:240px;overflow-y:auto'>";
if($testTask)
{
foreach($testTask as $tmpID => $tmpTitle)
{
$active = ($type == 'bybuild' and (int)$param == $tmpID) ? "class='active'" : '';
echo "<li $active>" . html::a(inlink('linkCase', "taskID=$taskID&type=bybuild&param=$tmpID"), $tmpTitle) . "</li>";
}
}
else
{
echo "<li>" . html::a('###', $lang->testtask->noticeNoOther) . "</li>";
}
echo "</ul></span>";
//$lang->testtask->linkCase = $lang->testtask->linkByBug;
//common::printIcon('testtask', 'linkCase', "taskID=$taskID&type=bybug", '', 'button', 'link');
?>