Merge branch 'master' of github.com:easysoft/zentaopms
This commit is contained in:
@@ -82,7 +82,7 @@ class bug extends control
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
|
||||
/* Set menu and save session. */
|
||||
$this->bug->setMenu($this->products, $productID, $branch);
|
||||
$this->bug->setMenu($this->products, $productID, $branch, $moduleID);
|
||||
$this->session->set('bugList', $this->app->getURI(true));
|
||||
|
||||
/* Process the order by field. */
|
||||
|
||||
@@ -15,3 +15,5 @@
|
||||
.dropdown-list > li > a {display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.53846154; color: #141414; white-space: nowrap;}
|
||||
.dropdown-list > li > a:hover,
|
||||
.dropdown-list > li > a:focus {color: #1a4f85;text-decoration: none;background-color: #ddd;}
|
||||
|
||||
.nav > li > .btn-group > a, .nav > li > .btn-group > a:hover, .nav > li > .btn-group > a:focus{background: #1a4f85; border-color: #164270;}
|
||||
|
||||
@@ -19,4 +19,15 @@ $(document).ready(function()
|
||||
});
|
||||
setTimeout(function(){fixedTfootAction('#bugForm')}, 100);
|
||||
setTimeout(function(){fixedTheadOfList('#bugList')}, 100);
|
||||
|
||||
if(flow == 'onlyTest')
|
||||
{
|
||||
$('#modulemenu > .nav').append($('#featurebar').html());
|
||||
toggleSearch();
|
||||
|
||||
$(".export").modalTrigger({width:650, type:'iframe'});
|
||||
|
||||
$('#modulemenu > .nav > li').removeClass('active');
|
||||
$('#modulemenu > .nav > li[data-id=' + browseType + ']').addClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
+22
-4
@@ -21,13 +21,31 @@ class bugModel extends model
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setMenu($products, $productID, $branch = 0)
|
||||
public function setMenu($products, $productID, $branch = 0, $moduleID = 0)
|
||||
{
|
||||
$this->loadModel('product')->setMenu($products, $productID, $branch);
|
||||
$selectHtml = $this->product->select($products, $productID, 'bug', 'browse', '', $branch);
|
||||
$this->loadModel('product')->setMenu($products, $productID, $branch, $moduleID, 'bug');
|
||||
$selectHtml = $this->product->select($products, $productID, 'bug', 'browse', '', $branch, $moduleID, 'bug');
|
||||
|
||||
foreach($this->lang->bug->menu as $key => $menu)
|
||||
{
|
||||
$replace = ($key == 'product') ? $selectHtml : $productID;
|
||||
if($this->config->global->flow != 'onlyTest')
|
||||
{
|
||||
$replace = ($key == 'product') ? $selectHtml : $productID;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($key == 'product')
|
||||
{
|
||||
$replace = $selectHtml;
|
||||
}
|
||||
else
|
||||
{
|
||||
$replace = array();
|
||||
$replace['productID'] = $productID;
|
||||
$replace['branch'] = $branch;
|
||||
$replace['param'] = $moduleID;
|
||||
}
|
||||
}
|
||||
common::setMenuVars($this->lang->bug->menu, $key, $replace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,57 @@ include '../../common/view/datatable.fix.html.php';
|
||||
js::set('browseType', $browseType);
|
||||
js::set('moduleID', $moduleID);
|
||||
js::set('bugBrowseType', ($browseType == 'bymodule' and $this->session->bugBrowseType == 'bysearch') ? 'all' : $this->session->bugBrowseType);
|
||||
js::set('flow', $this->config->global->flow);
|
||||
?>
|
||||
<?php if($this->config->global->flow == 'onlyTest'):?>
|
||||
<div id='featurebar' class='hidden'>
|
||||
<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> <?php echo $lang->bug->byQuery;?></a></li>
|
||||
<li class='pull-right'>
|
||||
<div class='btn-group' id='createActionMenu'>
|
||||
<?php
|
||||
if(commonModel::isTutorialMode())
|
||||
{
|
||||
$wizardParams = helper::safe64Encode("productID=$productID&branch=$branch&extra=moduleID=$moduleID");
|
||||
echo html::a($this->createLink('tutorial', 'wizard', "module=bug&method=create¶ms=$wizardParams"), "<i class='icon-plus'></i>" . $lang->bug->create, '', "class='btn btn-primary btn-bug-create'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$misc = common::hasPriv('bug', 'create') ? "class='btn btn-primary'" : "class='btn btn-primary disabled'";
|
||||
$link = common::hasPriv('bug', 'create') ? $this->createLink('bug', 'create', "productID=$productID&branch=$branch&extra=moduleID=$moduleID") : '#';
|
||||
echo html::a($link, "<i class='icon icon-plus'></i>" . $lang->bug->create, '', $misc);
|
||||
}
|
||||
?>
|
||||
<button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'>
|
||||
<span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu pull-right'>
|
||||
<?php
|
||||
$misc = common::hasPriv('bug', 'batchCreate') ? '' : "class=disabled";
|
||||
$link = common::hasPriv('bug', 'batchCreate') ? $this->createLink('bug', 'batchCreate', "productID=$productID&branch=$branch&projectID=0&moduleID=$moduleID") : '#';
|
||||
echo "<li>" . html::a($link, $lang->bug->batchCreate, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li class='pull-right'>
|
||||
<?php common::printLink('bug', 'report', "productID=$productID&browseType=$browseType&branchID=$branch&moduleID=$moduleID", "<i class='icon-common-report icon-bar-chart'></i> " . $lang->bug->report->common); ?>
|
||||
</li>
|
||||
<li class='pull-right'>
|
||||
<a class='dropdown-toggle' data-toggle='dropdown'>
|
||||
<i class='icon-download-alt'></i> <?php echo $lang->export ?>
|
||||
<span class='caret'></span>
|
||||
</a>
|
||||
<ul class='dropdown-menu' id='exportActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('bug', 'export') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('bug', 'export') ? $this->createLink('bug', 'export', "productID=$productID&orderBy=$orderBy") : '#';
|
||||
echo "<li>" . html::a($link, $lang->bug->export, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<li>
|
||||
@@ -92,6 +142,7 @@ js::set('bugBrowseType', ($browseType == 'bymodule' and $this->session->bugBrows
|
||||
</div>
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class='side' id='treebox'>
|
||||
<a class='side-handle' data-id='bugTree'><i class='icon-caret-left'></i></a>
|
||||
<div class='side-body'>
|
||||
|
||||
@@ -653,75 +653,125 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
|
||||
unset($lang->project->menuOrder);
|
||||
|
||||
/* Add bug, testcase and testtask module. */
|
||||
$lang->menu->bug = 'Bug|bug|index';
|
||||
$lang->menu->testcase = '用例|testcase|index';
|
||||
$lang->menu->testtask = '测试|testtask|index';
|
||||
$lang->menu->caselib = '用例库|testsuite|library';
|
||||
$lang->menu->bug = 'Bug|bug|index';
|
||||
$lang->menu->testcase = '用例|testcase|index';
|
||||
$lang->menu->testsuite = '套件|testsuite|index';
|
||||
$lang->menu->testtask = '测试|testtask|index';
|
||||
$lang->menu->caselib = '用例库|testsuite|library';
|
||||
|
||||
$lang->menuOrder[6] = 'bug';
|
||||
$lang->menuOrder[7] = 'testcase';
|
||||
$lang->menuOrder[8] = 'testtask';
|
||||
$lang->menuOrder[9] = 'caselib';
|
||||
$lang->menuOrder[6] = 'bug';
|
||||
$lang->menuOrder[7] = 'testcase';
|
||||
$lang->menuOrder[8] = 'testsuite';
|
||||
$lang->menuOrder[9] = 'testtask';
|
||||
$lang->menuOrder[10] = 'caselib';
|
||||
$lang->menuOrder[11] = 'product';
|
||||
|
||||
/* Adjust sub menu of bug module. */
|
||||
$lang->bug->menu = new stdclass();
|
||||
$lang->bug->menu->product = '%s';
|
||||
$lang->bug->menu->browse = array('link' => '浏览Bug|bug|browse|productID=%s', 'alias' => 'viewedit,resolve,close,activate,report', 'subModule' => 'tree');
|
||||
$lang->bug->menu->create = array('link' => '提Bug|bug|create|productID=%s');
|
||||
$lang->bug->menu->product = '%s';
|
||||
$lang->bug->menu->unclosed = '未关闭|bug|browse|productID=%s&branch=%s&browseType=unclosed¶m=%s';
|
||||
$lang->bug->menu->all = '所有|bug|browse|productID=%s&branch=%s&browseType=all¶m=%s';
|
||||
$lang->bug->menu->assigntome = '指派给我|bug|browse|productID=%s&branch=%s&browseType=assigntome¶m=%s';
|
||||
$lang->bug->menu->openedbyme = '由我创建|bug|browse|productID=%s&branch=%s&browseType=openedbyme¶m=%s';
|
||||
$lang->bug->menu->resolvedbyme = '由我创建|bug|browse|productID=%s&branch=%s&browseType=resolvedbyme¶m=%s';
|
||||
$lang->bug->menu->unconfirmed = '未确认|bug|browse|productID=%s&branch=%s&browseType=unconfirmed¶m=%s';
|
||||
$lang->bug->menu->assigntonull = '未指派|bug|browse|productID=%s&branch=%s&browseType=assigntonull¶m=%s';
|
||||
$lang->bug->menu->unresolved = '未解决|bug|browse|productID=%s&branch=%s&browseType=unresolved¶m=%s';
|
||||
$lang->bug->menu->toclosed = '待关闭|bug|browse|productID=%s&branch=%s&browseType=toclosed¶m=%s';
|
||||
$lang->bug->menu->longlifebugs = '久未处理|bug|browse|productID=%s&branch=%s&browseType=longlifebugs¶m=%s';
|
||||
$lang->bug->menu->postponedbugs = '被延期|bug|browse|productID=%s&branch=%s&browseType=postponedbugs¶m=%s';
|
||||
$lang->bug->menu->overduebugs = '过期Bug|bug|browse|productID=%s&branch=%s&browseType=overduebugs¶m=%s';
|
||||
|
||||
$lang->bug->menuOrder[5] = 'product';
|
||||
$lang->bug->menuOrder[10] = 'browse';
|
||||
$lang->bug->menuOrder[15] = 'create';
|
||||
$lang->bug->menuOrder[10] = 'unclosed';
|
||||
$lang->bug->menuOrder[15] = 'all';
|
||||
$lang->bug->menuOrder[20] = 'assigntome';
|
||||
$lang->bug->menuOrder[25] = 'openedbyme';
|
||||
$lang->bug->menuOrder[30] = 'resolvedbyme';
|
||||
$lang->bug->menuOrder[35] = 'unresolved';
|
||||
$lang->bug->menuOrder[40] = 'assigntonull';
|
||||
$lang->bug->menuOrder[45] = 'unresolved';
|
||||
$lang->bug->menuOrder[50] = 'toclosed';
|
||||
$lang->bug->menuOrder[55] = 'longlifebugs';
|
||||
$lang->bug->menuOrder[60] = 'postponedbugs';
|
||||
$lang->bug->menuOrder[65] = 'overduebugs';
|
||||
|
||||
/* Adjust sub menu of testcase. */
|
||||
$lang->testcase->menu = new stdclass();
|
||||
$lang->testcase->menu->product = '%s';
|
||||
$lang->testcase->menu->browse = array('link' => '浏览用例|testcase|browse|productID=%s', 'alias' => 'viewedit,resolve,close,activate,report', 'subModule' => 'tree');
|
||||
$lang->testcase->menu->testsuite = array('link' => '浏览套件|testsuite|browse|productID=%s', 'alias' => 'linkcase,create,edit,view');
|
||||
$lang->testcase->menu->product = '%s';
|
||||
$lang->testcase->menu->all = '所有|testcase|browse|productID=%s&branch=%s&browseType=all';
|
||||
$lang->testcase->menu->wait = '待评审|testcase|browse|productID=%s&branch=%s&browseType=wait';
|
||||
$lang->testcase->menu->suite = '%s';
|
||||
|
||||
$lang->testcase->menuOrder[5] = 'product';
|
||||
$lang->testcase->menuOrder[10] = 'browse';
|
||||
$lang->testcase->menuOrder[15] = 'testsuite';
|
||||
$lang->testcase->menuOrder[10] = 'all';
|
||||
$lang->testcase->menuOrder[15] = 'wait';
|
||||
$lang->testcase->menuOrder[20] = 'suite';
|
||||
|
||||
/* Adjust sub menu of bug module. */
|
||||
$lang->testsuite->menu = new stdclass();
|
||||
$lang->testsuite->menu->product = '%s';
|
||||
$lang->testsuite->menu->testcase = array('link' => '浏览用例|testcase|browse|productID=%s', 'alias' => 'viewedit,resolve,close,activate,report', 'subModule' => 'tree');
|
||||
$lang->testsuite->menu->browse = array('link' => '浏览套件|testsuite|browse|productID=%s', 'alias' => 'linkcase,create,edit,view');
|
||||
$lang->testsuite->menu->product = '%s';
|
||||
$lang->testsuite->menu->create = array('link' => "<i class='icon-plus'></i> 建套件|testsuite|create|productID=%s", 'float' => 'right');
|
||||
|
||||
$lang->testsuite->menuOrder[5] = 'product';
|
||||
$lang->testsuite->menuOrder[10] = 'testcase';
|
||||
$lang->testsuite->menuOrder[15] = 'browse';
|
||||
$lang->testsuite->menuOrder[10] = 'create';
|
||||
|
||||
/* Adjust sub menu of testtask. */
|
||||
$lang->testtask->menu = new stdclass();
|
||||
$lang->testtask->menu->product = '%s';
|
||||
$lang->testtask->menu->browse = array('link' => '浏览版本|testtask|browse|productID=%s', 'alias' => 'viewedit,resolve,close,activate,report', 'subModule' => 'tree');
|
||||
$lang->testtask->menu->create = array('link' => '提交测试|testtask|create|productID=%s');
|
||||
$lang->testtask->menu->report = array('link' => '报告|testreport|browse');
|
||||
$lang->testtask->menu->product = '%s';
|
||||
$lang->testtask->menu->scope = '%s';
|
||||
$lang->testtask->menu->wait = '待测版本|testtask|browse|productID=%s&branch=%s&type=%s,wait';
|
||||
$lang->testtask->menu->doing = '测试中版本|testtask|browse|productID=%s&branch=%s&type=%s,doing';
|
||||
$lang->testtask->menu->blocked = '被阻塞版本|testtask|browse|productID=%s&branch=%s&type=%s,blocked';
|
||||
$lang->testtask->menu->done = '已测版本|testtask|browse|productID=%s&branch=%s&type=%s,done';
|
||||
$lang->testtask->menu->totalStatus = '全部|testtask|browse|productID=%s&branch=%s&type=%s,totalStatus';
|
||||
$lang->testtask->menu->report = array('link' => '报告|testreport|browse');
|
||||
$lang->testtask->menu->create = array('link' => "<i class='icon-plus'></i> 提交测试|testtask|create|productID=%s", 'float' => 'right');
|
||||
|
||||
$lang->testtask->menuOrder[5] = 'product';
|
||||
$lang->testtask->menuOrder[10] = 'browse';
|
||||
$lang->testtask->menuOrder[15] = 'create';
|
||||
$lang->testtask->menuOrder[20] = 'report';
|
||||
|
||||
/* Adjust sub menu of caselib module. */
|
||||
$lang->caselib->menu = new stdclass();
|
||||
$lang->caselib->menu->lib = array('link' => '%s', 'fixed' => true);
|
||||
$lang->caselib->menu->caselib = array('link' => '用例库|testsuite|library', 'alias' => 'createlib,createcase,libview,edit,batchcreatecase,showimport', 'subModule' => 'tree,testcase');
|
||||
$lang->caselib->menu->createlib = array('link' => "<i class='icon-plus'></i>创建库|testsuite|createLib|", 'float' => 'right');
|
||||
$lang->testtask->menuOrder[5] = 'product';
|
||||
$lang->testtask->menuOrder[10] = 'scope';
|
||||
$lang->testtask->menuOrder[15] = 'wait';
|
||||
$lang->testtask->menuOrder[20] = 'doing';
|
||||
$lang->testtask->menuOrder[25] = 'blocked';
|
||||
$lang->testtask->menuOrder[30] = 'done';
|
||||
$lang->testtask->menuOrder[35] = 'totalStatus';
|
||||
$lang->testtask->menuOrder[40] = 'report';
|
||||
$lang->testtask->menuOrder[45] = 'create';
|
||||
|
||||
/* Adjust sub menu of report module. */
|
||||
$lang->testreport->menu = new stdclass();
|
||||
$lang->testreport->menu->product = '%s';
|
||||
$lang->testreport->menu->browse = array('link' => '浏览版本|testtask|browse|productID=%s', 'alias' => 'viewedit,resolve,close,activate,report', 'subModule' => 'tree');
|
||||
$lang->testreport->menu->create = array('link' => '提交测试|testtask|create|productID=%s');
|
||||
$lang->testreport->menu->report = array('link' => '报告|testreport|browse');
|
||||
$lang->testreport->menu->product = '%s';
|
||||
$lang->testreport->menu->scope = '%s';
|
||||
$lang->testreport->menu->wait = '待测版本|testtask|browse|productID=%s&branch=%s&type=%s,wait';
|
||||
$lang->testreport->menu->doing = '测试中版本|testtask|browse|productID=%s&branch=%s&type=%s,doing';
|
||||
$lang->testreport->menu->blocked = '被阻塞版本|testtask|browse|productID=%s&branch=%s&type=%s,blocked';
|
||||
$lang->testreport->menu->done = '已测版本|testtask|browse|productID=%s&branch=%s&type=%s,done';
|
||||
$lang->testreport->menu->totalStatus = '全部|testtask|browse|productID=%s&branch=%s&type=%s,totalStatus';
|
||||
$lang->testreport->menu->report = array('link' => '报告|testreport|browse');
|
||||
$lang->testreport->menu->testtask = array('link' => "<i class='icon-plus'></i> 提交测试|testtask|create|productID=%s", 'float' => 'right');
|
||||
|
||||
$lang->testreport->menuOrder[5] = 'product';
|
||||
$lang->testreport->menuOrder[10] = 'browse';
|
||||
$lang->testreport->menuOrder[15] = 'create';
|
||||
$lang->testreport->menuOrder[20] = 'report';
|
||||
$lang->testreport->menuOrder[5] = 'product';
|
||||
$lang->testreport->menuOrder[10] = 'scope';
|
||||
$lang->testreport->menuOrder[15] = 'wait';
|
||||
$lang->testreport->menuOrder[20] = 'doing';
|
||||
$lang->testreport->menuOrder[25] = 'blocked';
|
||||
$lang->testreport->menuOrder[30] = 'done';
|
||||
$lang->testreport->menuOrder[35] = 'totalStatus';
|
||||
$lang->testreport->menuOrder[40] = 'report';
|
||||
$lang->testreport->menuOrder[45] = 'create';
|
||||
|
||||
/* Adjust sub menu of caselib module. */
|
||||
$lang->caselib->menu = new stdclass();
|
||||
$lang->caselib->menu->lib = array('link' => '%s', 'fixed' => true);
|
||||
$lang->caselib->menu->all = '所有|testsuite|library|libID=%s&browseType=all';
|
||||
$lang->caselib->menu->wait = '待评审|testsuite|library|libID=%s&browseType=wait';
|
||||
$lang->caselib->menu->view = '概况|testsuite|libview|libID=%s';
|
||||
$lang->caselib->menu->create = array('link' => "<i class='icon-plus'></i> 创建库|testsuite|createLib", 'float' => 'right');
|
||||
|
||||
$lang->caselib->menuOrder[5] = 'lib';
|
||||
$lang->caselib->menuOrder[10] = 'all';
|
||||
$lang->caselib->menuOrder[15] = 'wait';
|
||||
$lang->caselib->menuOrder[20] = 'view';
|
||||
|
||||
/* Adjust sub menu of product module. */
|
||||
unset($lang->product->menu->story);
|
||||
@@ -756,6 +806,4 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
|
||||
unset($lang->searchObjects['task']);
|
||||
unset($lang->searchObjects['release']);
|
||||
unset($lang->searchObjects['productplan']);
|
||||
|
||||
$lang->zentaoPMS = '禅道测试管理';
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class testcase extends control
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
|
||||
/* Set menu, save session. */
|
||||
$this->testcase->setMenu($this->products, $productID, $branch);
|
||||
$this->testcase->setMenu($this->products, $productID, $branch, $moduleID, $suiteID);
|
||||
$this->session->set('caseList', $this->app->getURI(true));
|
||||
$this->session->set('productID', $productID);
|
||||
$this->session->set('moduleID', $moduleID);
|
||||
|
||||
@@ -16,3 +16,5 @@
|
||||
|
||||
tbody > tr > td > .btn-icon {margin-right: 3px;}
|
||||
tbody > tr > td .icon-bug {margin-left: -8px;}
|
||||
|
||||
.nav > li > .btn-group > a, .nav > li > .btn-group > a:hover, .nav > li > .btn-group > a:focus{background: #1a4f85; border-color: #164270;}
|
||||
|
||||
@@ -44,4 +44,14 @@ $(document).ready(function()
|
||||
});
|
||||
|
||||
setModal4List('runCase', 'caseList');
|
||||
|
||||
if(flow == 'onlyTest')
|
||||
{
|
||||
$('#modulemenu > .nav').append($('#featurebar').html());
|
||||
toggleSearch();
|
||||
$('.export').modalTrigger({width:650, type:'iframe'});
|
||||
|
||||
$('#modulemenu > .nav > li').removeClass('active');
|
||||
$('#modulemenu > .nav > li[data-id=' + browseType + ']').addClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -21,13 +21,53 @@ class testcaseModel extends model
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setMenu($products, $productID, $branch = 0)
|
||||
public function setMenu($products, $productID, $branch = 0, $moduleID = 0, $suiteID = 0)
|
||||
{
|
||||
$this->loadModel('product')->setMenu($products, $productID, $branch);
|
||||
$selectHtml = $this->product->select($products, $productID, 'testcase', 'browse', '', $branch);
|
||||
$this->loadModel('product')->setMenu($products, $productID, $branch, $moduleID, 'case');
|
||||
$selectHtml = $this->product->select($products, $productID, 'testcase', 'browse', '', $branch, $moduleID, 'case');
|
||||
foreach($this->lang->testcase->menu as $key => $menu)
|
||||
{
|
||||
$replace = ($key == 'product') ? $selectHtml : $productID;
|
||||
if($this->config->global->flow != 'onlyTest')
|
||||
{
|
||||
$replace = ($key == 'product') ? $selectHtml : $productID;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($key == 'product')
|
||||
{
|
||||
$replace = $selectHtml;
|
||||
}
|
||||
elseif($key == 'suite' and common::hasPriv('testcase', 'browse'))
|
||||
{
|
||||
$suiteList = $this->loadModel('testsuite')->getSuites($productID);
|
||||
$currentSuiteID = isset($suiteID) ? (int)$suiteID : 0;
|
||||
$currentSuite = zget($suiteList, $currentSuiteID, '');
|
||||
$currentLable = empty($currentSuite) ? $this->lang->testsuite->common : $currentSuite->name;
|
||||
|
||||
$replace = "<li id='bysuiteTab' class='dropdown'>";
|
||||
$replace .= html::a('javascript:;', $currentLable . " <span class='caret'></span>", '', "data-toggle='dropdown'");
|
||||
$replace .="<ul class='dropdown-menu' style='max-height:240px; overflow-y:auto'>";
|
||||
|
||||
$replace .= '<li>' . html::a(helper::createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySuite¶m=0"), $this->lang->testcase->featureBar['browse']['suite']) . '</li>';
|
||||
foreach ($suiteList as $suiteID => $suite)
|
||||
{
|
||||
$suiteName = $suite->name;
|
||||
if($suite->type == 'public') $suiteName .= " <span class='label label-info'>{$this->lang->testsuite->authorList[$suite->type]}</span>";
|
||||
|
||||
$replace .= '<li' . ($suiteID == (int)$currentSuiteID ? " class='active'" : '') . '>';
|
||||
$replace .= html::a(helper::createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySuite¶m=$suiteID"), $suiteName);
|
||||
$replace .= "</li>";
|
||||
}
|
||||
|
||||
$replace .= '</ul></li>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$replace = array();
|
||||
$replace['productID'] = $productID;
|
||||
$replace['branch'] = $branch;
|
||||
}
|
||||
}
|
||||
common::setMenuVars($this->lang->testcase->menu, $key, $replace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,71 @@
|
||||
<?php js::set('flow', $this->config->global->flow);?>
|
||||
<?php if(!isset($branch)) $branch = 0;?>
|
||||
<?php if($this->config->global->flow == 'onlyTest'):?>
|
||||
<div id='featurebar' class='hidden'>
|
||||
<?php
|
||||
$hasBrowsePriv = common::hasPriv('testcase', 'browse');
|
||||
$hasGroupPriv = common::hasPriv('testcase', 'groupcase');
|
||||
$hasZeroPriv = common::hasPriv('story', 'zerocase');
|
||||
?>
|
||||
<?php
|
||||
if($this->methodName == 'browse') echo "<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a></li> ";
|
||||
?>
|
||||
<li class='pull-right'>
|
||||
<div class='btn-group' id='createActionMenu'>
|
||||
<?php
|
||||
$initModule = isset($moduleID) ? (int)$moduleID : 0;
|
||||
$misc = common::hasPriv('testcase', 'create') ? "class='btn btn-primary'" : "class='btn btn-primary disabled'";
|
||||
$link = common::hasPriv('testcase', 'create') ? $this->createLink('testcase', 'create', "productID=$productID&branch=$branch&moduleID=$initModule") : '#';
|
||||
echo html::a($link, "<i class='icon-plus'></i>" . $lang->testcase->create, '', $misc);
|
||||
?>
|
||||
<button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'>
|
||||
<span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu pull-right'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testcase', 'batchCreate') ? '' : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'batchCreate') ? $this->createLink('testcase', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$initModule") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->batchCreate, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class='pull-right'>
|
||||
<a class='dropdown-toggle' data-toggle='dropdown' id='importAction'><i class='icon-upload-alt'></i> <?php echo $lang->import ?><span class='caret'></span></a>
|
||||
<ul class='dropdown-menu' id='importActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testcase', 'import') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'import') ? $this->createLink('testcase', 'import', "productID=$productID&branch=$branch") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->importFile, '', $misc) . "</li>";
|
||||
|
||||
$misc = common::hasPriv('testcase', 'importFromLib') ? '' : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'importFromLib') ? $this->createLink('testcase', 'importFromLib', "productID=$productID&branch=$branch") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->importFromLib, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class='pull-right'>
|
||||
<a class='dropdown-toggle' data-toggle='dropdown'>
|
||||
<i class='icon-download-alt'></i> <?php echo $lang->export ?>
|
||||
<span class='caret'></span>
|
||||
</a>
|
||||
<ul class='dropdown-menu' id='exportActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testcase', 'export') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'export') ? $this->createLink('testcase', 'export', "productID=$productID&orderBy=$orderBy") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->export, '', $misc) . "</li>";
|
||||
|
||||
$misc = common::hasPriv('testcase', 'exportTemplet') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'exportTemplet') ? $this->createLink('testcase', 'exportTemplet', "productID=$productID") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->exportTemplet, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<li>
|
||||
@@ -142,6 +209,7 @@
|
||||
</div>
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php
|
||||
$headerHooks = glob(dirname(dirname(__FILE__)) . "/ext/view/featurebar.*.html.hook.php");
|
||||
|
||||
@@ -35,7 +35,37 @@ class testreportModel extends model
|
||||
|
||||
foreach($this->lang->testtask->menu as $key => $value)
|
||||
{
|
||||
$replace = ($key == 'product') ? $selectHtml : $productID;
|
||||
if($this->config->global->flow != 'onlyTest')
|
||||
{
|
||||
$replace = ($key == 'product') ? $selectHtml : $productID;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($key == 'product')
|
||||
{
|
||||
$replace = $selectHtml;
|
||||
}
|
||||
elseif($key == 'scope')
|
||||
{
|
||||
$scope = $this->session->testTaskVersionScope;
|
||||
$status = $this->session->testTaskVersionStatus;
|
||||
$viewName = $scope == 'local'? $products[$productID] : $this->lang->testtask->all;
|
||||
|
||||
$replace = '<li>';
|
||||
$replace .= "<a data-toggle='dropdown'>{$viewName} <span class='caret'></span></a>";
|
||||
$replace .= "<ul class='dropdown-menu' style='max-height:240px;overflow-y:auto'>";
|
||||
$replace .= "<li>" . html::a(helper::createLink('testtask', 'browse', "productID=$productID&branch=$branch&type=all,$status"), $this->lang->testtask->all) . "</li>";
|
||||
$replace .= "<li>" . html::a(helper::createLink('testtask', 'browse', "productID=$productID&branch=$branch&type=local,$status"), $products[$productID]) . "</li>";
|
||||
$replace .= "</ul></li>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$replace = array();
|
||||
$replace['productID'] = $productID;
|
||||
$replace['branch'] = $branch;
|
||||
$replace['scope'] = $this->session->testTaskVersionScope;
|
||||
}
|
||||
}
|
||||
common::setMenuVars($this->lang->testreport->menu, $key, $replace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ class testsuite extends control
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
|
||||
/* Set lib menu. */
|
||||
$this->testsuite->setLibMenu($libraries, $libID);
|
||||
$this->testsuite->setLibMenu($libraries, $libID, $moduleID);
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
|
||||
@@ -2,7 +2,6 @@ $(document).ready(function()
|
||||
{
|
||||
if(typeof(onlyTest) != 'undefined' && onlyTest)
|
||||
{
|
||||
$('#mainmenu > .nav > li').removeClass('active');
|
||||
$('#mainmenu > .nav > li[data-id=testcase]').addClass('active');
|
||||
toggleSearch();
|
||||
}
|
||||
})
|
||||
|
||||
@@ -72,14 +72,33 @@ class testsuiteModel extends model
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setLibMenu($libraries, $libID)
|
||||
public function setLibMenu($libraries, $libID, $moduleID = 0)
|
||||
{
|
||||
$currentLibName = zget($libraries, $libID, '');
|
||||
$selectHtml = empty($libraries) ? '' : "<a id='currentItem' href=\"javascript:showSearchMenu('testsuite', '$libID', 'testsuite', 'library', '')\">{$currentLibName} <span class='icon-caret-down'></span></a><div id='dropMenu'><i class='icon icon-spin icon-spinner'></i></div>";
|
||||
|
||||
if($this->config->global->flow == 'onlyTest')
|
||||
{
|
||||
$isMobile = $this->app->viewType == 'mhtml';
|
||||
$modules = $this->loadModel('tree')->getModulePairs($libID, 'caselib');
|
||||
$moduleName = ($moduleID && isset($modules[$moduleID])) ? $modules[$moduleID] : $this->lang->tree->all;
|
||||
|
||||
if(!$isMobile)
|
||||
{
|
||||
$selectHtml .= '</li><li>';
|
||||
$selectHtml .= "<a id='currentModule' href=\"javascript:showSearchMenu('tree', '$libID', 'testsuite', 'library', '')\">{$moduleName} <span class='icon-caret-down'></span></a><div id='dropMenu'><i class='icon icon-spin icon-spinner'></i></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$selectHtml .= "<a id='currentModule' href=\"javascript:showSearchMenu('tree', '$libID', 'testsuite', 'library', '')\">{$moduleName} <span class='icon-caret-down'></span></a><div id='currentBranchDropMenu' class='hidden affix enter-from-bottom layer'></div>";
|
||||
}
|
||||
}
|
||||
|
||||
setCookie("lastCaseLib", $libID, $this->config->cookieLife, $this->config->webRoot);
|
||||
foreach($this->lang->caselib->menu as $key => $value)
|
||||
{
|
||||
$replace = ($key == 'lib') ? $selectHtml : '';
|
||||
if($this->config->global->flow == 'onlyTest') $replace = ($key == 'lib') ? $selectHtml : $libID;
|
||||
common::setMenuVars($this->lang->caselib->menu, $key, $replace);
|
||||
}
|
||||
$this->lang->testsuite->menu = $this->lang->caselib->menu;
|
||||
|
||||
@@ -13,10 +13,12 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('confirmDelete', $lang->testsuite->confirmDelete)?>
|
||||
<?php js::set('onlyTest', $config->global->flow == 'onlyTest')?>
|
||||
<?php if($this->config->global->flow != 'onlyTest'):?>
|
||||
<div id="titlebar">
|
||||
<div class="heading"> <?php echo $lang->testsuite->browse?> </div>
|
||||
<div class="actions"><?php common::printIcon('testsuite', 'create', "product=$productID");?></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<table class='table tablesorter table-fixed' id='suiteList'>
|
||||
<thead>
|
||||
<?php $vars = "productID=$productID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
|
||||
@@ -17,7 +17,14 @@ js::set('browseType', $browseType);
|
||||
js::set('moduleID', $moduleID);
|
||||
js::set('confirmDelete', $lang->testsuite->confirmDelete);
|
||||
js::set('batchDelete', $lang->testcase->confirmBatchDelete);
|
||||
js::set('flow', $this->config->global->flow);
|
||||
?>
|
||||
<?php if($this->config->global->flow == 'onlyTest'):?>
|
||||
<div id='featurebar' class='hidden'>
|
||||
<?php echo "<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a></li> ";?>
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div id='featurebar'>
|
||||
<div class='heading'>
|
||||
<?php echo "<span class='prefix'>" . html::icon($lang->icons['usecase']) . '</span><strong>' . $libName . '</strong>';?>
|
||||
@@ -76,6 +83,7 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
|
||||
</div>
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class='side' id='treebox'>
|
||||
<a class='side-handle' data-id='testcaseTree'><i class='icon-caret-left'></i></a>
|
||||
<div class='side-body'>
|
||||
@@ -213,5 +221,13 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
|
||||
<script>
|
||||
$('#module' + moduleID).addClass('active');
|
||||
$('#<?php echo $this->session->libBrowseType?>Tab').addClass('active');
|
||||
if(flow == 'onlyTest')
|
||||
{
|
||||
$('#modulemenu > .nav').append($('#featurebar').html());
|
||||
toggleSearch();
|
||||
|
||||
$('#modulemenu > .nav > li').removeClass('active');
|
||||
$('#modulemenu > .nav > li[data-id=' + browseType + ']').addClass('active');
|
||||
}
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
$(document).ready(function()
|
||||
{
|
||||
if(flow == 'onlyTest')
|
||||
{
|
||||
$('#modulemenu > .nav > li').removeClass('active');
|
||||
$('#modulemenu > .nav > li[data-id=' + status + ']').addClass('active');
|
||||
}
|
||||
});
|
||||
@@ -27,7 +27,37 @@ class testtaskModel extends model
|
||||
$selectHtml = $this->product->select($products, $productID, 'testtask', 'browse', '', $branch);
|
||||
foreach($this->lang->testtask->menu as $key => $value)
|
||||
{
|
||||
$replace = ($key == 'product') ? $selectHtml : $productID;
|
||||
if($this->config->global->flow != 'onlyTest')
|
||||
{
|
||||
$replace = ($key == 'product') ? $selectHtml : $productID;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($key == 'product')
|
||||
{
|
||||
$replace = $selectHtml;
|
||||
}
|
||||
elseif($key == 'scope')
|
||||
{
|
||||
$scope = $this->session->testTaskVersionScope;
|
||||
$status = $this->session->testTaskVersionStatus;
|
||||
$viewName = $scope == 'local'? $products[$productID] : $this->lang->testtask->all;
|
||||
|
||||
$replace = '<li>';
|
||||
$replace .= "<a data-toggle='dropdown'>{$viewName} <span class='caret'></span></a>";
|
||||
$replace .= "<ul class='dropdown-menu' style='max-height:240px;overflow-y:auto'>";
|
||||
$replace .= "<li>" . html::a(helper::createLink('testtask', 'browse', "productID=$productID&branch=$branch&type=all,$status"), $this->lang->testtask->all) . "</li>";
|
||||
$replace .= "<li>" . html::a(helper::createLink('testtask', 'browse', "productID=$productID&branch=$branch&type=local,$status"), $products[$productID]) . "</li>";
|
||||
$replace .= "</ul></li>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$replace = array();
|
||||
$replace['productID'] = $productID;
|
||||
$replace['branch'] = $branch;
|
||||
$replace['scope'] = $this->session->testTaskVersionScope;
|
||||
}
|
||||
}
|
||||
common::setMenuVars($this->lang->testtask->menu, $key, $replace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,19 +12,19 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('confirmDelete', $lang->testtask->confirmDelete)?>
|
||||
|
||||
<?php js::set('flow', $this->config->global->flow);?>
|
||||
<?php
|
||||
$scope = $this->session->testTaskVersionScope;
|
||||
$status = $this->session->testTaskVersionStatus;
|
||||
?>
|
||||
<?php js::set('status', $status);?>
|
||||
<?php if($this->config->global->flow != 'onlyTest'):?>
|
||||
<div id="featurebar">
|
||||
<ul class="nav">
|
||||
<li>
|
||||
<span class='dropdown'>
|
||||
|
||||
<?php
|
||||
$scope = $this->session->testTaskVersionScope;
|
||||
$status = $this->session->testTaskVersionStatus;
|
||||
$viewName = $scope == 'local'? $productName : $lang->testtask->all;
|
||||
?>
|
||||
|
||||
<button class='btn btn-primary btn-sm' type='button' data-toggle='dropdown'><?php echo $viewName?><span class='caret'></span></button>
|
||||
<?php $viewName = $scope == 'local'? $productName : $lang->testtask->all;?>
|
||||
<button class='btn btn-primary btn-sm' type='button' data-toggle='dropdown'><?php echo $viewName;?> <span class='caret'></span></button>
|
||||
<ul class='dropdown-menu' style='max-height:240px;overflow-y:auto'>
|
||||
<?php
|
||||
echo "<li>" . html::a(inlink('browse', "productID=$productID&branch=$branch&type=all,$status"), $lang->testtask->all) . "</li>";
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
<div class="actions"><?php common::printIcon('testtask', 'create', "product=$productID");?></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<table class='table tablesorter table-fixed' id='taskList'>
|
||||
<thead>
|
||||
<?php $vars = "productID=$productID&branch=$branch&type=$scope,$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
|
||||
@@ -352,6 +352,37 @@ class tree extends control
|
||||
if($returnType == 'json') die(json_encode($optionMenu));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax get drop menu.
|
||||
*
|
||||
* @param int $rootID
|
||||
* @param string $module
|
||||
* @param string $method
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetDropMenu($rootID, $module, $method, $extra)
|
||||
{
|
||||
$this->view->productID = $rootID;
|
||||
$this->view->module = $module;
|
||||
$this->view->method = $method;
|
||||
$this->view->extra = $extra;
|
||||
|
||||
if($module == 'bug') $viewType = 'bug';
|
||||
if($module == 'testcase') $viewType = 'case';
|
||||
if($module == 'testsuite') $viewType = 'caselib';
|
||||
|
||||
$modules = $this->tree->getOptionMenu($rootID, $viewType);
|
||||
$modulesPinyin = common::convert2Pinyin($modules);
|
||||
|
||||
$this->view->link = $viewType == 'caselib' ? helper::createLink($module, $method, "rootID=%s&type=byModule¶m=%s") : helper::createLink($module, $method, "rootID=%s&branch=&type=byModule¶m=%s");
|
||||
$this->view->viewType = $viewType;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->modulesPinyin = $modulesPinyin;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX: get modules.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php js::set('productID', $productID);?>
|
||||
<?php js::set('module', $module);?>
|
||||
<?php js::set('method', $method);?>
|
||||
<?php js::set('extra', $extra);?>
|
||||
<input type='text' class='form-control' id='search' value='' placeholder='<?php echo $this->app->loadLang('search')->search->common;?>'/>
|
||||
<div id='searchResult'>
|
||||
<div id='defaultMenu' class='search-list'>
|
||||
<ul>
|
||||
<?php
|
||||
foreach($modules as $moduleID => $module)
|
||||
{
|
||||
echo "<li data-id='{$moduleID}' data-key='{$modulesPinyin[$module]}'>" . html::a(sprintf($link, $productID, $moduleID), "<i class='icon-cube'></i> " . $module, '', "class='text-important'"). "</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
+1
-1
@@ -87,7 +87,7 @@ function shortcut()
|
||||
*/
|
||||
function showSearchMenu(objectType, objectID, module, method, extra)
|
||||
{
|
||||
var $toggle = $(objectType == 'branch' ? '#currentBranch' : '#currentItem').closest('li').toggleClass('show');
|
||||
var $toggle = $(objectType == 'branch' ? '#currentBranch' : (objectType == 'tree' ? '#currentModule' : '#currentItem')).closest('li').toggleClass('show');
|
||||
if(!$toggle.hasClass('show')) return;
|
||||
var $menu = $toggle.find('#dropMenu');
|
||||
var uuid = $.zui.uuid();
|
||||
|
||||
Reference in New Issue
Block a user