* Finish task #4434, 4461, 4468, 4471, 4474

This commit is contained in:
liugang
2018-06-14 14:31:19 +08:00
parent 0c71a11573
commit 90656f49ba
29 changed files with 500 additions and 359 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ class bug extends control
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
/* Set menu and save session. */
$this->bug->setMenu($this->products, $productID, $branch, $moduleID);
$this->bug->setMenu($this->products, $productID, $branch, $moduleID, $browseType, $orderBy);
$this->session->set('bugList', $this->app->getURI(true));
/* Process the order by field. */
-3
View File
@@ -4,9 +4,6 @@ $(function()
if(flow == 'onlyTest')
{
toggleSearch();
$(".export").modalTrigger({width:650, type:'iframe'});
$('#subNavbar > .nav > li').removeClass('active');
$('#subNavbar > .nav > li[data-id=' + browseType + ']').addClass('active');
+10
View File
@@ -1,5 +1,7 @@
$(function()
{
$('#subNavbar a[data-toggle=dropdown]').parent().addClass('dropdown dropdown-hover');
if(typeof page == 'undefined') page = '';
if(page == 'create')
{
@@ -20,6 +22,14 @@ $(function()
oldProductID = $('#product').val();
$("#story, #task, #mailto").chosen(defaultChosenOptions);
}
if(flow != 'full')
{
$('.querybox-toggle').click(function()
{
$(this).parent().toggleClass('active');
});
}
});
/**
+87 -8
View File
@@ -15,22 +15,71 @@ class bugModel extends model
{
/**
* Set menu.
*
* @param array $products
* @param int $productID
*
* @param array $products
* @param int $productID
* @param int $branch
* @param int $moduleID
* @param string $browseType
* @param string $orderBy
* @access public
* @return void
*/
public function setMenu($products, $productID, $branch = 0, $moduleID = 0)
public function setMenu($products, $productID, $branch = 0, $moduleID = 0, $browseType = 'unclosed', $orderBy = '')
{
$this->loadModel('product')->setMenu($products, $productID, $branch, $moduleID, 'bug');
$selectHtml = $this->product->select($products, $productID, 'bug', 'browse', '', $branch, $moduleID, 'bug');
$this->app->loadLang('qa');
$productIndex = '<div class="btn-group angle-btn"><div class="btn-group">' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '</div></div>';
$productIndex .= $selectHtml;
$pageNav = '';
$pageActions = '';
if($this->config->global->flow == 'full')
{
$this->app->loadLang('qa');
$pageNav = '<div class="btn-group angle-btn"><div class="btn-group">' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '</div></div>';
}
else
{
if(common::hasPriv('bug', 'report'))
{
$link = helper::createLink('bug', 'report', "productID=$productID&browseType=$browseType&branchID=$branch&moduleID=$moduleID");
$pageActions .= html::a($link, "<i class='icon-common-report icon-bar-chart muted'></i> <span class='text'>" . $this->lang->bug->report->common . '</span>', '', "class='btn btn-link'");
}
if(common::hasPriv('bug', 'export'))
{
$link = helper::createLink('bug', 'export', "productID=$productID&orderBy=$orderBy");
$pageActions .= "<div class='btn-group'>";
$pageActions .= "<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown'>";
$pageActions .= "<i class='icon icon-export muted'></i><span class='text'>{$this->lang->export}</span><span class='caret'></span></button>";
$pageActions .= '</button>';
$pageActions .= "<ul class='dropdown-menu' id='exportActionMenu'>";
$pageActions .= '<li>' . html::a($link, $this->lang->bug->export, '', "class='export'") . '</li>';
$pageActions .= '</ul>';
$pageActions .= '</div>';
}
if(common::hasPriv('bug', 'batchCreate'))
{
$link = helper::createLink('bug', 'batchCreate', "productID=$productID&branch=$branch&projectID=0&moduleID=$moduleID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i>" . $this->lang->bug->batchCreate, '', "class='btn btn-secondary'");
}
if(commonModel::isTutorialMode())
{
$wizardParams = helper::safe64Encode("productID=$productID&branch=$branch&extra=moduleID=$moduleID");
$link = helper::createLink('tutorial', 'wizard', "module=bug&method=create&params=$wizardParams");
$pageActions .= html::a($link, "<i class='icon-plus'></i>" . $this->lang->bug->create, '', "class='btn btn-primary btn-bug-create'");
}
else
{
if(common::hasPriv('bug', 'create'))
{
$link = helper::createLink('bug', 'create', "productID=$productID&branch=$branch&extra=moduleID=$moduleID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i>" . $this->lang->bug->create, '', "class='btn btn-primary'");
}
}
}
$pageNav .= $selectHtml;
$this->lang->modulePageNav = $productIndex;
$this->lang->modulePageNav = $pageNav;
$this->lang->modulePageActions = $pageActions;
foreach($this->lang->bug->menu as $key => $menu)
{
if($this->config->global->flow != 'onlyTest')
@@ -46,6 +95,36 @@ class bugModel extends model
}
common::setMenuVars($this->lang->bug->menu, $key, $replace);
}
if($this->config->global->flow != 'full')
{
$tmpMenu = (array)$this->lang->bug->menu;
$moreMenu = array_slice($tmpMenu, -6);
$tmpMenu = array_slice($tmpMenu, 0, count($tmpMenu) - 6);
if($moreMenu)
{
$moreKey = 'more';
$moreLabel = $this->lang->more;
if(strpos(",unconfirmed,assigntonull,longlifebugs,postponedbugs,overduebugs,needconfirm,", ",$browseType,") !== false)
{
$moreKey = $browseType;
$moreLabel = $this->lang->bug->featureBar['browse'][$browseType];
}
$more = "<a data-toggle='dropdown'>{$moreLabel}<span class='caret'></span></a>";
$more .= "<ul class='dropdown-menu'>";
foreach($moreMenu as $menu)
{
list($label, $module, $method, $params) = explode('|', $menu);
if(common::hasPriv($module, $method))
{
$more .= '<li>' . html::a(helper::createLink($module, $method, $params), $label) . '</li>';
}
}
$more .= '</ul>';
$tmpMenu[$moreKey] = $more;
}
if($this->app->getMethodName() != 'view') $tmpMenu['bysearch'] = "<a class='querybox-toggle' id='bysearchTab'><i class='icon icon-search muted'> </i>{$this->lang->bug->byQuery}</a>";
$this->lang->bug->menu = (object)$tmpMenu;
}
}
/**
+5 -54
View File
@@ -16,61 +16,13 @@ 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);
js::set('productID', $productID);
js::set('branch', $branch);
js::set('flow', $this->config->global->flow);
js::set('productID', $productID);
js::set('branch', $branch);
$currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($browseType, array_keys($lang->bug->mySelects)) ? $browseType : '';
?>
<?php if($this->config->global->flow == 'full'):?>
<div id="mainMenu" class="clearfix">
<?php if($this->config->global->flow == 'onlyTest'):?>
<div id='featurebar'>
<ul class='submenu hidden'>
<li id='moreMenus' class='hidden'>
<a href='###' class='dropdown-toggle' data-toggle='dropdown'>
<?php echo $lang->more;?> <span class='caret'></span>
</a>
<ul class='dropdown-menu right'>
</ul>
</li>
<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i>&nbsp;<?php echo $lang->bug->byQuery;?></a></li>
<li class='right'>
<div class='btn-group' id='createActionMenu'>
<?php
$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);
$misc = common::hasPriv('bug', 'batchCreate') ? '' : "disabled";
$link = common::hasPriv('bug', 'batchCreate') ? $this->createLink('bug', 'batchCreate', "productID=$productID&branch=$branch&projectID=0&moduleID=$moduleID") : '#';
?>
<button type='button' class='btn btn-primary dropdown-toggle <?php echo $misc?>' data-toggle='dropdown'>
<span class='caret'></span>
</button>
<ul class='dropdown-menu right'>
<?php echo "<li>" . html::a($link, $lang->bug->batchCreate, '', "class='$misc'") . "</li>";?>
</ul>
</div>
</li>
<li class='right'>
<?php common::printLink('bug', 'report', "productID=$productID&browseType=$browseType&branchID=$branch&moduleID=$moduleID", "<i class='icon icon-bar-chart muted'></i> " . $lang->bug->report->common); ?>
</li>
<li class='right'>
<a href='###' 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>
</ul>
<div id='queryBox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
</div>
<?php else:?>
<div id="sidebarHeader">
<div class="title">
<?php
@@ -102,7 +54,6 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
foreach($menus as $menuItem)
{
if(isset($menuItem->hidden) and $menuItem->name != 'QUERY') continue;
if($this->config->global->flow == 'onlyTest' and $menuItem->name == 'needconfirm') continue;
$menuBrowseType = strpos($menuItem->name, 'QUERY') === 0 ? 'bySearch' : $menuItem->name;
$label = "<span class='text'>{$menuItem->text}</span>";
@@ -195,8 +146,8 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
}
?>
</div>
<?php endif;?>
</div>
<?php endif;?>
<div id="mainContent" class="main-row fade">
<div class="side-col" id="sidebar">
<div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
+31 -32
View File
@@ -160,13 +160,14 @@ $lang->exportTypeList['selected'] = 'Selected';
$lang->lang = 'Language';
/* 风格列表。*/
$lang->themes['default'] = 'ZenTao Blue (default)';
$lang->themes['green'] = 'Green';
$lang->themes['red'] = 'Red';
$lang->themes['purple'] = 'Purple';
$lang->themes['pink'] = 'Pink';
$lang->themes['blackberry'] = 'Blackberry';
$lang->themes['classic'] = 'Classic';
$lang->theme = 'Theme';
$lang->themes['default'] = 'ZenTao Blue (default)';
$lang->themes['green'] = 'Green';
$lang->themes['red'] = 'Red';
$lang->themes['purple'] = 'Purple';
$lang->themes['pink'] = 'Pink';
$lang->themes['blackberry'] = 'Blackberry';
$lang->themes['classic'] = 'Classic';
/* 首页菜单设置。*/
$lang->index = new stdclass();
@@ -713,32 +714,34 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
/* Adjust sub menu of bug module. */
$lang->bug->menu = new stdclass();
$lang->bug->menu->unclosed = 'Open|bug|browse|productID=%s&branch=%s&browseType=unclosed&param=%s';
$lang->bug->menu->all = 'All|bug|browse|productID=%s&branch=%s&browseType=all&param=%s';
$lang->bug->menu->assigntome = 'AssignedToMe|bug|browse|productID=%s&branch=%s&browseType=assigntome&param=%s';
$lang->bug->menu->unclosed = 'Open|bug|browse|productID=%s&branch=%s&browseType=unclosed&param=%s';
$lang->bug->menu->openedbyme = 'CreatedByMe|bug|browse|productID=%s&branch=%s&browseType=openedbyme&param=%s';
$lang->bug->menu->assigntome = 'AssignedToMe|bug|browse|productID=%s&branch=%s&browseType=assigntome&param=%s';
$lang->bug->menu->resolvedbyme = 'ResolvedByMe|bug|browse|productID=%s&branch=%s&browseType=resolvedbyme&param=%s';
$lang->bug->menu->toclosed = 'ToBeClosed|bug|browse|productID=%s&branch=%s&browseType=toclosed&param=%s';
$lang->bug->menu->unresolved = 'Unresolved|bug|browse|productID=%s&branch=%s&browseType=unresolved&param=%s';
$lang->bug->menu->unconfirmed = 'Unconfirmed|bug|browse|productID=%s&branch=%s&browseType=unconfirmed&param=%s';
$lang->bug->menu->assigntonull = 'Unassigned|bug|browse|productID=%s&branch=%s&browseType=assigntonull&param=%s';
$lang->bug->menu->unresolved = 'Unresolved|bug|browse|productID=%s&branch=%s&browseType=unresolved&param=%s';
$lang->bug->menu->toclosed = 'ToBeClosed|bug|browse|productID=%s&branch=%s&browseType=toclosed&param=%s';
$lang->bug->menu->longlifebugs = 'Pending|bug|browse|productID=%s&branch=%s&browseType=longlifebugs&param=%s';
$lang->bug->menu->postponedbugs = 'PostPoned|bug|browse|productID=%s&branch=%s&browseType=postponedbugs&param=%s';
$lang->bug->menu->overduebugs = 'Overdue|bug|browse|productID=%s&branch=%s&browseType=overduebugs&param=%s';
$lang->bug->menu->needconfirm = 'NeedConfirm|bug|browse|productID=%s&branch=%s&browseType=needconfirm&param=%s';
$lang->bug->menuOrder[5] = 'product';
$lang->bug->menuOrder[10] = 'unclosed';
$lang->bug->menuOrder[15] = 'all';
$lang->bug->menuOrder[20] = 'assigntome';
$lang->bug->menuOrder[25] = 'openedbyme';
$lang->bug->menuOrder[10] = 'all';
$lang->bug->menuOrder[15] = 'unclosed';
$lang->bug->menuOrder[20] = 'openedbyme';
$lang->bug->menuOrder[25] = 'assigntome';
$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[35] = 'toclosed';
$lang->bug->menuOrder[40] = 'unresolved';
$lang->bug->menuOrder[45] = 'unconfirmed';
$lang->bug->menuOrder[50] = 'assigntonull';
$lang->bug->menuOrder[55] = 'longlifebugs';
$lang->bug->menuOrder[60] = 'postponedbugs';
$lang->bug->menuOrder[65] = 'overduebugs';
$lang->bug->menuOrder[70] = 'needconfirm';
/* Adjust sub menu of testcase. */
$lang->testcase->menu = new stdclass();
@@ -753,30 +756,26 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
/* Adjust sub menu of bug module. */
$lang->testsuite->menu = new stdclass();
$lang->testsuite->menu->create = array('link' => "<i class='icon-plus'></i> Create Suite|testsuite|create|productID=%s", 'float' => 'right');
$lang->testsuite->menuOrder[5] = 'product';
$lang->testsuite->menuOrder[10] = 'create';
/* Adjust sub menu of testtask. */
$lang->testtask->menu = new stdclass();
$lang->testtask->menu->totalStatus = 'All|testtask|browse|productID=%s&branch=%s&type=%s,totalStatus';
$lang->testtask->menu->wait = 'Wait|testtask|browse|productID=%s&branch=%s&type=%s,wait';
$lang->testtask->menu->doing = 'Doing|testtask|browse|productID=%s&branch=%s&type=%s,doing';
$lang->testtask->menu->blocked = 'Blocked|testtask|browse|productID=%s&branch=%s&type=%s,blocked';
$lang->testtask->menu->done = 'Done|testtask|browse|productID=%s&branch=%s&type=%s,done';
$lang->testtask->menu->totalStatus = 'All|testtask|browse|productID=%s&branch=%s&type=%s,totalStatus';
$lang->testtask->menu->report = array('link' => 'Report|testreport|browse');
$lang->testtask->menu->create = array('link' => "<i class='icon-plus'></i> Create|testtask|create|productID=%s", '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';
$lang->testtask->menuOrder[5] = 'product';
$lang->testtask->menuOrder[10] = 'scope';
$lang->testtask->menuOrder[15] = 'totalStatus';
$lang->testtask->menuOrder[20] = 'wait';
$lang->testtask->menuOrder[25] = 'doing';
$lang->testtask->menuOrder[30] = 'blocked';
$lang->testtask->menuOrder[35] = 'done';
$lang->testtask->menuOrder[40] = 'report';
$lang->testreport->menu = $lang->testtask->menu;
$lang->testreport->menuOrder = $lang->testtask->menuOrder;
+20 -22
View File
@@ -714,32 +714,34 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
/* Adjust sub menu of bug module. */
$lang->bug->menu = new stdclass();
$lang->bug->menu->unclosed = '未关闭|bug|browse|productID=%s&branch=%s&browseType=unclosed&param=%s';
$lang->bug->menu->all = '所有|bug|browse|productID=%s&branch=%s&browseType=all&param=%s';
$lang->bug->menu->assigntome = '指派给我|bug|browse|productID=%s&branch=%s&browseType=assigntome&param=%s';
$lang->bug->menu->unclosed = '未关闭|bug|browse|productID=%s&branch=%s&browseType=unclosed&param=%s';
$lang->bug->menu->openedbyme = '由我创建|bug|browse|productID=%s&branch=%s&browseType=openedbyme&param=%s';
$lang->bug->menu->assigntome = '指派给我|bug|browse|productID=%s&branch=%s&browseType=assigntome&param=%s';
$lang->bug->menu->resolvedbyme = '由我解决|bug|browse|productID=%s&branch=%s&browseType=resolvedbyme&param=%s';
$lang->bug->menu->toclosed = '待关闭|bug|browse|productID=%s&branch=%s&browseType=toclosed&param=%s';
$lang->bug->menu->unresolved = '未解决|bug|browse|productID=%s&branch=%s&browseType=unresolved&param=%s';
$lang->bug->menu->unconfirmed = '未确认|bug|browse|productID=%s&branch=%s&browseType=unconfirmed&param=%s';
$lang->bug->menu->assigntonull = '未指派|bug|browse|productID=%s&branch=%s&browseType=assigntonull&param=%s';
$lang->bug->menu->unresolved = '未解决|bug|browse|productID=%s&branch=%s&browseType=unresolved&param=%s';
$lang->bug->menu->toclosed = '待关闭|bug|browse|productID=%s&branch=%s&browseType=toclosed&param=%s';
$lang->bug->menu->longlifebugs = '久未处理|bug|browse|productID=%s&branch=%s&browseType=longlifebugs&param=%s';
$lang->bug->menu->postponedbugs = '被延期|bug|browse|productID=%s&branch=%s&browseType=postponedbugs&param=%s';
$lang->bug->menu->overduebugs = '过期Bug|bug|browse|productID=%s&branch=%s&browseType=overduebugs&param=%s';
$lang->bug->menu->needconfirm = '需求变动|bug|browse|productID=%s&branch=%s&browseType=needconfirm&param=%s';
$lang->bug->menuOrder[5] = 'product';
$lang->bug->menuOrder[10] = 'unclosed';
$lang->bug->menuOrder[15] = 'all';
$lang->bug->menuOrder[20] = 'assigntome';
$lang->bug->menuOrder[25] = 'openedbyme';
$lang->bug->menuOrder[10] = 'all';
$lang->bug->menuOrder[15] = 'unclosed';
$lang->bug->menuOrder[20] = 'openedbyme';
$lang->bug->menuOrder[25] = 'assigntome';
$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[35] = 'toclosed';
$lang->bug->menuOrder[40] = 'unresolved';
$lang->bug->menuOrder[45] = 'unconfirmed';
$lang->bug->menuOrder[50] = 'assigntonull';
$lang->bug->menuOrder[55] = 'longlifebugs';
$lang->bug->menuOrder[60] = 'postponedbugs';
$lang->bug->menuOrder[65] = 'overduebugs';
$lang->bug->menuOrder[70] = 'needconfirm';
/* Adjust sub menu of testcase. */
$lang->testcase->menu = new stdclass();
@@ -754,30 +756,26 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
/* Adjust sub menu of bug module. */
$lang->testsuite->menu = new stdclass();
$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] = 'create';
/* Adjust sub menu of testtask. */
$lang->testtask->menu = new stdclass();
$lang->testtask->menu->totalStatus = '所有|testtask|browse|productID=%s&branch=%s&type=%s,totalStatus';
$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', 'alias' => 'view,create,edit');
$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] = '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[15] = 'totalStatus';
$lang->testtask->menuOrder[20] = 'wait';
$lang->testtask->menuOrder[25] = 'doing';
$lang->testtask->menuOrder[30] = 'blocked';
$lang->testtask->menuOrder[35] = 'done';
$lang->testtask->menuOrder[40] = 'report';
$lang->testtask->menuOrder[45] = 'create';
$lang->testreport->menu = $lang->testtask->menu;
$lang->testreport->menuOrder = $lang->testtask->menuOrder;
+14 -12
View File
@@ -714,32 +714,34 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
/* Adjust sub menu of bug module. */
$lang->bug->menu = new stdclass();
$lang->bug->menu->unclosed = '未關閉|bug|browse|productID=%s&branch=%s&browseType=unclosed&param=%s';
$lang->bug->menu->all = '所有|bug|browse|productID=%s&branch=%s&browseType=all&param=%s';
$lang->bug->menu->assigntome = '指派給我|bug|browse|productID=%s&branch=%s&browseType=assigntome&param=%s';
$lang->bug->menu->unclosed = '未關閉|bug|browse|productID=%s&branch=%s&browseType=unclosed&param=%s';
$lang->bug->menu->openedbyme = '由我創建|bug|browse|productID=%s&branch=%s&browseType=openedbyme&param=%s';
$lang->bug->menu->assigntome = '指派給我|bug|browse|productID=%s&branch=%s&browseType=assigntome&param=%s';
$lang->bug->menu->resolvedbyme = '由我解決|bug|browse|productID=%s&branch=%s&browseType=resolvedbyme&param=%s';
$lang->bug->menu->toclosed = '待關閉|bug|browse|productID=%s&branch=%s&browseType=toclosed&param=%s';
$lang->bug->menu->unresolved = '未解決|bug|browse|productID=%s&branch=%s&browseType=unresolved&param=%s';
$lang->bug->menu->unconfirmed = '未確認|bug|browse|productID=%s&branch=%s&browseType=unconfirmed&param=%s';
$lang->bug->menu->assigntonull = '未指派|bug|browse|productID=%s&branch=%s&browseType=assigntonull&param=%s';
$lang->bug->menu->unresolved = '未解決|bug|browse|productID=%s&branch=%s&browseType=unresolved&param=%s';
$lang->bug->menu->toclosed = '待關閉|bug|browse|productID=%s&branch=%s&browseType=toclosed&param=%s';
$lang->bug->menu->longlifebugs = '久未處理|bug|browse|productID=%s&branch=%s&browseType=longlifebugs&param=%s';
$lang->bug->menu->postponedbugs = '被延期|bug|browse|productID=%s&branch=%s&browseType=postponedbugs&param=%s';
$lang->bug->menu->overduebugs = '過期Bug|bug|browse|productID=%s&branch=%s&browseType=overduebugs&param=%s';
$lang->bug->menu->needconfirm = '需求變動|bug|browse|productID=%s&branch=%s&browseType=needconfirm&param=%s';
$lang->bug->menuOrder[5] = 'product';
$lang->bug->menuOrder[10] = 'unclosed';
$lang->bug->menuOrder[15] = 'all';
$lang->bug->menuOrder[20] = 'assigntome';
$lang->bug->menuOrder[25] = 'openedbyme';
$lang->bug->menuOrder[10] = 'all';
$lang->bug->menuOrder[15] = 'unclosed';
$lang->bug->menuOrder[20] = 'openedbyme';
$lang->bug->menuOrder[25] = 'assigntome';
$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[35] = 'toclosed';
$lang->bug->menuOrder[40] = 'unresolved';
$lang->bug->menuOrder[45] = 'unconfirmed';
$lang->bug->menuOrder[50] = 'assigntonull';
$lang->bug->menuOrder[55] = 'longlifebugs';
$lang->bug->menuOrder[60] = 'postponedbugs';
$lang->bug->menuOrder[65] = 'overduebugs';
$lang->bug->menuOrder[70] = 'needconfirm';
/* Adjust sub menu of testcase. */
$lang->testcase->menu = new stdclass();
+20 -9
View File
@@ -55,24 +55,35 @@ class productModel extends model
if($currentModule == 'product' && $currentMethod == 'all') $label = $this->lang->product->all;
if($currentModule == 'product' && $currentMethod == 'create') $label = $this->lang->product->create;
$productIndex = '<div class="btn-group angle-btn"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $label . ' <span class="caret"></span></button>';
$productIndex .= '<ul class="dropdown-menu">';
if(common::hasPriv('product', 'index')) $productIndex .= '<li>' . html::a(helper::createLink('product', 'index', 'locate=no'), '<i class="icon icon-home"></i> ' . $this->lang->product->index) . '</li>';
if(common::hasPriv('product', 'all')) $productIndex .= '<li>' . html::a(helper::createLink('product', 'all'), '<i class="icon icon-cards-view"></i> ' . $this->lang->product->all) . '</li>';
$pageNav = '<div class="btn-group angle-btn"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $label . ' <span class="caret"></span></button>';
$pageNav .= '<ul class="dropdown-menu">';
if(common::hasPriv('product', 'index')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'index', 'locate=no'), '<i class="icon icon-home"></i> ' . $this->lang->product->index) . '</li>';
if(common::hasPriv('product', 'all')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'all'), '<i class="icon icon-cards-view"></i> ' . $this->lang->product->all) . '</li>';
if(common::isTutorialMode())
{
$wizardParams = helper::safe64Encode('');
$link = helper::createLink('tutorial', 'wizard', "module=product&method=create&params=$wizardParams");
$productIndex .= '<li>' . html::a($link, "<i class='icon icon-plus'></i> {$this->lang->product->create}", '', "class='create-product-btn'") . '</li>';
$pageNav .= '<li>' . html::a($link, "<i class='icon icon-plus'></i> {$this->lang->product->create}", '', "class='create-product-btn'") . '</li>';
}
else
{
if(common::hasPriv('product', 'create')) $productIndex .= '<li>' . html::a(helper::createLink('product', 'create'), '<i class="icon icon-plus"></i> ' . $this->lang->product->create) . '</li>';
if(common::hasPriv('product', 'create')) $pageNav .= '<li>' . html::a(helper::createLink('product', 'create'), '<i class="icon icon-plus"></i> ' . $this->lang->product->create) . '</li>';
}
$productIndex .= '</ul></div></div>';
$productIndex .= $selectHtml;
$pageNav .= '</ul></div></div>';
$pageNav .= $selectHtml;
$this->lang->modulePageNav = $productIndex;
$pageActions = '';
if($this->config->global->flow != 'full')
{
if($currentMethod == 'build' && common::hasPriv('build', 'create'))
{
$this->app->loadLang('build');
$pageActions .= html::a(helper::createLink('build', 'create', "productID=$productID"), "<i class='icon icon-plus'></i> {$this->lang->build->create}", '', "class='btn btn-primary'");
}
}
$this->lang->modulePageNav = $pageNav;
$this->lang->modulePageActions = $pageActions;
foreach($this->lang->product->menu as $key => $menu)
{
$replace = $productID;
+61 -59
View File
@@ -1,59 +1,61 @@
<?php
/**
* The build view file of product module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package product
* @version $Id
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('confirmDelete', $lang->build->confirmDelete)?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<a class='btn btn-link btn-active-text'><span class='text'><?php echo $lang->product->build;?></span><span class='label label-light label-badge'><?php echo count($builds);?></span></a>
</div>
<div class='btn-toolbar pull-right'><?php common::printLink('build', 'create', "product=$product->id", "<i class='icon icon-plus'></i> " . $lang->build->create, '', "class='btn btn-primary'");?></div>
</div>
<div id='mainContent' class='main-table'>
<table class='table' id='buildList'>
<thead>
<tr class='text-center'>
<th class='w-id'><?php echo $lang->build->id;?></th>
<th><?php echo $lang->build->name;?></th>
<th><?php echo $lang->build->scmPath;?></th>
<th><?php echo $lang->build->filePath;?></th>
<th class='c-date'><?php echo $lang->build->date;?></th>
<th class='c-user'><?php echo $lang->build->builder;?></th>
<th class='c-actions-3'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($builds as $build):?>
<tr class='text-center'>
<td><?php echo $build->id;?></td>
<td class='text-left'><?php echo html::a($this->createLink('build', 'view', "build=$build->id"), $build->name);?></td>
<td class='text-left' title="<?php echo $build->scmPath?>"><?php echo strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath;?></td>
<td class='text-left' title="<?php echo $build->filePath?>"><?php echo strpos($build->filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath;?></td>
<td><?php echo $build->date?></td>
<td><?php echo $users[$build->builder]?></td>
<td class='c-actions'>
<?php
common::printIcon('testtask', 'create', "product=$product->id&project=0&build=$build->id", '', 'list', 'bullhorn');
common::printIcon('build', 'edit', "buildID=$build->id", '', 'list');
if(common::hasPriv('build', 'delete'))
{
$deleteURL = $this->createLink('build', 'delete', "buildID=$build->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"buildList\",confirmDelete)", '<i class="icon-trash"></i>', '', "class='btn' title='{$lang->build->delete}'");
}
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<?php include '../../common/view/footer.html.php';?>
<?php
/**
* The build view file of product module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package product
* @version $Id
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('confirmDelete', $lang->build->confirmDelete)?>
<?php if($config->global->flow == 'full'):?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<a class='btn btn-link btn-active-text'><span class='text'><?php echo $lang->product->build;?></span><span class='label label-light label-badge'><?php echo count($builds);?></span></a>
</div>
<div class='btn-toolbar pull-right'><?php common::printLink('build', 'create', "product=$product->id", "<i class='icon icon-plus'></i> " . $lang->build->create, '', "class='btn btn-primary'");?></div>
</div>
<?php endif;?>
<div id='mainContent' class='main-table'>
<table class='table' id='buildList'>
<thead>
<tr class='text-center'>
<th class='w-id'><?php echo $lang->build->id;?></th>
<th><?php echo $lang->build->name;?></th>
<th><?php echo $lang->build->scmPath;?></th>
<th><?php echo $lang->build->filePath;?></th>
<th class='c-date'><?php echo $lang->build->date;?></th>
<th class='c-user'><?php echo $lang->build->builder;?></th>
<th class='c-actions-3'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($builds as $build):?>
<tr class='text-center'>
<td><?php echo $build->id;?></td>
<td class='text-left'><?php echo html::a($this->createLink('build', 'view', "build=$build->id"), $build->name);?></td>
<td class='text-left' title="<?php echo $build->scmPath?>"><?php echo strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath;?></td>
<td class='text-left' title="<?php echo $build->filePath?>"><?php echo strpos($build->filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath;?></td>
<td><?php echo $build->date?></td>
<td><?php echo $users[$build->builder]?></td>
<td class='c-actions'>
<?php
common::printIcon('testtask', 'create', "product=$product->id&project=0&build=$build->id", '', 'list', 'bullhorn');
common::printIcon('build', 'edit', "buildID=$build->id", '', 'list');
if(common::hasPriv('build', 'delete'))
{
$deleteURL = $this->createLink('build', 'delete', "buildID=$build->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"buildList\",confirmDelete)", '<i class="icon-trash"></i>', '', "class='btn' title='{$lang->build->delete}'");
}
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<?php include '../../common/view/footer.html.php';?>
+1 -1
View File
@@ -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, $moduleID, $suiteID);
$this->testcase->setMenu($this->products, $productID, $branch, $moduleID, $suiteID, $orderBy);
$this->session->set('caseList', $this->app->getURI(true));
$this->session->set('productID', $productID);
$this->session->set('moduleID', $moduleID);
-3
View File
@@ -17,9 +17,6 @@ $(function()
if(flow == 'onlyTest')
{
toggleSearch();
$('.export').modalTrigger({width:650, type:'iframe', afterShown: setCheckedCookie})
$('#subNavbar > .nav > li').removeClass('active');
$('#subNavbar > .nav > li[data-id=' + browseType + ']').addClass('active');
}
+13
View File
@@ -1,3 +1,16 @@
$(function()
{
$('#subNavbar a[data-toggle=dropdown]').parent().addClass('dropdown dropdown-hover');
if(flow != 'full')
{
$('.querybox-toggle').click(function()
{
$(this).parent().toggleClass('active');
});
}
})
var newRowID = 0;
/**
* Load modules and stories of a product.
+6 -1
View File
@@ -1,3 +1,8 @@
$(function()
{
$('.querybox-toggle').parent().addClass('active');
})
function reload(libID)
{
link = createLink('testcase','importFromLib','productID='+ productID + '&branch=' + branch + '&libID='+libID);
@@ -18,4 +23,4 @@ function setModule(obj)
$(this).find("[data-module='" + libModule + "']").find("select[id^='module']").val(moduleID).trigger("chosen:updated");
}
})
}
}
+95 -14
View File
@@ -16,21 +16,91 @@ class testcaseModel extends model
/**
* Set menu.
*
* @param array $products
* @param int $productID
* @param array $products
* @param int $productID
* @param int $branch
* @param int $moduleID
* @param int $suiteID
* @param string $orderBy
* @access public
* @return void
*/
public function setMenu($products, $productID, $branch = 0, $moduleID = 0, $suiteID = 0)
public function setMenu($products, $productID, $branch = 0, $moduleID = 0, $suiteID = 0, $orderBy = 'id_desc')
{
$this->loadModel('product')->setMenu($products, $productID, $branch, $moduleID, 'case');
$selectHtml = $this->product->select($products, $productID, 'testcase', 'browse', '', $branch, $moduleID, 'case');
$this->app->loadLang('qa');
$productIndex = '<div class="btn-group angle-btn"><div class="btn-group">' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '</div></div>';
$productIndex .= $selectHtml;
$pageNav = '';
$pageActions = '';
if($this->config->global->flow == 'full')
{
$this->app->loadLang('qa');
$pageNav = '<div class="btn-group angle-btn"><div class="btn-group">' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '</div></div>';
}
else
{
$exportPriv = common::hasPriv('testcase', 'export');
$exportTempletPriv = common::hasPriv('testcase', 'exportTemplet');
$importPriv = common::hasPriv('testcase', 'import');
$importFromLibPriv = common::hasPriv('testcase', 'importFromLib');
if($exportPriv or $exportTempletPriv)
{
$pageActions .= "<div class='btn-group'>";
$pageActions .= "<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown'>";
$pageActions .= "<i class='icon icon-export muted'></i> {$this->lang->export}";
$pageActions .= "<span class='caret'></span>";
$pageActions .= '</button>';
$pageActions .= "<ul class='dropdown-menu' id='exportActionMenu'>";
if($exportPriv)
{
$link = helper::createLink('testcase', 'export', "productID=$productID&orderBy=$orderBy");
$pageActions .= '<li>' . html::a($link, $this->lang->testcase->export, '', "class='export'") . '</li>';
}
if($exportTempletPriv)
{
$link = helper::createLink('testcase', 'exportTemplet', "productID=$productID");
$pageActions .= '<li>' . html::a($link, $this->lang->testcase->exportTemplet, '', "class='export'") . '</li>';
}
$pageActions .= '</ul>';
$pageActions .= '</div>';
$this->lang->modulePageNav = $productIndex;
}
if($importPriv or $importFromLibPriv)
{
$pageActions .= "<div class='btn-group'>";
$pageActions .= "<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown' id='importAction'><i class='icon icon-import muted'></i> {$this->lang->import}<span class='caret'></span></button>";
$pageActions .= "<ul class='dropdown-menu' id='importActionMenu'>";
if($importPriv)
{
$link = helper::createLink('testcase', 'import', "productID=$productID&branch=$branch");
$pageActions .= '<li>' . html::a($link, $this->lang->testcase->importFile, '', "class='export'") . '</li>';
}
if($importFromLibPriv)
{
$link = helper::createLink('testcase', 'importFromLib', "productID=$productID&branch=$branch");
$pageActions .= '<li>' . html::a($link, $this->lang->testcase->importFromLib) . '</li>';
}
$pageActions .= '</ul>';
$pageActions .= '</div>';
}
$initModule = isset($moduleID) ? (int)$moduleID : 0;
if(common::hasPriv('testcase', 'batchCreate'))
{
$link = helper::createLink('testcase', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$initModule");
$pageActions .= html::a($link, "<i class='icon-plus'></i> " . $this->lang->testcase->batchCreate, '', "class='btn btn-secondary'");
}
if(common::hasPriv('testcase', 'create'))
{
$link = helper::createLink('testcase', 'create', "productID=$productID&branch=$branch&moduleID=$initModule");
$pageActions .= html::a($link, "<i class='icon-plus'></i> " . $this->lang->testcase->create, '', "class='btn btn-primary'");
}
}
$pageNav .= $selectHtml;
$this->lang->modulePageNav = $pageNav;
$this->lang->modulePageActions = $pageActions;
foreach($this->lang->testcase->menu as $key => $menu)
{
if($this->config->global->flow != 'onlyTest')
@@ -46,18 +116,28 @@ class testcaseModel extends model
$currentSuite = zget($suiteList, $currentSuiteID, '');
$currentLable = empty($currentSuite) ? $this->lang->testsuite->common : $currentSuite->name;
$replace = "<li id='bysuiteTab' class='dropdown'>";
$replace = "<li id='bysuiteTab' class='dropdown' data-id='bysuite'>";
$replace .= html::a('javascript:;', $currentLable . " <span class='caret'></span>", '', "data-toggle='dropdown'");
$replace .="<ul class='dropdown-menu' style='max-height:240px; overflow-y:auto'>";
foreach ($suiteList as $suiteID => $suite)
if($suiteList)
{
$suiteName = $suite->name;
if($suite->type == 'public') $suiteName .= " <span class='label label-info'>{$this->lang->testsuite->authorList[$suite->type]}</span>";
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&param=$suiteID"), $suiteName);
$replace .= "</li>";
$replace .= '<li' . ($suiteID == (int)$currentSuiteID ? " class='active'" : '') . '>';
$replace .= html::a(helper::createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySuite&param=$suiteID"), $suiteName);
$replace .= "</li>";
}
}
else
{
if(common::hasPriv('testsuite', 'create'))
{
$replace .= '<li>' . html::a(helper::createLink('testsuite', 'create', "productID=$productID"), $this->lang->testsuite->create) . '</li>';
}
}
$replace .= '</ul></li>';
@@ -71,6 +151,7 @@ class testcaseModel extends model
}
common::setMenuVars($this->lang->testcase->menu, $key, $replace);
}
if($this->config->global->flow != 'full' && $this->app->getMethodName() != 'view') $this->lang->testcase->menu->bysearch = "<a class='querybox-toggle' id='bysearchTab'><i class='icon icon-search muted'> </i>{$this->lang->testcase->bySearch}</a>";
}
/**
+1 -61
View File
@@ -1,66 +1,6 @@
<?php js::set('flow', $this->config->global->flow);?>
<?php if(!isset($branch)) $branch = 0;?>
<?php if($this->config->global->flow == 'onlyTest'):?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left hidden'>
<?php
$hasBrowsePriv = common::hasPriv('testcase', 'browse');
$hasGroupPriv = common::hasPriv('testcase', 'groupcase');
$hasZeroPriv = common::hasPriv('story', 'zerocase');
?>
<?php if($this->methodName == 'browse') echo "<a id='bysearchTab' class='btn btn-link querybox-toggle'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a>";?>
</div>
<div class='btn-toolbar pull-right'>
<div class='btn-group'>
<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown'>
<i class='icon icon-export muted'></i> <?php echo $lang->export ?>
<span class='caret'></span>
</button>
<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>
</div>
<div class='btn-group'>
<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown' id='importAction'><i class='icon icon-import muted'></i> <?php echo $lang->import ?><span class='caret'></span></button>
<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>
</div>
<?php
$initModule = isset($moduleID) ? (int)$moduleID : 0;
if(common::hasPriv('testcase', 'batchCreate'))
{
$link = $this->createLink('testcase', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$initModule");
echo html::a($link, "<i class='icon-plus'></i> " . $lang->testcase->batchCreate, '', "class='btn btn-secondary'");
}
if(common::hasPriv('testcase', 'create'))
{
$link = $this->createLink('testcase', 'create', "productID=$productID&branch=$branch&moduleID=$initModule");
echo html::a($link, "<i class='icon-plus'></i> " . $lang->testcase->create, '', "class='btn btn-primary'");
}
?>
</div>
</div>
<div id='queryBox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
<?php else:?>
<?php if($this->config->global->flow == 'full'):?>
<div id='mainMenu' class='clearfix'>
<div id="sidebarHeader">
<div class="title">
@@ -11,6 +11,7 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('flow', $this->config->global->flow);?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<div class='input-group w-150px'>
+18 -4
View File
@@ -28,11 +28,25 @@ class testreportModel extends model
/* Remove branch. */
if(strpos($selectHtml, 'currentBranch') !== false) $selectHtml = substr($selectHtml, 0, strrpos($selectHtml, "<div class='btn-group'>")) . '</div>';
$this->app->loadLang('qa');
$productIndex = '<div class="btn-group angle-btn"><div class="btn-group">' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '</div></div>';
$productIndex .= $selectHtml;
$pageNav = '';
$pageActions = '';
if($this->config->global->flow == 'full')
{
$this->app->loadLang('qa');
$pageNav = '<div class="btn-group angle-btn"><div class="btn-group">' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '</div></div>';
}
else
{
if(common::hasPriv('testtask', 'create'))
{
$link = helper::createLink('testtask', 'create', "productID=$productID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i> {$this->lang->testtask->create}", '', "class='btn btn-primary'");
}
}
$pageNav .= $selectHtml;
$this->lang->modulePageNav = $productIndex;
$this->lang->modulePageNav = $pageNav;
$this->lang->modulePageActions = $pageActions;
foreach($this->lang->testtask->menu as $key => $value)
{
if($this->config->global->flow != 'onlyTest')
+2
View File
@@ -11,6 +11,7 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php if($config->global->flow == 'full'):?>
<div id='mainMenu' class='clearfix'>
<div class='pull-left btn-toolbar'>
<span class='btn btn-link btn-active-text'>
@@ -19,6 +20,7 @@
</span>
</div>
</div>
<?php endif;?>
<div id='mainContent' class='main-table'>
<table class='table has-sort-head table-fixed' id='reportList'>
<?php $vars = "objectID=$objectID&objectType=$objectType&extra=$extra&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
-2
View File
@@ -14,5 +14,3 @@
.datatable-menu {display:none;}
.pl-5px{padding-left:5px;}
#pageActions {top: -60px;}
+8 -2
View File
@@ -1,4 +1,10 @@
$(document).ready(function()
$(function()
{
if(typeof(flow) != 'undefined' && flow == 'onlyTest') toggleSearch();
if(flow != 'full')
{
$('.querybox-toggle').click(function()
{
$(this).parent().toggleClass('active');
});
}
})
+1
View File
@@ -44,6 +44,7 @@ $lang->testsuite->libraryDelete = 'Do you want to delete this library?';
$lang->testsuite->confirmUnlinkCase = 'Do you want to unlink this Case?';
$lang->testsuite->noticeNone = 'You have not created a suite yet.';
$lang->testsuite->noModule = '<div>You have no modules</div><div>Manage now</div>';
$lang->testsuite->noTestsuite = 'No testsuite. You could ';
$lang->testsuite->lblCases = 'Cases';
$lang->testsuite->lblUnlinkCase = 'Unlink Case';
+1
View File
@@ -44,6 +44,7 @@ $lang->testsuite->libraryDelete = '您确认要删除该用例库吗?';
$lang->testsuite->confirmUnlinkCase = '您确认要移除该用例吗?';
$lang->testsuite->noticeNone = '您还没有创建套件';
$lang->testsuite->noModule = '<div>您现在还没有模块信息</div><div>请维护用例库模块</div>';
$lang->testsuite->noTestsuite = '暂时没有套件,您现在可以';
$lang->testsuite->lblCases = '用例列表';
$lang->testsuite->lblUnlinkCase = '移除用例';
+1
View File
@@ -44,6 +44,7 @@ $lang->testsuite->libraryDelete = '您確認要刪除該用例庫嗎?';
$lang->testsuite->confirmUnlinkCase = '您確認要移除該用例嗎?';
$lang->testsuite->noticeNone = '您還沒有創建套件';
$lang->testsuite->noModule = '<div>您現在還沒有模組信息</div><div>請維護用例庫模組</div>';
$lang->testsuite->noTestsuite = '暫時沒有套件,您現在可以';
$lang->testsuite->lblCases = '用例列表';
$lang->testsuite->lblUnlinkCase = '移除用例';
+72 -11
View File
@@ -27,11 +27,30 @@ class testsuiteModel extends model
$selectHtml = $this->select($products, $productID, 'testsuite', 'browse');
if(strpos($selectHtml, 'currentBranch') !== false) $selectHtml = substr($selectHtml, 0, strrpos($selectHtml, "<div class='btn-group'>")) . '</div>';
$this->app->loadLang('qa');
$productIndex = '<div class="btn-group angle-btn"><div class="btn-group">' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '</div></div>';
$productIndex .= $selectHtml;
$pageNav = '';
$pageActions = '';
if($this->config->global->flow == 'full')
{
$this->app->loadLang('qa');
$pageNav = '<div class="btn-group angle-btn"><div class="btn-group">' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '</div></div>';
if(common::hasPriv('testsuite', 'libView'))
{
$link = helper::createLink('testsuite', 'libView', "libID=$libID");
$pageActions .= html::a($link, "<i class='icon icon-list-alt muted'> </i>" . $this->lang->testsuite->view, '', "class='btn'");
}
}
else
{
if(common::hasPriv('testsuite', 'create'))
{
$link = helper::createLink('testsuite', 'create', "productID=$productID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i> {$this->lang->testsuite->create}", '', "class='btn btn-primary'");
}
}
$pageNav .= $selectHtml;
$this->lang->modulePageNav = $productIndex;
$this->lang->modulePageNav = $pageNav;
$this->lang->modulePageActions = $pageActions;
foreach($this->lang->testsuite->menu as $key => $value)
{
$replace = $productID;
@@ -118,14 +137,47 @@ class testsuiteModel extends model
setCookie("lastCaseLib", $libID, $this->config->cookieLife, $this->config->webRoot);
$this->app->loadLang('qa');
$productIndex = '<div class="btn-group angle-btn"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $this->lang->qa->index . ' <span class="caret"></span></button>';
$productIndex .= '<ul class="dropdown-menu">';
if(common::hasPriv('testsuite', 'createLib')) $productIndex .= '<li>' . html::a(helper::createLink('testsuite', 'createLib'), '<i class="icon icon-plus"></i> ' . $this->lang->testsuite->createLib) . '</li>';
$productIndex .= '</ul></div></div>';
$productIndex .= $selectHtml;
$pageNav = '';
$pageActions = '';
if($this->config->global->flow == 'full')
{
$this->app->loadLang('qa');
$pageNav .= '<div class="btn-group angle-btn"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $this->lang->qa->index . ' <span class="caret"></span></button>';
$pageNav .= '<ul class="dropdown-menu">';
if(common::hasPriv('testsuite', 'createLib')) $pageNav .= '<li>' . html::a(helper::createLink('testsuite', 'createLib'), '<i class="icon icon-plus"></i> ' . $this->lang->testsuite->createLib) . '</li>';
$pageNav .= '</ul></div></div>';
}
else
{
$this->app->loadLang('testcase');
$pageActions .= "<div class='btn-group'>";
if(common::hasPriv('testsuite', 'exportTemplet'))
{
$link = helper::createLink('testsuite', 'exportTemplet', "libID=$libID");
$pageActions .= html::a($link, "<i class='icon icon-export muted'> </i>" . $this->lang->testsuite->exportTemplet, '', "class='btn btn-link export'");
}
if(common::hasPriv('testsuite', 'import'))
{
$link = helper::createLink('testsuite', 'import', "libID=$libID");
$pageActions .= html::a($link, "<i class='icon muted icon-import'> </i>" . $this->lang->testcase->importFile, '', "class='btn btn-link export'");
}
$pageActions .= '</div>';
$params = "libID=$libID&moduleID=" . (isset($moduleID) ? $moduleID : 0);
if(common::hasPriv('testsuite', 'batchCreateCase'))
{
$link = helper::createLink('testsuite', 'batchCreateCase', $params);
$pageActions .= html::a($link, "<i class='icon-plus'></i>" . $this->lang->testcase->batchCreate, '', "class='btn btn-secondary'");
}
if(common::hasPriv('testsuite', 'createCase'))
{
$link = helper::createLink('testsuite', 'createCase', $params);
$pageActions .= html::a($link, "<i class='icon-plus'></i>" . $this->lang->testcase->create, '', "class='btn btn-primary'");
}
}
$pageNav .= $selectHtml;
$this->lang->modulePageNav = $productIndex;
$this->lang->modulePageNav = $pageNav;
$this->lang->modulePageActions = $pageActions;
foreach($this->lang->caselib->menu as $key => $value)
{
$replace = '';
@@ -133,8 +185,17 @@ class testsuiteModel extends model
common::setMenuVars($this->lang->caselib->menu, $key, $replace);
}
$this->lang->testsuite->menu = $this->lang->caselib->menu;
if($this->config->global->flow != 'full' && $this->app->getMethodName() != 'libview') $this->lang->testsuite->menu->bysearch = "<a class='querybox-toggle' id='bysearchTab'><i class='icon icon-search muted'> </i>{$this->lang->testcase->bySearch}</a>";
}
/**
* Save lib state.
*
* @param int $libID
* @param array $libraries
* @access public
* @return int
*/
public function saveLibState($libID = 0, $libraries = array())
{
if($libID > 0) $this->session->set('caseLib', (int)$libID);
+6
View File
@@ -26,6 +26,11 @@
</div>
</div>
<?php endif;?>
<?php if(empty($suites)):?>
<div class="table-empty-tip">
<p><span class="text-muted"><?php echo $lang->testsuite->noTestsuite;?></span> <?php common::printLink('testsuite', 'create', "productID={$productID}", "<i class='icon icon-plus'></i> " . $lang->testsuite->create, '', "class='btn btn-info'");?></p>
</div>
<?php else:?>
<div id='mainContent' class='main-table'>
<table class='table has-sort-head' id='suiteList'>
<thead>
@@ -71,4 +76,5 @@
<div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
<?php endif;?>
</div>
<?php endif;?>
<?php include '../../common/view/footer.html.php';?>
+5 -54
View File
@@ -17,58 +17,9 @@ 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);
js::set('flow', $config->global->flow);
?>
<?php if($this->config->global->flow == 'onlyTest'):?>
<style>
.nav > li > .btn-group > a, .nav > li > .btn-group > a:hover, .nav > li > .btn-group > a:focus{background: #1a4f85; border-color: #164270;}
#querybox #searchform{border-bottom: 1px solid #ddd; margin-bottom: 20px;}
</style>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
</div>
<ul class='submenu hidden'>
<?php echo "<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i>&nbsp;{$lang->testcase->bySearch}</a></li> ";?>
<li class='right'>
<div class='btn-group' id='createActionMenu'>
<?php
$misc = common::hasPriv('testsuite', 'createCase') ? "class='btn btn-primary'" : "class='btn btn-primary disabled'";
$link = common::hasPriv('testsuite', 'createCase') ? $this->createLink('testsuite', 'createCase', "libID=$libID&moduleID=" . (isset($moduleID) ? $moduleID : 0)) : '#';
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('testsuite', 'batchCreateCase') ? '' : "class=disabled";
$link = common::hasPriv('testsuite', 'batchCreateCase') ? $this->createLink('testsuite', 'batchCreateCase', "libID=$libID&moduleID=" . (isset($moduleID) ? $moduleID : 0)) : '#';
echo "<li>" . html::a($link, $lang->testcase->batchCreate, '', $misc) . "</li>";
?>
</ul>
</div>
</li>
<li class='right'>
<?php
$link = common::hasPriv('testsuite', 'import') ? $this->createLink('testsuite', 'import', "libID=$libID") : '#';
if(common::hasPriv('testsuite', 'import')) echo html::a($link, "<i class='icon-upload-alt'></i> " . $lang->testcase->importFile, '', "class='export'");
?>
</li>
<li class='right'>
<?php
$link = common::hasPriv('testsuite', 'exportTemplet') ? $this->createLink('testsuite', 'exportTemplet', "libID=$libID") : '#';
if(common::hasPriv('testsuite', 'exportTemplet')) echo html::a($link, "<i class='icon-download-alt'></i> " . $lang->testsuite->exportTemplet, '', "class='export'");
?>
</li>
</ul>
</div>
<?php else:?>
<div id='pageActions'>
<?php common::printLink('testsuite', 'libView', "libID=$libID", "<i class='icon icon-list-alt muted'> </i>" . $lang->testsuite->view, '', "class='btn'");?>
</div>
<?php if($config->global->flow == 'full'):?>
<div id='mainMenu' class='clearfix'>
<div id="sidebarHeader">
<div class="title">
@@ -83,7 +34,6 @@ js::set('flow', $this->config->global->flow);
?>
</div>
</div>
<?php endif;?>
<div class='btn-toolbar pull-left'>
<?php
if(common::hasPriv('testsuite', 'library'))
@@ -104,6 +54,7 @@ js::set('flow', $this->config->global->flow);
<?php common::printLink('testsuite', 'createCase', $params, "<i class='icon-plus'></i>" . $lang->testcase->create, '', "class='btn btn-primary'");?>
</div>
</div>
<?php endif;?>
<div id="mainContent" class="main-row fade">
<div class="side-col" id="sidebar">
<div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
@@ -250,11 +201,11 @@ js::set('flow', $this->config->global->flow);
</div>
<script>
$('#module' + moduleID).addClass('active');
<?php if($config->global->flow == 'full'):?>
$('#<?php echo $this->session->libBrowseType?>Tab').addClass('btn-active-text').append("<span class='label label-light label-badge'><?php echo $pager->recTotal;?></span>");
<?php endif;?>
if(flow == 'onlyTest')
{
toggleSearch();
$('#subNavbar > .nav > li').removeClass('active');
$('#subNavbar > .nav > li[data-id=' + browseType + ']').addClass('active');
}
+2 -2
View File
@@ -2,8 +2,8 @@ $(document).ready(function()
{
if(flow == 'onlyTest')
{
$('#modulemenu > .nav > li').removeClass('active');
$('#modulemenu > .nav > li[data-id=' + status + ']').addClass('active');
$('#subNavbar > .nav > li').removeClass('active');
$('#subNavbar > .nav > li[data-id=' + status + ']').addClass('active');
}
});
+18 -4
View File
@@ -44,11 +44,25 @@ class testtaskModel extends model
if(common::hasPriv('testreport', 'browse')) $this->lang->modulePageActions .= html::a(helper::createLink('testreport', 'browse', "objectID=$productID&objectType=product&extra={$testtask->id}"), "<i class='icon icon-flag'> </i>" . $this->lang->testtask->reportField, '', "class='btn'");
}
$this->app->loadLang('qa');
$productIndex = '<div class="btn-group angle-btn"><div class="btn-group">' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '</div></div>';
$productIndex .= $selectHtml;
$pageNav = '';
$pageActions = '';
if($this->config->global->flow == 'full')
{
$this->app->loadLang('qa');
$pageNav = '<div class="btn-group angle-btn"><div class="btn-group">' . html::a(helper::createLink('qa', 'index', 'locate=no'), $this->lang->qa->index, '', "class='btn'") . '</div></div>';
}
else
{
if(common::hasPriv('testtask', 'create'))
{
$link = helper::createLink('testtask', 'create', "productID=$productID");
$pageActions .= html::a($link, "<i class='icon icon-plus'></i> {$this->lang->testtask->create}", '', "class='btn btn-primary'");
}
}
$pageNav .= $selectHtml;
$this->lang->modulePageNav = $productIndex;
$this->lang->modulePageNav = $pageNav;
$this->lang->modulePageActions = $pageActions;
foreach($this->lang->testtask->menu as $key => $value)
{
if($this->config->global->flow != 'onlyTest')