+ add the feature of confirm story changed bugs.

This commit is contained in:
wangchunsheng
2010-03-30 03:45:21 +00:00
parent 39d41a3103
commit f3222d547b
6 changed files with 45 additions and 5 deletions

View File

@@ -105,6 +105,14 @@ class bug extends control
{
$bugs = $this->dao->findByResolution('postponed')->from(TABLE_BUG)->andWhere('product')->eq($productID)->orderBy($orderBy)->page($pager)->fetchAll();
}
elseif($browseType == 'needconfirm')
{
$bugs = $this->dao->select('t1.*, t2.title AS storyTitle')->from(TABLE_BUG)->alias('t1')->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->where("t2.status = 'active'")
->andWhere('t2.version > t1.storyVersion')
->orderBy($orderBy)
->fetchAll();
}
elseif($browseType == 'bysearch')
{
if($this->session->bugQuery == false) $this->session->set('bugQuery', ' 1 = 1');
@@ -407,6 +415,15 @@ class bug extends control
$this->display();
}
/* 确认需求变动。*/
public function confirmStoryChange($bugID)
{
$bug = $this->bug->getById($bugID);
$this->dao->update(TABLE_BUG)->set('storyVersion')->eq($bug->latestStoryVersion)->where('id')->eq($bugID)->exec();
$this->loadModel('action')->create('bug', $bugID, 'confirmed', '', $bug->latestStoryVersion);
die(js::reload('parent'));
}
/* 获得用户的bug列表。*/
public function ajaxGetUserBugs($account = '')
{

View File

@@ -44,6 +44,7 @@ $lang->bug->postponedBugs = '被延期';
$lang->bug->allBugs = '所有Bug';
$lang->bug->moduleBugs = '按模块浏览';
$lang->bug->byQuery = '搜索';
$lang->bug->needConfirm = '需求有变动的Bug';
$lang->bug->allProduct = '所有产品';
$lang->bug->lblProductAndModule = '产品模块';

View File

@@ -73,7 +73,7 @@ class bugModel extends model
/* 获取一个bug的详细信息。*/
public function getById($bugID)
{
$bug = $this->dao->select('t1.*, t2.name AS projectName, t3.title AS storyTitle, t4.name AS taskName')
$bug = $this->dao->select('t1.*, t2.name AS projectName, t3.title AS storyTitle, t3.status AS storyStatus, t3.version AS latestStoryVersion, t4.name AS taskName')
->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->leftJoin(TABLE_STORY)->alias('t3')->on('t1.story = t3.id')

View File

@@ -60,7 +60,8 @@ function browseBySearch(active)
echo "<span id='longlifebugsTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=longLifeBugs&param=0"), $lang->bug->longLifeBugs) . "</span>";
echo "<span id='postponedbugsTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=postponedBugs&param=0"), $lang->bug->postponedBugs) . "</span>";
echo "<span id='bysearchTab' onclick=\"browseBySearch('$browseType')\">{$lang->bug->byQuery}</span> ";
echo "<span id='allTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=all&param=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->bug->allBugs) . "</span>";
echo "<span id='allTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=all&param=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->bug->allBugs) . "</span>";
echo "<span id='needconfirmTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=needconfirm&param=0"), $lang->bug->needConfirm) . "</span>";
?>
</div>
<div class='f-right'>
@@ -91,11 +92,17 @@ function browseBySearch(active)
<th><?php common::printOrderLink('id', $orderBy, $vars, $lang->bug->id);?></th>
<th><?php common::printOrderLink('severity', $orderBy, $vars, $lang->bug->severity);?></th>
<th><?php common::printOrderLink('pri', $orderBy, $vars, $lang->bug->pri);?></th>
<th class='w-p50'><?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
<th class='w-p40'><?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
<?php if($browseType == 'needconfirm'):?>
<th class='w-p40'><?php common::printOrderLink('story', $orderBy, $vars, $lang->bug->story);?></th>
<th><?php echo $lang->actions;?></th>
<?php else:?>
<th><?php common::printOrderLink('story', $orderBy, $vars, $lang->bug->story);?></th>
<th><?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->bug->openedBy);?></th>
<th><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->bug->assignedTo);?></th>
<th><?php common::printOrderLink('resolvedBy', $orderBy, $vars, $lang->bug->resolvedBy);?></th>
<th><?php common::printOrderLink('resolution', $orderBy, $vars, $lang->bug->resolution);?></th>
<?php endif;?>
</tr>
</thead>
<tbody>
@@ -105,10 +112,15 @@ function browseBySearch(active)
<td><?php echo $lang->bug->severityList[$bug->severity]?></td>
<td><?php echo $lang->bug->priList[$bug->pri]?></td>
<td class='a-left nobr'><?php echo $bug->title;?></td>
<?php if($browseType == 'needconfirm'):?>
<td class='a-left nobr'><?php echo html::a($this->createLink('story', 'view', "stoyID=$bug->story"), $bug->storyTitle, '_blank');?></td>
<td><?php echo html::a(inlink('confirmStoryChange', "bugID=$bug->id"), $lang->confirm, 'hiddenwin')?></td>
<?php else:?>
<td><?php echo $users[$bug->openedBy];?></td>
<td <?php if($bug->assignedTo == $this->app->user->account) echo 'style=color:red';?>><?php echo $users[$bug->assignedTo];?></td>
<td><?php echo $users[$bug->resolvedBy];?></td>
<td><?php echo $lang->bug->resolutionList[$bug->resolution];?></td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>

View File

@@ -180,7 +180,17 @@
</tr>
<tr>
<td class='rowhead'><?php echo $lang->bug->story;?></td>
<td><?php if($bug->story) echo html::a($this->createLink('story', 'view', "storyID=$bug->story"), $bug->storyTitle);?></td>
<td>
<?php
if($bug->story) echo html::a($this->createLink('story', 'view', "storyID=$bug->story"), $bug->storyTitle);
if($bug->storyStatus == 'active' and $bug->latestStoryVersion > $bug->storyVersion)
{
echo "(<span class='warning'>{$lang->story->changed}</span> ";
echo html::a($this->createLink('bug', 'confirmStoryChange', "bugID=$bug->id"), $lang->confirm, 'hiddenwin');
echo ")";
}
?>
</td>
</tr>
<tr>
<td class='rowhead'><?php echo $lang->bug->task;?></td>

View File

@@ -123,7 +123,7 @@ class taskModel extends model
->leftJoin(TABLE_USER)->alias('t3')
->on('t1.owner = t3.account')
->where('t1.project')->eq((int)$projectID)
->onCaseOf($status == 'needConfirm')->andWhere('t2.version > t1.storyVersion')->andWhere('t2.status = "active"')->endCase()
->onCaseOf($status == 'needConfirm')->andWhere('t2.version > t1.storyVersion')->andWhere("t2.status = 'active'")->endCase()
->onCaseOf($status != 'all' and $status != 'needConfirm')->andWhere('t1.status')->in($status)->endCase()
->orderBy($orderBy)
->page($pager)