* code for task#981.

This commit is contained in:
zhujinyong
2012-12-12 00:44:35 +00:00
parent ef70f537e5
commit 1bb978909d
4 changed files with 38 additions and 0 deletions

View File

@@ -41,6 +41,8 @@ $lang->testcase->stage = 'Stage';
$lang->testcase->lastEditedByAB = 'Last edited by';
$lang->testcase->lastEditedDateAB = 'Last edited date';
$lang->testcase->allProduct = 'All product';
$lang->testcase->fromBug = 'From bug';
$lang->testcase->toBug = 'To bug';
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
$lang->testcase->stepID = 'ID';

View File

@@ -41,6 +41,8 @@ $lang->testcase->stage = '适用阶段';
$lang->testcase->lastEditedByAB = '修改者';
$lang->testcase->lastEditedDateAB = '修改日期';
$lang->testcase->allProduct = '所有产品';
$lang->testcase->fromBug = '来源Bug';
$lang->testcase->toBug = '生成Bug';
$lang->case = $lang->testcase; // 用于DAO检查时使用。因为case是系统关键字所以无法定义该模块为case只能使用testcase但表还是使用的case。
$lang->testcase->stepID = '编号';

View File

@@ -160,6 +160,19 @@ class testcaseModel extends model
$case->storyStatus = $story->status;
$case->latestStoryVersion = $story->version;
}
/* Get fromBugName and toBugs. */
$case->fromBugName = '';
$case->toBugs = array();
if($case->fromBug)
{
$bug = $this->dao->findById($case->fromBug)->from(TABLE_BUG)->fields('title')->fetch();
$case->fromBugName = $bug->title;
}
$toBugs = $this->dao->select('id, title')->from(TABLE_BUG)->where('`case`')->eq($caseID)->fetchAll();
foreach($toBugs as $toBug) $case->toBugs[$toBug->id] = $toBug->title;
if($case->linkCase) $case->linkCaseTitles = $this->dao->select('id,title')->from(TABLE_CASE)->where('id')->in($case->linkCase)->fetchPairs();
if($version == 0) $version = $case->version;
$case->steps = $this->dao->select('*')->from(TABLE_CASESTEP)->where('`case`')->eq($caseID)->andWhere('version')->eq($version)->orderBy('id')->fetchAll();

View File

@@ -182,6 +182,27 @@
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testcase->legendLinkBugs;?></legend>
<table class='table-1 a-left'>
<tr>
<td class='rowhead w-p20'><?php echo $lang->testcase->fromBug;?></td>
<td><?php echo html::a($this->createLink('bug', 'view', "bugID=$case->fromBug"), $case->fromBugName);?></td>
</tr>
<tr>
<td valign="top" class='rowhead w-p20'><?php echo $lang->testcase->toBug;?></td>
<td>
<?php
foreach($case->toBugs as $bugID => $bug)
{
echo '<p style="margin-bottom:0;">' . html::a($this->createLink('bug', 'view', "bugID=$bugID"), $bug) . '</p>';
}
?>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->testcase->legendOpenAndEdit;?></legend>
<table class='table-1 a-left'>