productplan->basicInfo;?>
diff --git a/module/program/model.php b/module/program/model.php
index d8ebcb9a45..a604c600a4 100644
--- a/module/program/model.php
+++ b/module/program/model.php
@@ -615,7 +615,9 @@ class programModel extends model
->andWhere('t1.openedBy', true)->eq($this->app->user->account)
->orWhere('t1.PM')->eq($this->app->user->account)
->orWhere('t2.account')->eq($this->app->user->account)
- ->orWhere('t3.user')->eq($this->app->user->account)
+ ->orWhere('(t3.user')->eq($this->app->user->account)
+ ->andWhere('t3.deleted')->eq(0)
+ ->markRight(1)
->orWhere("CONCAT(',', t1.whitelist, ',')")->like("%,{$this->app->user->account},%")
->markRight(1)
->fi()
diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php
index 93526300db..117b8a131b 100755
--- a/module/programplan/view/gantt.html.php
+++ b/module/programplan/view/gantt.html.php
@@ -107,8 +107,8 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
- createLink('project', 'execution', "status=all&projectID=$projectID")," ", '', "class='btn btn-icon switchBtn' title='{$lang->project->bylist}'");?>
", '', "class='btn btn-icon text-primary switchBtn' title='{$lang->programplan->gantt}'");?>
+ createLink('project', 'execution', "status=all&projectID=$projectID")," ", '', "class='btn btn-icon switchBtn' title='{$lang->project->bylist}'");?>
programplan->full;?>
diff --git a/module/project/view/execution.html.php b/module/project/view/execution.html.php
index 05e9c4cb9a..219f2c8bf3 100644
--- a/module/project/view/execution.html.php
+++ b/module/project/view/execution.html.php
@@ -45,8 +45,8 @@
model == 'waterfall' and $this->config->edition == 'max'):?>
'>
parent < 0 ? "disabled='disabled'" : '';?>
- product][$story->branch]) ? array('' => '') + $plans[$story->product][$story->branch] : '', $story->plan, "class='form-control picker-select' data-drop-width='auto' $planDisabled");?>
+ '') + $plans : '', $story->plan, "class='form-control picker-select' data-drop-width='auto' $planDisabled");?>
diff --git a/module/testcase/config.php b/module/testcase/config.php
index 26acbca266..283c36ac00 100644
--- a/module/testcase/config.php
+++ b/module/testcase/config.php
@@ -37,6 +37,7 @@ $config->testcase->excludeCheckFileds = ',pri,type,stage,needReview,story,branch
global $lang;
$config->testcase->search['module'] = 'testcase';
$config->testcase->search['fields']['title'] = $lang->testcase->title;
+$config->testcase->search['fields']['story'] = $lang->testcase->linkStory;
$config->testcase->search['fields']['id'] = $lang->testcase->id;
$config->testcase->search['fields']['keywords'] = $lang->testcase->keywords;
$config->testcase->search['fields']['lastEditedBy'] = $lang->testcase->lastEditedByAB;
@@ -58,6 +59,7 @@ $config->testcase->search['fields']['openedDate'] = $lang->testcase->openedD
$config->testcase->search['fields']['lastEditedDate'] = $lang->testcase->lastEditedDateAB;
$config->testcase->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
+$config->testcase->search['params']['story'] = array('operator' => 'include', 'control' => 'select', 'values' => '');
$config->testcase->search['params']['module'] = array('operator' => 'belong', 'control' => 'select', 'values' => 'modules');
$config->testcase->search['params']['keywords'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->testcase->search['params']['lastEditedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
diff --git a/module/testcase/lang/de.php b/module/testcase/lang/de.php
index 74a751fc47..2f5bb81309 100644
--- a/module/testcase/lang/de.php
+++ b/module/testcase/lang/de.php
@@ -13,6 +13,7 @@ $lang->testcase->id = 'ID';
$lang->testcase->product = $lang->productCommon;
$lang->testcase->project = 'Project';
$lang->testcase->execution = 'Execution';
+$lang->testcase->linkStory = 'linkStory';
$lang->testcase->module = 'Module';
$lang->testcase->auto = 'Test Automation Cases';
$lang->testcase->frame = 'Test Automation Cramework';
diff --git a/module/testcase/lang/en.php b/module/testcase/lang/en.php
index eff259962d..5615527217 100644
--- a/module/testcase/lang/en.php
+++ b/module/testcase/lang/en.php
@@ -13,6 +13,7 @@ $lang->testcase->id = 'ID';
$lang->testcase->product = $lang->productCommon;
$lang->testcase->project = 'Project';
$lang->testcase->execution = 'Execution';
+$lang->testcase->linkStory = 'linkStory';
$lang->testcase->module = 'Module';
$lang->testcase->auto = 'Test Automation Cases';
$lang->testcase->frame = 'Test Automation Cramework';
diff --git a/module/testcase/lang/fr.php b/module/testcase/lang/fr.php
index bf74a1402e..d124bc8831 100644
--- a/module/testcase/lang/fr.php
+++ b/module/testcase/lang/fr.php
@@ -13,6 +13,7 @@ $lang->testcase->id = 'ID';
$lang->testcase->product = $lang->productCommon;
$lang->testcase->project = 'Project';
$lang->testcase->execution = 'Execution';
+$lang->testcase->linkStory = 'linkStory';
$lang->testcase->module = 'Module';
$lang->testcase->auto = 'Test Automation Cases';
$lang->testcase->frame = 'Test Automation Cramework';
diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php
index 835cedb468..956d9281f3 100644
--- a/module/testcase/lang/zh-cn.php
+++ b/module/testcase/lang/zh-cn.php
@@ -13,6 +13,7 @@ $lang->testcase->id = '用例编号';
$lang->testcase->product = "所属{$lang->productCommon}";
$lang->testcase->project = '所属项目';
$lang->testcase->execution = '所属执行';
+$lang->testcase->linkStory = '关联需求';
$lang->testcase->module = '所属模块';
$lang->testcase->auto = '自动化测试用例';
$lang->testcase->frame = '自动化测试框架';
diff --git a/module/testtask/control.php b/module/testtask/control.php
index 963563ae4b..9ef4dd658f 100644
--- a/module/testtask/control.php
+++ b/module/testtask/control.php
@@ -1059,6 +1059,11 @@ class testtask extends control
* Link cases to a test task.
*
* @param int $taskID
+ * @param string $type
+ * @param int $param
+ * @param int $recTotal
+ * @param int $recPerPage
+ * @param int $pageID
* @access public
* @return void
*/
@@ -1107,7 +1112,21 @@ class testtask extends control
$this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID=$taskID&type=$type¶m=$param");
$this->config->testcase->search['style'] = 'simple';
+ $build = $this->loadModel('build')->getByID($task->build);
+ $stories = array();
+ if($build)
+ {
+ $stories = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($build->stories)->fetchPairs();
+ $this->config->testcase->search['params']['story']['values'] = $stories;
+ $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story');
+ }
+
if($product->shadow) unset($this->config->testcase->search['fields']['product']);
+ if($type != 'bystory')
+ {
+ unset($this->config->testcase->search['fields']['story']);
+ unset($this->config->testcase->search['params']['story']);
+ }
if($task->productType == 'normal')
{
unset($this->config->testcase->search['fields']['branch']);
diff --git a/module/testtask/model.php b/module/testtask/model.php
index a1324c153a..8042ca6da4 100755
--- a/module/testtask/model.php
+++ b/module/testtask/model.php
@@ -399,18 +399,20 @@ class testtaskModel extends model
{
$stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories');
$cases = array();
+ $query = preg_replace('/`(\w+)`/', 't1.`$1`', $query);
if($stories)
{
- $cases = $this->dao->select('*')->from(TABLE_CASE)
+ $cases = $this->dao->select('t1.*,t2.title as storyTitle')->from(TABLE_CASE)->alias('t1')
+ ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->where($query)
- ->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('project')->eq($this->session->project)->fi()
- ->andWhere('product')->eq($productID)
- ->andWhere('status')->ne('wait')
- ->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
- ->beginIF($task->branch !== '')->andWhere('branch')->in("0,$task->branch")->fi()
- ->andWhere('story')->in(trim($stories, ','))
- ->andWhere('deleted')->eq(0)
- ->orderBy('id desc')
+ ->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
+ ->andWhere('t1.product')->eq($productID)
+ ->andWhere('t1.status')->ne('wait')
+ ->beginIF($linkedCases)->andWhere('t1.id')->notIN($linkedCases)->fi()
+ ->beginIF($task->branch !== '')->andWhere('t1.branch')->in("0,$task->branch")->fi()
+ ->andWhere('t1.story')->in(trim($stories, ','))
+ ->andWhere('t1.deleted')->eq(0)
+ ->orderBy('t1.id desc')
->page($pager)
->fetchAll();
}
diff --git a/module/testtask/view/linkcase.html.php b/module/testtask/view/linkcase.html.php
index e052cb5e1b..c79a193708 100644
--- a/module/testtask/view/linkcase.html.php
+++ b/module/testtask/view/linkcase.html.php
@@ -86,6 +86,7 @@
testtask->linkVersion;?>
priAB;?>
testcase->title;?>
+ testcase->linkStory;?>
testcase->type;?>
openedByAB;?>
testtask->lastRunAccount;?>
@@ -112,6 +113,7 @@
echo ')';
?>
+ story and $case->storyTitle) echo html::a(helper ::createLink('story', 'view', "storyID=$case->story"), $case->storyTitle);?>
testcase->typeList[$case->type];?>
openedBy);?>
lastRunner);?>
- ", '', "class='btn btn-icon text-primary switchBtn' title='{$lang->project->bylist}'");?>
createLink('programplan', 'browse', "projectID=$projectID&productID=$productID&type=gantt"), " ", '', "class='btn btn-icon switchBtn' title='{$lang->programplan->gantt}'");?>
+ ", '', "class='btn btn-icon text-primary switchBtn' title='{$lang->project->bylist}'");?>
" . $lang->export, '', "class='btn btn-link export'")?>
diff --git a/module/release/js/view.js b/module/release/js/view.js
index 3fe9cdb5b1..e14f125052 100644
--- a/module/release/js/view.js
+++ b/module/release/js/view.js
@@ -10,9 +10,9 @@ function showLink(releaseID, type, param)
/**
* Load URL.
- *
- * @param string $url
- * @param string$type
+ *
+ * @param string $url
+ * @param string$type
* @access public
* @return void
*/
@@ -68,5 +68,26 @@ $(function()
infoShowed = true;
}
+ if(href !== '')
+ {
+ switch(href)
+ {
+ case '#stories':
+ type = 'story';
+ break;
+ case '#bugs':
+ type = 'bug';
+ break;
+ case '#leftBugs':
+ type = 'leftBug';
+ break;
+ case '#releaseInfo':
+ type = 'releaseInfo';
+ break;
+ }
+ var viewLink = createLink('release', 'view', 'releaseID=' + releaseID + '&type=' + type + '&link=' + link + (typeof(param) == 'undefined' ? '' : param) + (typeof(orderBy) == 'undefined' ? '' : "&orderBy=" + orderBy));
+ if(type == 'releaseInfo') viewLink = createLink('release', 'view', 'releaseID=' + releaseID + '&type=' + type);
+ self.location.href = viewLink;
+ }
});
})
diff --git a/module/story/control.php b/module/story/control.php
index 632789009f..fa206cde03 100755
--- a/module/story/control.php
+++ b/module/story/control.php
@@ -1143,6 +1143,7 @@ class story extends control
/* Append module when change product type. */
$moduleList = array(0 => '/');
$productStoryList = array();
+ $storyPlans = array();
foreach($stories as $story)
{
if(isset($modules[$story->product][$story->branch]))
@@ -1160,6 +1161,18 @@ class story extends control
$branch = $storyProduct->type == 'branch' ? ($story->branch > 0 ? $story->branch : '0') : 'all';
if(!isset($productStoryList[$story->product][$story->branch])) $productStoryList[$story->product][$story->branch] = $this->story->getProductStoryPairs($story->product, $branch, 0, 'all', 'id_desc', 0, '', $story->type);
}
+
+ if(isset($plans[$story->product][$story->branch]) and zget($plans[$story->product][$story->branch], $story->plan))
+ {
+ $storyPlans = $plans[$story->product][$story->branch];
+ $planInfo = $this->dao->select('id,title,begin,end')->from(TABLE_PRODUCTPLAN)->where('id')->eq($story->plan)->fetchAll('id');
+
+ $storyPlans[$story->plan] = $planInfo[$story->plan]->title . ' [' . $planInfo[$story->plan]->begin . '~' . $planInfo[$story->plan]->end . ']';
+ }
+ else
+ {
+ $storyPlans = $plans;
+ }
}
$this->view->title = $this->lang->story->batchEdit;
@@ -1173,7 +1186,7 @@ class story extends control
$this->view->branchProduct = $branchProduct;
$this->view->storyIdList = $storyIdList;
$this->view->branch = $branch;
- $this->view->plans = array('' => '') + $plans;
+ $this->view->plans = array('' => '') + $storyPlans;
$this->view->storyType = $storyType;
$this->view->stories = $stories;
$this->view->executionID = $executionID;
diff --git a/module/story/view/batchedit.html.php b/module/story/view/batchedit.html.php
index aa4c55ddd8..b0145dcd3b 100644
--- a/module/story/view/batchedit.html.php
+++ b/module/story/view/batchedit.html.php
@@ -85,7 +85,7 @@ foreach(explode(',', $showFields) as $field)