diff --git a/trunk/module/bug/control.php b/trunk/module/bug/control.php index 5b0d0acff9..f35404d7d3 100644 --- a/trunk/module/bug/control.php +++ b/trunk/module/bug/control.php @@ -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 = '') { diff --git a/trunk/module/bug/lang/zh-cn.php b/trunk/module/bug/lang/zh-cn.php index 371d894fea..e4a56635d7 100644 --- a/trunk/module/bug/lang/zh-cn.php +++ b/trunk/module/bug/lang/zh-cn.php @@ -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 = '产品模块'; diff --git a/trunk/module/bug/model.php b/trunk/module/bug/model.php index c202e95606..28945b3b4e 100644 --- a/trunk/module/bug/model.php +++ b/trunk/module/bug/model.php @@ -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') diff --git a/trunk/module/bug/view/browse.html.php b/trunk/module/bug/view/browse.html.php index 56a2f08387..6c66816289 100644 --- a/trunk/module/bug/view/browse.html.php +++ b/trunk/module/bug/view/browse.html.php @@ -60,7 +60,8 @@ function browseBySearch(active) echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=longLifeBugs¶m=0"), $lang->bug->longLifeBugs) . ""; echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=postponedBugs¶m=0"), $lang->bug->postponedBugs) . ""; echo "{$lang->bug->byQuery} "; - echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=all¶m=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->bug->allBugs) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=all¶m=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->bug->allBugs) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=needconfirm¶m=0"), $lang->bug->needConfirm) . ""; ?>
@@ -91,11 +92,17 @@ function browseBySearch(active) bug->id);?> bug->severity);?> bug->pri);?> - bug->title);?> + bug->title);?> + + bug->story);?> + actions;?> + + bug->story);?> bug->openedBy);?> bug->assignedTo);?> bug->resolvedBy);?> bug->resolution);?> + @@ -105,10 +112,15 @@ function browseBySearch(active) bug->severityList[$bug->severity]?> bug->priList[$bug->pri]?> title;?> + + createLink('story', 'view', "stoyID=$bug->story"), $bug->storyTitle, '_blank');?> + id"), $lang->confirm, 'hiddenwin')?> + openedBy];?> assignedTo == $this->app->user->account) echo 'style=color:red';?>>assignedTo];?> resolvedBy];?> bug->resolutionList[$bug->resolution];?> + diff --git a/trunk/module/bug/view/view.html.php b/trunk/module/bug/view/view.html.php index ed184d2268..2de2f46af8 100644 --- a/trunk/module/bug/view/view.html.php +++ b/trunk/module/bug/view/view.html.php @@ -180,7 +180,17 @@ bug->story;?> - story) echo html::a($this->createLink('story', 'view', "storyID=$bug->story"), $bug->storyTitle);?> + + story) echo html::a($this->createLink('story', 'view', "storyID=$bug->story"), $bug->storyTitle); + if($bug->storyStatus == 'active' and $bug->latestStoryVersion > $bug->storyVersion) + { + echo "({$lang->story->changed} "; + echo html::a($this->createLink('bug', 'confirmStoryChange', "bugID=$bug->id"), $lang->confirm, 'hiddenwin'); + echo ")"; + } + ?> + bug->task;?> diff --git a/trunk/module/task/model.php b/trunk/module/task/model.php index 827a1992fb..5d0708a783 100644 --- a/trunk/module/task/model.php +++ b/trunk/module/task/model.php @@ -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)