diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php
index d2801c95f9..efeb8c9841 100644
--- a/module/common/lang/menu.php
+++ b/module/common/lang/menu.php
@@ -273,29 +273,24 @@ $lang->execution->dividerMenu = ',story,build,settings,';
/* QA menu.*/
$lang->qa->menu = new stdclass();
$lang->qa->menu->index = array('link' => "$lang->dashboard|qa|index");
-$lang->qa->menu->bug = array('link' => "{$lang->bug->common}|bug|browse|productID=%s", 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,batchactivate,confirmbug,assignto');
-$lang->qa->menu->testcase = array('link' => "{$lang->testcase->shortCommon}|testcase|browse|productID=%s", 'subModule' => 'testsuite,caselib');
-$lang->qa->menu->testtask = array('link' => "{$lang->testtask->common}|testtask|browse|productID=%s", 'subModule' => 'testreport', 'alias' => 'view,edit,linkcase,cases,start,close,batchrun,groupcase,report,importunitresult');
-$lang->qa->menu->automation = array('link' => "{$lang->automation->common}|automation|browse|productID=%s", 'alias' => '');
+$lang->qa->menu->bug = array('link' => "{$lang->bug->common}|bug|browse|productID=%s", 'subModule' => 'bug');
+$lang->qa->menu->testcase = array('link' => "{$lang->testcase->shortCommon}|testcase|browse|productID=%s", 'subModule' => 'testcase,story');
+$lang->qa->menu->testsuite = array('link' => "{$lang->testcase->testsuite}|testsuite|browse|productID=%s", 'subModule' => 'testsuite');
+$lang->qa->menu->testtask = array('link' => "{$lang->testtask->common}|testtask|browse|productID=%s", 'subModule' => 'testtask', 'alias' => 'view,edit,linkcase,cases,start,close,batchrun,groupcase,report,importunitresult');
+$lang->qa->menu->report = array('link' => "{$lang->testreport->common}|testreport|browse|productID=%s", 'subModule' => 'testreport');
+$lang->qa->menu->caselib = array('link' => "{$lang->testcase->caselib}|caselib|browse|libID=0", 'subModule' => 'caselib');
+$lang->qa->menu->automation = array('link' => "{$lang->automation->common}|automation|browse|productID=%s", 'subModule' => 'automation', 'alias' => '');
/* QA menu order. */
$lang->qa->menuOrder[5] = 'product';
$lang->qa->menuOrder[10] = 'index';
$lang->qa->menuOrder[15] = 'bug';
$lang->qa->menuOrder[20] = 'testcase';
-$lang->qa->menuOrder[25] = 'testtask';
-$lang->qa->menuOrder[30] = 'report';
-$lang->qa->menuOrder[35] = 'testsuite';
+$lang->qa->menuOrder[25] = 'testsuite';
+$lang->qa->menuOrder[30] = 'testtask';
+$lang->qa->menuOrder[35] = 'report';
$lang->qa->menuOrder[40] = 'caselib';
-
-$lang->qa->menu->testcase['subMenu'] = new stdclass();
-$lang->qa->menu->testcase['subMenu']->case = array('link' => "{$lang->testcase->case}|testcase|browse|productID=%s", 'subModule' => 'testcase,story');
-$lang->qa->menu->testcase['subMenu']->caselib = array('link' => "{$lang->testcase->caselib}|caselib|browse|libID=0", 'subModule' => 'caselib');
-$lang->qa->menu->testcase['subMenu']->testsuite = array('link' => "{$lang->testcase->testsuite}|testsuite|browse|productID=%s", 'subModule' => 'testsuite');
-
-$lang->qa->menu->testtask['subMenu'] = new stdclass();
-$lang->qa->menu->testtask['subMenu']->testtask = array('link' => "{$lang->testtask->common}|testtask|browse|productID=%s", 'subModule' => 'testtask', 'alias' => 'linkcase,cases,start,close,batchrun,groupcase,report,importunitresult');
-$lang->qa->menu->testtask['subMenu']->report = array('link' => "{$lang->testreport->common}|testreport|browse|productID=%s", 'subModule' => 'testreport');
+$lang->qa->menuOrder[45] = 'automation';
// $lang->qa->menu->automation['subMenu'] = new stdclass();
// $lang->qa->menu->automation['subMenu']->browse = array('link' => "{$lang->intro}|automation|browse|productID=%s", 'alias' => '');
@@ -304,6 +299,8 @@ $lang->qa->menu->testtask['subMenu']->report = array('link' => "{$lang->testre
// $lang->qa->menu->automation['subMenu']->interface = array('link' => '接口|automation|interface|productID=%s', 'alias' => '');
// $lang->qa->menu->automation['subMenu']->environment = array('link' => '环境|automation|environment|productID=%s', 'alias' => '');
+$lang->qa->dividerMenu = ',bug,testtask,caselib,';
+
/* DevOps menu. */
$lang->devops->menu = new stdclass();
$lang->devops->menu->code = array('link' => "{$lang->repo->common}|repo|browse|repoID=%s", 'alias' => 'diff,view,revision,log,blame,showsynccomment');
diff --git a/module/common/model.php b/module/common/model.php
index 772319dc19..142ed53a0f 100644
--- a/module/common/model.php
+++ b/module/common/model.php
@@ -1772,6 +1772,7 @@ EOD;
if(!commonModel::hasDBPriv($object, $module, $method)) return false;
if(empty($acls['views'])) return true;
+ $menu = isset($lang->navGroup->$module) ? $lang->navGroup->$module : $module;
$menu = strtolower($menu);
if($menu != 'qa' and !isset($lang->$menu->menu)) return true;
if($menu == 'my' or $menu == 'index' or $module == 'tree') return true;
diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php
index bd0830d890..33295a17e3 100644
--- a/module/execution/lang/zh-cn.php
+++ b/module/execution/lang/zh-cn.php
@@ -220,6 +220,7 @@ $lang->execution->importPlanStory = '创建' . $lang->executionCommon . '成
$lang->execution->iteration = '版本迭代';
$lang->execution->iterationInfo = '迭代%s次';
$lang->execution->viewAll = '查看所有';
+$lang->execution->testreport = '测试报告';
/* 分组浏览。*/
$lang->execution->allTasks = '所有';
diff --git a/module/product/model.php b/module/product/model.php
index 5d6516250e..bb6763518f 100644
--- a/module/product/model.php
+++ b/module/product/model.php
@@ -425,7 +425,7 @@ class productModel extends model
/* init currentModule and currentMethod for report and story. */
if($currentModule == 'story')
{
- $storyMethods = ",track,create,batchcreate,batchclose,";
+ $storyMethods = ",track,create,batchcreate,batchclose,zerocase,";
if(strpos($storyMethods, "," . $currentMethod . ",") === false) $currentModule = 'product';
if($currentMethod == 'view' || $currentMethod == 'change' || $currentMethod == 'review') $currentMethod = 'browse';
}
diff --git a/module/qa/model.php b/module/qa/model.php
index 23d6b45815..0737fccc04 100644
--- a/module/qa/model.php
+++ b/module/qa/model.php
@@ -23,22 +23,7 @@ class qaModel extends model
*/
public function setMenu($products, $productID, $branch = 0, $extra = '')
{
- $selectHtml = $this->loadModel('product')->select($products, $productID, 'qa', 'index', $extra, $branch);
-
- $productIndex = '';
- $isMobile = $this->app->viewType == 'mhtml';
- if($isMobile)
- {
- $productIndex = html::a(helper::createLink('qa', 'index'), $this->lang->qa->index) . $this->lang->colon;
- $productIndex .= $selectHtml;
- }
- else
- {
- $currentMethod = $this->app->getMethodName();
- $productIndex .= $selectHtml;
- }
-
- if(!in_array($this->app->rawModule, $this->config->qa->noDropMenuModule)) $this->lang->switcherMenu = $this->product->getSwitcher($productID, $extra, $branch);
+ if(!in_array($this->app->rawModule, $this->config->qa->noDropMenuModule)) $this->lang->switcherMenu = $this->loadModel('product')->getSwitcher($productID, $extra, $branch);
common::setMenuVars('qa', $productID);
}
diff --git a/module/story/control.php b/module/story/control.php
index 3caa1c464c..e0b2288b8e 100644
--- a/module/story/control.php
+++ b/module/story/control.php
@@ -655,7 +655,6 @@ class story extends control
$productPlans = $this->productplan->getPairs($productID, $branch, '', true);
$productPlans = array('' => '', 'ditto' => $this->lang->story->ditto) + $productPlans;
-
$this->view->modules = $modules;
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id);
$this->view->productPlans = $productPlans;
@@ -683,9 +682,9 @@ class story extends control
$this->view->title = $execution->name . $this->lang->colon . $this->lang->story->batchEdit;
$this->view->resetActive = true;
}
- /* The stories of my. */
else
{
+ /* The stories of my. */
$this->lang->story->menu = $this->lang->my->menu;
$this->lang->story->menuOrder = $this->lang->my->menuOrder;
$this->loadModel('my')->setMenu();
@@ -708,7 +707,7 @@ class story extends control
}
/* Set ditto option for users. */
- $users = $this->loadModel('user')->getPairs('nodeleted');
+ $users = $this->loadModel('user')->getPairs('nodeleted');
$users = array('' => '', 'ditto' => $this->lang->story->ditto) + $users;
/* Set Custom*/
@@ -1468,16 +1467,14 @@ class story extends control
* Show zero case story.
*
* @param int $productID
+ * @param int $branchID
* @param string $orderBy
- * @param string $from qa|project
* @access public
* @return void
*/
- public function zeroCase($productID, $orderBy = 'id_desc', $from = 'project')
+ public function zeroCase($productID = 0, $branchID = 0, $orderBy = 'id_desc')
{
$this->session->set('storyList', $this->app->getURI(true), 'product');
- $products = $this->product->getPairs();
- if(empty($productID)) $productID = key($products);
$this->loadModel('testcase');
if($this->app->openApp == 'project')
@@ -1485,13 +1482,18 @@ class story extends control
$this->loadModel('project')->setMenu($this->session->project);
$this->app->rawModule = 'qa';
$this->lang->project->menu->qa['subMenu']->testcase['subModule'] = 'story';
- $products = $this->project->getProducts($this->session->project, false);
+ $products = $this->project->getProducts($this->session->project, false);
+ $productID = $this->product->saveState($productID, $products);
$this->lang->modulePageNav = $this->product->select($products, $productID, 'story', 'zeroCase');
}
else
{
+ $products = $this->product->getPairs();
+ $productID = $this->product->saveState($productID, $products);
+ $this->loadModel('qa');
$this->app->rawModule = 'testcase';
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
+ $this->qa->setMenu($products, $productID, $branchID);
}
/* Append id for secend sort. */
@@ -1501,7 +1503,7 @@ class story extends control
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $products[$productID]);
$this->view->position[] = $this->lang->story->zeroCase;
- $this->view->stories = $this->story->getZeroCase($productID, $sort);
+ $this->view->stories = $this->story->getZeroCase($productID, $branchID, $sort);
$this->view->users = $this->user->getPairs('noletter');
$this->view->productID = $productID;
$this->view->orderBy = $orderBy;
diff --git a/module/story/model.php b/module/story/model.php
index 9a357c5a5e..7573db139f 100644
--- a/module/story/model.php
+++ b/module/story/model.php
@@ -2600,13 +2600,15 @@ class storyModel extends model
/**
* Get zero case.
*
- * @param int $productID
+ * @param int $productID
+ * @param int $branchID
+ * @param string $orderBy
* @access public
* @return array
*/
- public function getZeroCase($productID, $orderBy = 'id_desc')
+ public function getZeroCase($productID, $branchID = 0, $orderBy = 'id_desc')
{
- $allStories = $this->getProductStories($productID, 0, 0, 'all', 'story', $orderBy, $hasParent = false, '', null);
+ $allStories = $this->getProductStories($productID, $branchID, 0, 'all', 'story', $orderBy, $hasParent = false, '', null);
$casedStories = $this->dao->select('DISTINCT story')->from(TABLE_CASE)->where('product')->eq($productID)->andWhere('story')->ne(0)->andWhere('deleted')->eq(0)->fetchAll('story');
foreach($allStories as $key => $story)
diff --git a/module/story/view/zerocase.html.php b/module/story/view/zerocase.html.php
index f1ab06b5d9..b98156172c 100644
--- a/module/story/view/zerocase.html.php
+++ b/module/story/view/zerocase.html.php
@@ -71,7 +71,7 @@
$this->app->openApp = 'product';
common::printIcon('story', 'change', $vars, $story, 'list', 'fork');
common::printIcon('story', 'review', $vars, $story, 'list', 'glasses');
- common::printIcon('story', 'close', $vars, $story, 'list', 'off');
+ common::printIcon('story', 'close', $vars, $story, 'list', 'off', '', 'iframe', 'yes');
common::printIcon('story', 'edit', $vars, $story, 'list', 'pencil');
$this->app->openApp = 'qa';
common::printIcon('story', 'createCase', "productID=$story->product&branch=0&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap');
diff --git a/module/testcase/view/caseheader.html.php b/module/testcase/view/caseheader.html.php
index cfe0e76a1a..61042731b2 100644
--- a/module/testcase/view/caseheader.html.php
+++ b/module/testcase/view/caseheader.html.php
@@ -93,7 +93,7 @@
}
elseif($hasZeroPriv and $menuType == 'zerocase')
{
- echo html::a($this->createLink('story', 'zeroCase', "productID=$productID&orderBy=id_desc&from={$this->lang->navGroup->testcase}"), "{$lang->story->zeroCase}", '', "class='btn btn-link' id='zerocaseTab' data-app='{$this->app->openApp}'");
+ echo html::a($this->createLink('story', 'zeroCase', "productID=$productID&branch=$branch&orderBy=id_desc&from={$this->lang->navGroup->testcase}"), "{$lang->story->zeroCase}", '', "class='btn btn-link' id='zerocaseTab' data-app='{$this->app->openApp}'");
}
elseif($hasUnitPriv and $menuType == 'browseunits')
{
diff --git a/module/user/control.php b/module/user/control.php
index 14c6ab1cfd..2ab89da819 100644
--- a/module/user/control.php
+++ b/module/user/control.php
@@ -966,6 +966,7 @@ class user extends control
$denyType = 'nopriv';
if(isset($rights[$module][$method]))
{
+ $menu = isset($lang->navGroup->$module) ? $lang->navGroup->$module : $module;
$menu = strtolower($menu);
if(!isset($acls['views'][$menu])) $denyType = 'noview';