- session->caseList ? $this->session->caseList : $this->createLink('caselib', 'browse', "libID=$lib->id");?>
+ session->caselibList ? $this->session->caselibList : $this->createLink('caselib', 'browse', "libID=$lib->id");?>
diff --git a/module/story/view/zerocase.html.php b/module/story/view/zerocase.html.php index 495a32ab82..f1ab06b5d9 100644 --- a/module/story/view/zerocase.html.php +++ b/module/story/view/zerocase.html.php @@ -68,10 +68,12 @@
id}";
- 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', 'edit', $vars, $story, 'list', 'pencil');
+ $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', '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/control.php b/module/testcase/control.php
index 0ff174ff08..0a5cf54f22 100644
--- a/module/testcase/control.php
+++ b/module/testcase/control.php
@@ -569,7 +569,6 @@ class testcase extends control
{
$libraries = $this->loadModel('caselib')->getLibraries();
$this->caselib->setLibMenu($libraries, $case->lib);
- $this->lang->testcase->menu = $this->lang->caselib->menu;
$this->view->title = "CASE #$case->id $case->title - " . $libraries[$case->lib];
$this->view->position[] = html::a($this->createLink('caselib', 'browse', "libID=$case->lib"), $libraries[$case->lib]);
@@ -676,7 +675,6 @@ class testcase extends control
{
$libraries = $this->loadModel('caselib')->getLibraries();
$this->caselib->setLibMenu($libraries, $case->lib);
- $this->lang->testcase->menu = $this->lang->caselib->menu;
$title = "CASE #$case->id $case->title - " . $libraries[$case->lib];
$position[] = html::a($this->createLink('caselib', 'browse', "libID=$case->lib"), $libraries[$case->lib]);
diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php
index b02aaf79bc..0369d3f3a5 100644
--- a/module/testcase/view/browse.html.php
+++ b/module/testcase/view/browse.html.php
@@ -128,7 +128,7 @@ js::set('suiteID', $suiteID);
if(common::hasPriv('testcase', 'batchReview') and ($config->testcase->needReview or !empty($config->testcase->forceReview)))
{
echo "";
- echo html::a('javascript:;', "{$lang->testcase->review}", '', "id='reviewItem'");
+ echo html::a('javascript:;', $lang->testcase->review, '', "id='reviewItem'");
echo "
diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php
index fee42aecad..41c1984590 100644
--- a/module/common/lang/menu.php
+++ b/module/common/lang/menu.php
@@ -301,9 +301,9 @@ $lang->execution->dividerMenu = ',story,build,settings,';
$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' => 'testtask,testsuite,caselib', 'class' => 'dropdown dropdown-hover', 'exclude' => 'testtask-browse');
-$lang->qa->menu->testtask = array('link' => "{$lang->testtask->common}|testtask|browse|productID=%s", 'subModule' => 'testreport', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase,report,importunitresult', 'class' => 'dropdown dropdown-hover', 'exclude' => 'testtask-browseunits');
-$lang->qa->menu->automation = array('link' => "{$lang->automation->common}|automation|browse|productID=%s", 'alias' => '', 'class' => 'dropdown dropdown-hover');
+$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' => '');
/* QA menu order. */
$lang->qa->menuOrder[5] = 'product';
@@ -316,13 +316,13 @@ $lang->qa->menuOrder[35] = 'testsuite';
$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,tree,story');
+$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->testcase['subMenu']->caselib = array('link' => "{$lang->testcase->caselib}|caselib|browse|libID=0");
$lang->qa->menu->testtask['subMenu'] = new stdclass();
-$lang->qa->menu->testtask['subMenu']->testtask = array('link' => "{$lang->testtask->common}|testtask|browse|productID=%s", 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase,report,importunitresult');
-$lang->qa->menu->testtask['subMenu']->report = array('link' => "{$lang->testreport->common}|testreport|browse|productID=%s", 'alias' => 'view,create,edit');
+$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->menu->automation['subMenu'] = new stdclass();
$lang->qa->menu->automation['subMenu']->browse = array('link' => "{$lang->intro}|automation|browse|productID=%s", 'alias' => '');
diff --git a/module/product/control.php b/module/product/control.php
index 865e7be3b5..ac3d2c412f 100644
--- a/module/product/control.php
+++ b/module/product/control.php
@@ -158,8 +158,8 @@ class product extends control
if($this->app->rawModule == 'product')
{
/* Save session. */
- $this->session->set('storyList', $this->app->getURI(true));
- $this->session->set('productList', $this->app->getURI(true));
+ $this->session->set('storyList', $this->app->getURI(true), 'product');
+ $this->session->set('productList', $this->app->getURI(true), 'product');
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID, "storyType=$storyType", $branch);
}
@@ -654,7 +654,7 @@ class product extends control
{
$this->product->delete(TABLE_PRODUCT, $productID);
$this->dao->update(TABLE_DOCLIB)->set('deleted')->eq(1)->where('product')->eq($productID)->exec();
- $this->session->set('product', ''); // 清除session。
+ $this->session->set('product', '');
$this->executeHooks($productID);
die(js::locate($this->createLink('product', 'browse'), 'parent'));
}
diff --git a/module/product/model.php b/module/product/model.php
index 11d7745e10..f256e9c4b3 100644
--- a/module/product/model.php
+++ b/module/product/model.php
@@ -278,7 +278,7 @@ class productModel extends model
* @access public
* @return array
*/
- public function getProductPairsByProject($projectID, $status = 'all')
+ public function getProductPairsByProject($projectID = 0, $status = 'all')
{
$products = empty($projectID) ? $this->getList() : $this->getProducts($projectID, $status);
$pairs = array();
diff --git a/module/story/control.php b/module/story/control.php
index 136aa51fbe..39e2993cc0 100644
--- a/module/story/control.php
+++ b/module/story/control.php
@@ -519,7 +519,7 @@ class story extends control
/* Set menu. */
$this->lang->product->switcherMenu = $this->product->getSwitcher($product->id);
- $this->product->setMenu($products, $product->id, $story->branch);
+ $this->product->setMenu($product->id, $story->branch);
$this->story->replaceURLang($story->type);
@@ -628,7 +628,7 @@ class story extends control
/* The stories of a product. */
if($productID)
{
- $this->product->setMenu($this->product->getPairs('nodeleted'), $productID, $branch);
+ $this->product->setMenu($productID, $branch);
$product = $this->product->getByID($productID);
$branchProduct = $product->type == 'normal' ? false : true;
@@ -960,7 +960,7 @@ class story extends control
}
else
{
- $this->product->setMenu($this->product->getPairs(), $product->id, $story->branch);
+ $this->product->setMenu($product->id, $story->branch);
}
/* Set the review result options. */
@@ -1046,7 +1046,7 @@ class story extends control
$this->story->replaceURLang($story->type);
/* Set menu. */
- $this->product->setMenu($this->product->getPairs(), $product->id, $story->branch);
+ $this->product->setMenu($product->id, $story->branch);
/* Set the closed reason options and remove subdivided options. */
if($story->status == 'draft') unset($this->lang->story->reasonList['cancel']);
@@ -1454,16 +1454,13 @@ class story extends control
*/
public function zeroCase($productID, $orderBy = 'id_desc', $from = 'project')
{
- $this->session->set('productList', $this->app->getURI(true));
+ $this->session->set('storyList', $this->app->getURI(true), 'product');
$products = $this->product->getPairs();
- if($from == 'qa')
- {
- $this->loadModel('qa');
- foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
- }
-
- $this->loadModel('testcase')->setMenu($products, $productID);
+ $this->loadModel('testcase');
+ $this->app->rawModule = 'testcase';
+ $this->loadModel('qa')->setMenu($products, $productID);
+ foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
diff --git a/module/story/view/change.html.php b/module/story/view/change.html.php
index b6b09d2098..3577d224e6 100644
--- a/module/story/view/change.html.php
+++ b/module/story/view/change.html.php
@@ -71,7 +71,7 @@
lastEditedDate);
echo html::submitButton();
- echo html::linkButton($lang->goback, $app->session->storyList ? $app->session->storyList : inlink('view', "storyID=$story->id"), 'self', '', 'btn btn-wide');
+ echo html::a($app->session->storyList ? $app->session->storyList : inlink('view', "storyID=$story->id"), $lang->goback, '', 'class="btn btn-wide"');
?>
diff --git a/module/story/view/close.html.php b/module/story/view/close.html.php
index 3b1f8395ed..b9d7158cdf 100644
--- a/module/story/view/close.html.php
+++ b/module/story/view/close.html.php
@@ -48,7 +48,7 @@
- goback, $app->session->storyList ? $app->session->storyList : inlink('view', "storyID=$story->id"), 'self', '', 'btn btn-wide');?>
+ session->storyList ? $app->session->storyList : inlink('view', "storyID=$story->id"), $lang->goback, '', 'class="btn btn-wide"');?>
diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php
index 89e1d33721..6facb9d44c 100644
--- a/module/story/view/edit.html.php
+++ b/module/story/view/edit.html.php
@@ -58,7 +58,7 @@
lastEditedDate);
echo html::submitButton($lang->save);
- echo html::backButton();
+ echo html::a($app->session->storyList ? $app->session->storyList : inlink('view', "storyID=$story->id"), $lang->goback, '', 'class="btn btn-wide"');
?>
diff --git a/module/story/view/zerocase.html.php b/module/story/view/zerocase.html.php index 495a32ab82..f1ab06b5d9 100644 --- a/module/story/view/zerocase.html.php +++ b/module/story/view/zerocase.html.php @@ -68,10 +68,12 @@
- ";
unset($lang->testcase->reviewResultList['']);
foreach($lang->testcase->reviewResultList as $key => $result)
diff --git a/module/testreport/control.php b/module/testreport/control.php
index aa78512433..d15c75a19c 100644
--- a/module/testreport/control.php
+++ b/module/testreport/control.php
@@ -66,7 +66,7 @@ class testreport extends control
public function browse($objectID = 0, $objectType = 'product', $extra = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
if($objectType != 'product' and $objectType != 'execution') die('Type Error!');
- $this->session->set('reportList', $this->app->getURI(true));
+ $this->session->set('reportList', $this->app->getURI(true), 'qa');
$objectID = $this->commonAction($objectID, $objectType);
$object = $this->$objectType->getById($objectID);
diff --git a/module/testsuite/control.php b/module/testsuite/control.php
index 9e889b875d..13ec531e9b 100644
--- a/module/testsuite/control.php
+++ b/module/testsuite/control.php
@@ -31,13 +31,8 @@ class testsuite extends control
{
parent::__construct($moduleName, $methodName);
- /* Set testtask menu group. */
- $this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0;
- if(!$this->projectID)
- {
- $this->app->loadConfig('qa');
- foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
- }
+ $this->app->loadConfig('qa');
+ foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
}
/**
@@ -68,9 +63,9 @@ class testsuite extends control
$this->session->set('testsuiteList', $this->app->getURI(true));
/* Set menu. */
- $projectID = $this->lang->navGroup->testreport == 'qa' ? 0 : $this->session->project;
- $this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($projectID);
+ $this->view->products = $this->products = $this->loadModel('product')->getPairs();
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', 'fromModule=testsuite&moduleGroup=' . $this->lang->navGroup->bug . '&activeMenu=testsuite')));
+
$productID = $this->product->saveState($productID, $this->products);
$this->loadModel('qa')->setMenu($this->products, $productID);
@@ -135,7 +130,7 @@ class testsuite extends control
}
/* Set menu. */
- $this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->project);
+ $this->view->products = $this->products = $this->loadModel('product')->getPairs();
$productID = $this->product->saveState($productID, $this->products);
$this->loadModel('qa')->setMenu($this->products, $productID);
@@ -162,14 +157,15 @@ class testsuite extends control
public function view($suiteID, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->app->loadLang('testtask');
+
/* Get test suite, and set menu. */
$suite = $this->testsuite->getById($suiteID, true);
if(!$suite) die(js::error($this->lang->notFound) . js::locate('back'));
if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back'));
- $productID = $suite->product;
- $this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->project);
- $this->testsuite->setMenu($this->products, $productID);
+ /* Set product session. */
+ $this->view->products = $this->products = $this->loadModel('product')->getPairs();
+ $productID = $this->product->saveState($suite->product, $this->products);
/* Save session. */
$this->session->set('caseList', $this->app->getURI(true));
@@ -183,8 +179,8 @@ class testsuite extends control
$this->executeHooks($suiteID);
- $this->view->title = "SUITE #$suite->id $suite->name/" . $this->products[$productID];
- $this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"), $this->products[$productID]);
+ $this->view->title = "SUITE #$suite->id $suite->name";
+ $this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"));
$this->view->position[] = $this->lang->testsuite->common;
$this->view->position[] = $this->lang->testsuite->view;
@@ -237,15 +233,12 @@ class testsuite extends control
if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back'));
- /* Get suite info. */
- $this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->project);
+ /* Set product session. */
+ $this->view->products = $this->products = $this->loadModel('product')->getPairs();
$productID = $this->product->saveState($suite->product, $this->products);
- /* Set menu. */
- $this->testsuite->setMenu($this->products, $productID);
-
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testsuite->edit;
- $this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"), $this->products[$productID]);
+ $this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"));
$this->view->position[] = $this->lang->testsuite->common;
$this->view->position[] = $this->lang->testsuite->edit;
@@ -308,23 +301,21 @@ class testsuite extends control
*/
public function linkCase($suiteID, $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
+ /* Save session. */
+ $this->session->set('caseList', $this->app->getURI(true));
+
if(!empty($_POST))
{
$this->testsuite->linkCase($suiteID);
$this->locate(inlink('view', "suiteID=$suiteID"));
}
- /* Save session. */
- $this->session->set('caseList', $this->app->getURI(true));
+ $suite = $this->testsuite->getById($suiteID);
- /* Get suite and product id. */
- $this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->project);
- $suite = $this->testsuite->getById($suiteID);
+ /* Set product session. */
+ $this->view->products = $this->products = $this->loadModel('product')->getPairs();
$productID = $this->product->saveState($suite->product, $this->products);
- /* Save session. */
- $this->testsuite->setMenu($this->products, $productID);
-
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
@@ -343,7 +334,7 @@ class testsuite extends control
$this->loadModel('search')->setSearchParams($this->config->testcase->search);
$this->view->title = $suite->name . $this->lang->colon . $this->lang->testsuite->linkCase;
- $this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"), $this->products[$productID]);
+ $this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"));
$this->view->position[] = $this->lang->testsuite->common;
$this->view->position[] = $this->lang->testsuite->linkCase;
diff --git a/module/testtask/control.php b/module/testtask/control.php
index fad72f581d..a21bebfd58 100644
--- a/module/testtask/control.php
+++ b/module/testtask/control.php
@@ -76,8 +76,8 @@ class testtask extends control
public function browse($productID = 0, $branch = '', $type = 'local,totalStatus', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $beginTime = 0, $endTime = 0)
{
/* Save session. */
- $this->session->set('testtaskList', $this->app->getURI(true));
- $this->session->set('buildList', $this->app->getURI(true));
+ $this->session->set('testtaskList', $this->app->getURI(true), 'qa');
+ $this->session->set('buildList', $this->app->getURI(true), 'execution');
$scopeAndStatus = explode(',', $type);
$this->session->set('testTaskVersionScope', $scopeAndStatus[0]);
@@ -1211,7 +1211,9 @@ class testtask extends control
die(js::locate($this->createLink('testtask', 'unitCases', "taskID=$taskID"), 'parent'));
}
+ /* Set menu. */
$this->loadModel('qa')->setMenu($this->products, $productID);
+ $this->app->rawModule = 'testcase';
$this->app->loadLang('job');
diff --git a/module/testtask/view/browse.html.php b/module/testtask/view/browse.html.php
index dcc38c6c01..c63321b09b 100644
--- a/module/testtask/view/browse.html.php
+++ b/module/testtask/view/browse.html.php
@@ -89,7 +89,7 @@ $status = $this->session->testTaskVersionStatus;