Merge branch '15.0.beta3' of https://gitlab.zcorp.cc/easycorp/zentaopms into 15.0.beta3
This commit is contained in:
@@ -263,7 +263,7 @@ class baseHelper
|
||||
*/
|
||||
static public function jsonEncode($data)
|
||||
{
|
||||
return (function_exists('get_magic_quotes_gpc') and get_magic_quotes_gpc()) ? addslashes(json_encode($data)) : json_encode($data);
|
||||
return json_encode($data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1029,8 +1029,6 @@ class baseFixer
|
||||
$fields = $this->processFields($fieldName);
|
||||
foreach($fields as $fieldName)
|
||||
{
|
||||
if(function_exists('get_magic_quotes_gpc') and get_magic_quotes_gpc()) $this->data->$fieldName = stripslashes($this->data->$fieldName);
|
||||
|
||||
if(!isset($this->stripedFields[$fieldName]) and (!defined('RUN_MODE') or RUN_MODE != 'admin'))
|
||||
{
|
||||
$this->data->$fieldName = self::stripDataTags($this->data->$fieldName, $allowedTags, $attributes);
|
||||
|
||||
@@ -124,8 +124,8 @@ class bug extends control
|
||||
$moduleID = ($browseType == 'bymodule') ? (int)$param : (($browseType == 'bysearch' or $browseType == 'bybranch') ? 0 : ($this->cookie->bugModule ? $this->cookie->bugModule : 0));
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
|
||||
/* Set menu and save session. */
|
||||
$this->session->set('bugList', $this->app->getURI(true));
|
||||
/* Set session. */
|
||||
$this->session->set('bugList', $this->app->getURI(true), 'qa');
|
||||
|
||||
/* Set moduleTree. */
|
||||
if($browseType == '')
|
||||
|
||||
@@ -49,6 +49,7 @@ class build extends control
|
||||
}
|
||||
elseif($this->app->openApp == 'execution')
|
||||
{
|
||||
$execution = $this->execution->getByID($executionID);
|
||||
$executions = $this->execution->getPairs($execution->project);
|
||||
$this->execution->setMenu($executionID);
|
||||
$this->session->set('project', $execution->project);
|
||||
|
||||
@@ -195,7 +195,8 @@ class caselib extends control
|
||||
if(empty($libraries)) $this->locate(inlink('create'));
|
||||
|
||||
/* Save session. */
|
||||
$this->session->set('caseList', $this->app->getURI(true));
|
||||
$this->session->set('caseList', $this->app->getURI(true), 'qa');
|
||||
$this->session->set('caselibList', $this->app->getURI(true), 'qa');
|
||||
|
||||
/* Set menu. */
|
||||
$libID = $this->caselib->saveLibState($libID, $libraries);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php $browseLink = $this->session->caseList ? $this->session->caseList : $this->createLink('caselib', 'browse', "libID=$lib->id");?>
|
||||
<?php $browseLink = $this->session->caselibList ? $this->session->caselibList : $this->createLink('caselib', 'browse', "libID=$lib->id");?>
|
||||
<?php common::printBack($browseLink, 'btn btn-secondary');?>
|
||||
<div class='divider'></div>
|
||||
<div class='page-title'>
|
||||
|
||||
@@ -204,6 +204,14 @@ $lang->calendar = 'Calendar';
|
||||
|
||||
$lang->my->work = 'Work';
|
||||
|
||||
$lang->doc->recent = 'Recent';
|
||||
$lang->doc->my = 'My';
|
||||
$lang->doc->favorite = 'Favorite';
|
||||
$lang->doc->product = 'Product';
|
||||
$lang->doc->project = 'Project';
|
||||
$lang->doc->custom = 'Custom';
|
||||
$lang->doc->wiki = 'WIKI';
|
||||
|
||||
$lang->project->report = 'Report';
|
||||
|
||||
$lang->report->weekly = 'Weekly';
|
||||
@@ -251,6 +259,11 @@ $lang->searchObjects['execution'] = $lang->executionCommon;
|
||||
$lang->searchObjects['user'] = 'User';
|
||||
$lang->searchTips = 'ID (ctrl+g)';
|
||||
|
||||
/* Code formats for import. */
|
||||
$lang->importEncodeList['gbk'] = 'GBK';
|
||||
$lang->importEncodeList['big5'] = 'BIG5';
|
||||
$lang->importEncodeList['utf-8'] = 'UTF-8';
|
||||
|
||||
/* File type list for export. */
|
||||
$lang->exportFileTypeList['csv'] = 'csv';
|
||||
$lang->exportFileTypeList['xml'] = 'xml';
|
||||
|
||||
+31
-23
@@ -301,29 +301,28 @@ $lang->execution->dividerMenu = ',story,build,settings,';
|
||||
$lang->qa->menu = new stdclass();
|
||||
$lang->qa->menu->index = array('link' => "$lang->dashboard|qa|index");
|
||||
$lang->qa->menu->bug = array('link' => "{$lang->bug->common}|bug|browse|productID=%s", 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,batchactivate,confirmbug,assignto');
|
||||
$lang->qa->menu->testcase = array('link' => "{$lang->testcase->shortCommon}|testcase|browse|productID=%s", 'subModule' => 'testsuite,caselib', 'class' => 'dropdown dropdown-hover');
|
||||
$lang->qa->menu->testtask = array('link' => "{$lang->testtask->common}|testtask|browse|productID=%s", 'subModule' => 'testreport', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase,report,importunitresult', 'class' => 'dropdown dropdown-hover');
|
||||
$lang->qa->menu->automation = array('link' => "{$lang->automation->common}|automation|browse|productID=%s", 'alias' => '', 'class' => 'dropdown dropdown-hover');
|
||||
$lang->qa->menu->testcase = array('link' => "{$lang->testcase->shortCommon}|testcase|browse|productID=%s", 'subModule' => 'testsuite,caselib');
|
||||
$lang->qa->menu->testtask = array('link' => "{$lang->testtask->common}|testtask|browse|productID=%s", 'subModule' => 'testreport', 'alias' => 'view,edit,linkcase,cases,start,close,batchrun,groupcase,report,importunitresult');
|
||||
$lang->qa->menu->automation = array('link' => "{$lang->automation->common}|automation|browse|productID=%s", 'alias' => '');
|
||||
|
||||
/* QA menu order. */
|
||||
$lang->qa->menuOrder[5] = 'product';
|
||||
$lang->qa->menuOrder[10] = 'index';
|
||||
$lang->qa->menuOrder[15] = 'bug';
|
||||
$lang->qa->menuOrder[20] = 'testcase';
|
||||
$lang->qa->menuOrder[25] = 'testtask';
|
||||
$lang->qa->menuOrder[30] = 'report';
|
||||
$lang->qa->menuOrder[35] = 'testsuite';
|
||||
$lang->qa->menuOrder[40] = 'caselib';
|
||||
$lang->qa->menuOrder[5] = 'product';
|
||||
$lang->qa->menuOrder[10] = 'index';
|
||||
$lang->qa->menuOrder[15] = 'bug';
|
||||
$lang->qa->menuOrder[20] = 'testcase';
|
||||
$lang->qa->menuOrder[25] = 'testtask';
|
||||
$lang->qa->menuOrder[30] = 'report';
|
||||
$lang->qa->menuOrder[35] = 'testsuite';
|
||||
$lang->qa->menuOrder[40] = 'caselib';
|
||||
|
||||
$lang->qa->menu->testcase['subMenu'] = new stdclass();
|
||||
$lang->qa->menu->testcase['subMenu']->feature = array('link' => "{$lang->testcase->feature}|testcase|browse|productID=%s", 'subModule' => 'testcase,tree,story');
|
||||
$lang->qa->menu->testcase['subMenu']->unit = array('link' => "{$lang->testcase->unit}|testtask|browseUnits|productID=%s", 'alias' => 'browseunits');
|
||||
$lang->qa->menu->testcase['subMenu']->case = array('link' => "{$lang->testcase->case}|testcase|browse|productID=%s", 'subModule' => 'testcase,story');
|
||||
$lang->qa->menu->testcase['subMenu']->caselib = array('link' => "{$lang->testcase->caselib}|caselib|browse|libID=0", 'subModule' => 'caselib');
|
||||
$lang->qa->menu->testcase['subMenu']->testsuite = array('link' => "{$lang->testcase->testsuite}|testsuite|browse|productID=%s", 'subModule' => 'testsuite');
|
||||
$lang->qa->menu->testcase['subMenu']->caselib = array('link' => "{$lang->testcase->caselib}|caselib|browse|libID=0");
|
||||
|
||||
$lang->qa->menu->testtask['subMenu'] = new stdclass();
|
||||
$lang->qa->menu->testtask['subMenu']->testtask = array('link' => "{$lang->testtask->common}|testtask|browse|productID=%s", 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase,report,importunitresult');
|
||||
$lang->qa->menu->testtask['subMenu']->report = array('link' => "{$lang->testreport->common}|testreport|browse|productID=%s", 'alias' => 'view,create,edit');
|
||||
$lang->qa->menu->testtask['subMenu']->testtask = array('link' => "{$lang->testtask->common}|testtask|browse|productID=%s", 'subModule' => 'testtask', 'alias' => 'linkcase,cases,start,close,batchrun,groupcase,report,importunitresult');
|
||||
$lang->qa->menu->testtask['subMenu']->report = array('link' => "{$lang->testreport->common}|testreport|browse|productID=%s", 'subModule' => 'testreport');
|
||||
|
||||
$lang->qa->menu->automation['subMenu'] = new stdclass();
|
||||
$lang->qa->menu->automation['subMenu']->browse = array('link' => "{$lang->intro}|automation|browse|productID=%s", 'alias' => '');
|
||||
@@ -347,16 +346,25 @@ $lang->devops->menuOrder[20] = 'maintain';
|
||||
$lang->devops->menuOrder[25] = 'rules';
|
||||
|
||||
/* Doc menu.*/
|
||||
$lang->doc = new stdclass();
|
||||
$lang->doc->menu = new stdclass();
|
||||
$lang->doc->menu->recent = array('link' => "{$lang->doc->recent}|doc|recent");
|
||||
$lang->doc->menu->my = array('link' => "{$lang->doc->my}|doc|my");
|
||||
$lang->doc->menu->favorite = array('link' => "{$lang->doc->favorite}|doc|favorite");
|
||||
$lang->doc->menu->product = array('link' => "{$lang->doc->product}|doc|product");
|
||||
$lang->doc->menu->project = array('link' => "{$lang->doc->project}|doc|project");
|
||||
$lang->doc->menu->custom = array('link' => "{$lang->doc->custom}|doc|project");
|
||||
$lang->doc->menu->wiki = array('link' => "{$lang->doc->wiki}|doc|project");
|
||||
|
||||
$lang->doc->dividerMenu = ',product,';
|
||||
|
||||
/* Doc menu order. */
|
||||
$lang->doc->menuOrder[5] = 'list';
|
||||
$lang->doc->menuOrder[10] = 'product';
|
||||
$lang->doc->menuOrder[15] = 'project';
|
||||
$lang->doc->menuOrder[20] = 'custom';
|
||||
$lang->doc->menuOrder[25] = 'index';
|
||||
$lang->doc->menuOrder[30] = 'create';
|
||||
$lang->doc->menuOrder[5] = 'recent';
|
||||
$lang->doc->menuOrder[10] = 'my';
|
||||
$lang->doc->menuOrder[15] = 'favorite';
|
||||
$lang->doc->menuOrder[20] = 'product';
|
||||
$lang->doc->menuOrder[25] = 'project';
|
||||
$lang->doc->menuOrder[30] = 'custom';
|
||||
$lang->doc->menuOrder[35] = 'wiki';
|
||||
|
||||
/* Report menu.*/
|
||||
$lang->report->menu = new stdclass();
|
||||
|
||||
@@ -204,6 +204,14 @@ $lang->calendar = '日程';
|
||||
|
||||
$lang->my->work = '待处理';
|
||||
|
||||
$lang->doc->recent = '最近文档';
|
||||
$lang->doc->my = '我的文档';
|
||||
$lang->doc->favorite = '我的收藏';
|
||||
$lang->doc->product = '产品库';
|
||||
$lang->doc->project = '项目库';
|
||||
$lang->doc->custom = '自定义库';
|
||||
$lang->doc->wiki = 'WIKI';
|
||||
|
||||
$lang->project->report = '报告';
|
||||
|
||||
$lang->report->weekly = '周报';
|
||||
@@ -211,8 +219,7 @@ $lang->report->annual = '年度总结';
|
||||
$lang->report->notice = new stdclass();
|
||||
$lang->report->notice->help = '注:统计报表的数据来源于列表页面的检索结果,生成统计报表前请先在列表页面进行检索。比如列表页面我们检索的是%tab%,那么报表就是基于之前检索的%tab%的结果集进行统计。';
|
||||
|
||||
$lang->testcase->feature = '功能测试';
|
||||
$lang->testcase->unit = '单元测试';
|
||||
$lang->testcase->case = '用例';
|
||||
$lang->testcase->testsuite = '套件';
|
||||
$lang->testcase->caselib = '用例库';
|
||||
|
||||
|
||||
@@ -831,7 +831,7 @@ class commonModel extends model
|
||||
$class = isset($menuItem->class) ? $menuItem->class : '';
|
||||
$active = '';
|
||||
if($subModule and in_array($currentModule, $subModule)) $active = 'active';
|
||||
if($alias and $moduleName == $currentModule and strpos(",$alias,", ",$currentMethod,") !== false) $active = 'active';
|
||||
// if($alias and $moduleName == $currentModule and strpos(",$alias,", ",$currentMethod,") !== false) $active = 'active';
|
||||
if($menuItem->link)
|
||||
{
|
||||
$target = '';
|
||||
|
||||
@@ -2666,7 +2666,12 @@ class execution extends control
|
||||
|
||||
$from = $this->app->openApp;
|
||||
if($from == 'execution') $this->session->set('executionList', $this->app->getURI(true), 'execution');
|
||||
if($from == 'project') $this->project->setMenu($projectID);
|
||||
if($from == 'project')
|
||||
{
|
||||
$projects = $this->project->getPairsByProgram();
|
||||
$projectID = $this->project->saveState($projectID, $projects);
|
||||
$this->project->setMenu($projectID);
|
||||
}
|
||||
|
||||
/* Load pager and get tasks. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
|
||||
@@ -158,8 +158,8 @@ class product extends control
|
||||
if($this->app->rawModule == 'product')
|
||||
{
|
||||
/* Save session. */
|
||||
$this->session->set('storyList', $this->app->getURI(true));
|
||||
$this->session->set('productList', $this->app->getURI(true));
|
||||
$this->session->set('storyList', $this->app->getURI(true), 'product');
|
||||
$this->session->set('productList', $this->app->getURI(true), 'product');
|
||||
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID, "storyType=$storyType", $branch);
|
||||
}
|
||||
@@ -322,6 +322,8 @@ class product extends control
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
|
||||
}
|
||||
|
||||
if($this->app->openApp == 'program') $this->loadModel('program')->setMenu($programID);
|
||||
|
||||
$this->loadModel('user');
|
||||
$poUsers = $this->user->getPairs('nodeleted|pofirst|noclosed', '', $this->config->maxCount);
|
||||
if(!empty($this->config->user->moreLink)) $this->config->moreLinks["PO"] = $this->config->user->moreLink;
|
||||
@@ -654,7 +656,7 @@ class product extends control
|
||||
{
|
||||
$this->product->delete(TABLE_PRODUCT, $productID);
|
||||
$this->dao->update(TABLE_DOCLIB)->set('deleted')->eq(1)->where('product')->eq($productID)->exec();
|
||||
$this->session->set('product', ''); // 清除session。
|
||||
$this->session->set('product', '');
|
||||
$this->executeHooks($productID);
|
||||
die(js::locate($this->createLink('product', 'browse'), 'parent'));
|
||||
}
|
||||
@@ -987,10 +989,6 @@ class product extends control
|
||||
{
|
||||
$this->app->loadLang($fromModule);
|
||||
|
||||
$projectModel = $this->loadModel('project')->getByID($this->session->project);
|
||||
$this->lang->product->menu = $this->lang->menu->{$projectModel->model};
|
||||
$this->lang->product->menuOrder = $this->lang->{$projectModel->model}->menuOrder;
|
||||
|
||||
/* The secondary test menu processing in the project. */
|
||||
if(in_array($fromModule, array('qa', 'bug', 'testtask', 'testreport')))
|
||||
{
|
||||
|
||||
@@ -279,7 +279,7 @@ class productModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProductPairsByProject($projectID, $status = 'all')
|
||||
public function getProductPairsByProject($projectID = 0, $status = 'all')
|
||||
{
|
||||
$products = empty($projectID) ? $this->getList() : $this->getProducts($projectID, $status);
|
||||
$pairs = array();
|
||||
|
||||
@@ -519,7 +519,7 @@ class story extends control
|
||||
|
||||
/* Set menu. */
|
||||
$this->lang->product->switcherMenu = $this->product->getSwitcher($product->id);
|
||||
$this->product->setMenu($products, $product->id, $story->branch);
|
||||
$this->product->setMenu($product->id, $story->branch);
|
||||
|
||||
$this->story->replaceURLang($story->type);
|
||||
|
||||
@@ -628,7 +628,7 @@ class story extends control
|
||||
/* The stories of a product. */
|
||||
if($productID)
|
||||
{
|
||||
$this->product->setMenu($this->product->getPairs('nodeleted'), $productID, $branch);
|
||||
$this->product->setMenu($productID, $branch);
|
||||
$product = $this->product->getByID($productID);
|
||||
$branchProduct = $product->type == 'normal' ? false : true;
|
||||
|
||||
@@ -960,7 +960,7 @@ class story extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->product->setMenu($this->product->getPairs(), $product->id, $story->branch);
|
||||
$this->product->setMenu($product->id, $story->branch);
|
||||
}
|
||||
|
||||
/* Set the review result options. */
|
||||
@@ -1046,7 +1046,7 @@ class story extends control
|
||||
$this->story->replaceURLang($story->type);
|
||||
|
||||
/* Set menu. */
|
||||
$this->product->setMenu($this->product->getPairs(), $product->id, $story->branch);
|
||||
$this->product->setMenu($product->id, $story->branch);
|
||||
|
||||
/* Set the closed reason options and remove subdivided options. */
|
||||
if($story->status == 'draft') unset($this->lang->story->reasonList['cancel']);
|
||||
@@ -1454,18 +1454,13 @@ class story extends control
|
||||
*/
|
||||
public function zeroCase($productID, $orderBy = 'id_desc', $from = 'project')
|
||||
{
|
||||
$this->session->set('productList', $this->app->getURI(true));
|
||||
$this->session->set('storyList', $this->app->getURI(true), 'product');
|
||||
$products = $this->product->getPairs();
|
||||
|
||||
if($from == 'qa')
|
||||
{
|
||||
$this->loadModel('qa');
|
||||
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
|
||||
}
|
||||
|
||||
$this->lang->story->menu = $this->lang->qa->subMenu->testcase;
|
||||
$this->lang->story->menuOrder = $this->lang->testcase->menuOrder;
|
||||
$this->loadModel('testcase')->setMenu($products, $productID);
|
||||
$this->loadModel('testcase');
|
||||
$this->app->rawModule = 'testcase';
|
||||
$this->loadModel('qa')->setMenu($products, $productID);
|
||||
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
|
||||
|
||||
/* Append id for secend sort. */
|
||||
$sort = $this->loadModel('common')->appendOrder($orderBy);
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<?php
|
||||
echo html::hidden('lastEditedDate', $story->lastEditedDate);
|
||||
echo html::submitButton();
|
||||
echo html::linkButton($lang->goback, $app->session->storyList ? $app->session->storyList : inlink('view', "storyID=$story->id"), 'self', '', 'btn btn-wide');
|
||||
echo html::a($app->session->storyList ? $app->session->storyList : inlink('view', "storyID=$story->id"), $lang->goback, '', 'class="btn btn-wide"');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
<?php echo html::linkButton($lang->goback, $app->session->storyList ? $app->session->storyList : inlink('view', "storyID=$story->id"), 'self', '', 'btn btn-wide');?>
|
||||
<?php echo html::a($app->session->storyList ? $app->session->storyList : inlink('view', "storyID=$story->id"), $lang->goback, '', 'class="btn btn-wide"');?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<?php
|
||||
echo html::hidden('lastEditedDate', $story->lastEditedDate);
|
||||
echo html::submitButton($lang->save);
|
||||
echo html::backButton();
|
||||
echo html::a($app->session->storyList ? $app->session->storyList : inlink('view', "storyID=$story->id"), $lang->goback, '', 'class="btn btn-wide"');
|
||||
?>
|
||||
</div>
|
||||
<hr class='small' />
|
||||
|
||||
@@ -68,10 +68,12 @@
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
$vars = "storyID={$story->id}";
|
||||
common::printIcon('story', 'change', $vars, $story, 'list', 'fork');
|
||||
common::printIcon('story', 'review', $vars, $story, 'list', 'glasses');
|
||||
common::printIcon('story', 'close', $vars, $story, 'list', 'off');
|
||||
common::printIcon('story', 'edit', $vars, $story, 'list', 'pencil');
|
||||
$this->app->openApp = 'product';
|
||||
common::printIcon('story', 'change', $vars, $story, 'list', 'fork');
|
||||
common::printIcon('story', 'review', $vars, $story, 'list', 'glasses');
|
||||
common::printIcon('story', 'close', $vars, $story, 'list', 'off');
|
||||
common::printIcon('story', 'edit', $vars, $story, 'list', 'pencil');
|
||||
$this->app->openApp = 'qa';
|
||||
common::printIcon('story', 'createCase', "productID=$story->product&branch=0&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap');
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -569,7 +569,6 @@ class testcase extends control
|
||||
{
|
||||
$libraries = $this->loadModel('caselib')->getLibraries();
|
||||
$this->caselib->setLibMenu($libraries, $case->lib);
|
||||
$this->lang->testcase->menu = $this->lang->caselib->menu;
|
||||
|
||||
$this->view->title = "CASE #$case->id $case->title - " . $libraries[$case->lib];
|
||||
$this->view->position[] = html::a($this->createLink('caselib', 'browse', "libID=$case->lib"), $libraries[$case->lib]);
|
||||
@@ -676,7 +675,6 @@ class testcase extends control
|
||||
{
|
||||
$libraries = $this->loadModel('caselib')->getLibraries();
|
||||
$this->caselib->setLibMenu($libraries, $case->lib);
|
||||
$this->lang->testcase->menu = $this->lang->caselib->menu;
|
||||
|
||||
$title = "CASE #$case->id $case->title - " . $libraries[$case->lib];
|
||||
$position[] = html::a($this->createLink('caselib', 'browse', "libID=$case->lib"), $libraries[$case->lib]);
|
||||
|
||||
@@ -66,7 +66,7 @@ class testreport extends control
|
||||
public function browse($objectID = 0, $objectType = 'product', $extra = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
if($objectType != 'product' and $objectType != 'execution') die('Type Error!');
|
||||
$this->session->set('reportList', $this->app->getURI(true));
|
||||
$this->session->set('reportList', $this->app->getURI(true), 'qa');
|
||||
|
||||
$objectID = $this->commonAction($objectID, $objectType);
|
||||
$object = $this->$objectType->getById($objectID);
|
||||
|
||||
@@ -31,13 +31,8 @@ class testsuite extends control
|
||||
{
|
||||
parent::__construct($moduleName, $methodName);
|
||||
|
||||
/* Set testtask menu group. */
|
||||
$this->projectID = isset($_GET['PRJ']) ? $_GET['PRJ'] : 0;
|
||||
if(!$this->projectID)
|
||||
{
|
||||
$this->app->loadConfig('qa');
|
||||
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
|
||||
}
|
||||
$this->app->loadConfig('qa');
|
||||
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,9 +63,9 @@ class testsuite extends control
|
||||
$this->session->set('testsuiteList', $this->app->getURI(true));
|
||||
|
||||
/* Set menu. */
|
||||
$projectID = $this->lang->navGroup->testreport == 'qa' ? 0 : $this->session->project;
|
||||
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($projectID);
|
||||
$this->view->products = $this->products = $this->loadModel('product')->getPairs();
|
||||
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', 'fromModule=testsuite&moduleGroup=' . $this->lang->navGroup->bug . '&activeMenu=testsuite')));
|
||||
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
$this->loadModel('qa')->setMenu($this->products, $productID);
|
||||
|
||||
@@ -135,7 +130,7 @@ class testsuite extends control
|
||||
}
|
||||
|
||||
/* Set menu. */
|
||||
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->project);
|
||||
$this->view->products = $this->products = $this->loadModel('product')->getPairs();
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
$this->loadModel('qa')->setMenu($this->products, $productID);
|
||||
|
||||
@@ -162,14 +157,16 @@ class testsuite extends control
|
||||
public function view($suiteID, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->app->loadLang('testtask');
|
||||
|
||||
/* Get test suite, and set menu. */
|
||||
$suite = $this->testsuite->getById($suiteID, true);
|
||||
if(!$suite) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back'));
|
||||
$productID = $suite->product;
|
||||
|
||||
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->project);
|
||||
$this->testsuite->setMenu($this->products, $productID);
|
||||
/* Set product session. */
|
||||
$this->view->products = $this->products = $this->loadModel('product')->getPairs();
|
||||
$productID = $this->product->saveState($suite->product, $this->products);
|
||||
$this->loadModel('qa')->setMenu($this->products, $productID);
|
||||
|
||||
/* Save session. */
|
||||
$this->session->set('caseList', $this->app->getURI(true));
|
||||
@@ -183,8 +180,8 @@ class testsuite extends control
|
||||
|
||||
$this->executeHooks($suiteID);
|
||||
|
||||
$this->view->title = "SUITE #$suite->id $suite->name/" . $this->products[$productID];
|
||||
$this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$this->view->title = "SUITE #$suite->id $suite->name";
|
||||
$this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"));
|
||||
$this->view->position[] = $this->lang->testsuite->common;
|
||||
$this->view->position[] = $this->lang->testsuite->view;
|
||||
|
||||
@@ -237,15 +234,12 @@ class testsuite extends control
|
||||
|
||||
if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back'));
|
||||
|
||||
/* Get suite info. */
|
||||
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->project);
|
||||
/* Set product session. */
|
||||
$this->view->products = $this->products = $this->loadModel('product')->getPairs();
|
||||
$productID = $this->product->saveState($suite->product, $this->products);
|
||||
|
||||
/* Set menu. */
|
||||
$this->testsuite->setMenu($this->products, $productID);
|
||||
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testsuite->edit;
|
||||
$this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"));
|
||||
$this->view->position[] = $this->lang->testsuite->common;
|
||||
$this->view->position[] = $this->lang->testsuite->edit;
|
||||
|
||||
@@ -308,23 +302,21 @@ class testsuite extends control
|
||||
*/
|
||||
public function linkCase($suiteID, $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* Save session. */
|
||||
$this->session->set('caseList', $this->app->getURI(true));
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->testsuite->linkCase($suiteID);
|
||||
$this->locate(inlink('view', "suiteID=$suiteID"));
|
||||
}
|
||||
|
||||
/* Save session. */
|
||||
$this->session->set('caseList', $this->app->getURI(true));
|
||||
$suite = $this->testsuite->getById($suiteID);
|
||||
|
||||
/* Get suite and product id. */
|
||||
$this->view->products = $this->products = $this->loadModel('product')->getProductPairsByProject($this->session->project);
|
||||
$suite = $this->testsuite->getById($suiteID);
|
||||
/* Set product session. */
|
||||
$this->view->products = $this->products = $this->loadModel('product')->getPairs();
|
||||
$productID = $this->product->saveState($suite->product, $this->products);
|
||||
|
||||
/* Save session. */
|
||||
$this->testsuite->setMenu($this->products, $productID);
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
@@ -343,7 +335,7 @@ class testsuite extends control
|
||||
$this->loadModel('search')->setSearchParams($this->config->testcase->search);
|
||||
|
||||
$this->view->title = $suite->name . $this->lang->colon . $this->lang->testsuite->linkCase;
|
||||
$this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"));
|
||||
$this->view->position[] = $this->lang->testsuite->common;
|
||||
$this->view->position[] = $this->lang->testsuite->linkCase;
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@ class testtask extends control
|
||||
public function browse($productID = 0, $branch = '', $type = 'local,totalStatus', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $beginTime = 0, $endTime = 0)
|
||||
{
|
||||
/* Save session. */
|
||||
$this->session->set('testtaskList', $this->app->getURI(true));
|
||||
$this->session->set('buildList', $this->app->getURI(true));
|
||||
$this->session->set('testtaskList', $this->app->getURI(true), 'qa');
|
||||
$this->session->set('buildList', $this->app->getURI(true), 'execution');
|
||||
|
||||
$scopeAndStatus = explode(',', $type);
|
||||
$this->session->set('testTaskVersionScope', $scopeAndStatus[0]);
|
||||
@@ -135,12 +135,14 @@ class testtask extends control
|
||||
{
|
||||
/* Save session. */
|
||||
$this->session->set('testtaskList', $this->app->getURI(true));
|
||||
$this->session->set('buildList', $this->app->getURI(true), 'execution');
|
||||
$this->loadModel('testcase');
|
||||
$this->app->loadLang('tree');
|
||||
|
||||
/* Set menu. */
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
$this->loadModel('qa')->setMenu($this->products, $productID);
|
||||
$this->app->rawModule = 'testcase';
|
||||
|
||||
/* Load pager. */
|
||||
if($browseType == 'newest') $recPerPage = '10';
|
||||
@@ -291,13 +293,11 @@ class testtask extends control
|
||||
|
||||
/* Set browseType, productID, moduleID and queryID. */
|
||||
$productID = $this->product->saveState($task->product, $this->products);
|
||||
$this->loadModel('qa')->setMenu($this->products, $task->product);
|
||||
$this->app->rawModule = 'testcase';
|
||||
|
||||
/* Set menu, save session. */
|
||||
$this->lang->testtask->menu = $this->lang->testcase->menu;
|
||||
$this->lang->testtask->menuOrder = $this->lang->testcase->menuOrder;
|
||||
$this->lang->testtask->subMenu->testcase->unit['subModule'] = 'testtask';
|
||||
$this->loadModel('testtask')->setUnitMenu($this->products, $productID, 0, $taskID);
|
||||
$this->session->set('caseList', $this->app->getURI(true));
|
||||
/* Save session. */
|
||||
$this->session->set('caseList', $this->app->getURI(true), 'qa');
|
||||
|
||||
/* Load lang. */
|
||||
$this->app->loadLang('testtask');
|
||||
@@ -1211,7 +1211,9 @@ class testtask extends control
|
||||
die(js::locate($this->createLink('testtask', 'unitCases', "taskID=$taskID"), 'parent'));
|
||||
}
|
||||
|
||||
/* Set menu. */
|
||||
$this->loadModel('qa')->setMenu($this->products, $productID);
|
||||
$this->app->rawModule = 'testcase';
|
||||
|
||||
$this->app->loadLang('job');
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@ class testtaskModel extends model
|
||||
public function getProductUnitTasks($productID, $browseType = '', $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$beginAndEnd = $this->loadModel('action')->computeBeginAndEnd($browseType);
|
||||
if(empty($beginAndEnd)) $beginAndEnd = array('begin' => '', 'end' => '');
|
||||
|
||||
if($browseType == 'newest') $orderBy = 'end_desc,' . $orderBy;
|
||||
$tasks = $this->dao->select("t1.*, t2.name AS productName, t3.name AS executionName, t4.name AS buildName")
|
||||
->from(TABLE_TESTTASK)->alias('t1')
|
||||
@@ -117,6 +119,7 @@ class testtaskModel extends model
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
|
||||
$resultGroups = $this->dao->select('t1.task, t2.*')->from(TABLE_TESTRUN)->alias('t1')
|
||||
->leftJoin(TABLE_TESTRESULT)->alias('t2')->on('t1.id=t2.run')
|
||||
->where('t1.task')->in(array_keys($tasks))
|
||||
|
||||
@@ -89,7 +89,7 @@ $status = $this->session->testTaskVersionStatus;
|
||||
<td class='c-name' title="<?php echo $task->name?>"><?php echo html::a(inlink('cases', "taskID=$task->id"), $task->name);?></td>
|
||||
<td class='c-name' title="<?php echo $task->productName?>"><?php echo $task->productName?></td>
|
||||
<td class='c-name' title="<?php echo $task->executionName?>"><?php echo $task->executionName?></td>
|
||||
<td class='c-name'><?php echo ($task->build == 'trunk' || empty($task->buildName)) ? $lang->trunk : html::a($this->createLink('build', 'view', "buildID=$task->build"), $task->buildName, '', "data-group={$lang->navGroup->testtask}");?></td>
|
||||
<td class='c-name'><?php echo ($task->build == 'trunk' || empty($task->buildName)) ? $lang->trunk : html::a($this->createLink('build', 'view', "buildID=$task->build"), $task->buildName, '', "data-group=execution");?></td>
|
||||
<td title="<?php echo zget($users, $task->owner);?>"><?php echo zget($users, $task->owner);?></td>
|
||||
<td><?php echo $task->begin?></td>
|
||||
<td><?php echo $task->end?></td>
|
||||
|
||||
@@ -52,9 +52,9 @@
|
||||
<th class='text-left'> <?php common::printOrderLink('build', $orderBy, $vars, $lang->testtask->build);?></th>
|
||||
<th class='c-user text-left'> <?php common::printOrderLink('owner', $orderBy, $vars, $lang->testtask->owner);?></th>
|
||||
<th class='w-90px text-left'> <?php common::printOrderLink('begin', $orderBy, $vars, $lang->testtask->execTime);?></th>
|
||||
<th class='w-50px text-center'><?php echo $lang->testtask->caseCount;?></th>
|
||||
<th class='w-40px text-center'><?php echo $lang->testtask->passCount;?></th>
|
||||
<th class='w-40px text-center'><?php echo $lang->testtask->failCount;?></th>
|
||||
<th class='w-60px text-center'><?php echo $lang->testtask->caseCount;?></th>
|
||||
<th class='w-60px text-center'><?php echo $lang->testtask->passCount;?></th>
|
||||
<th class='w-60px text-center'><?php echo $lang->testtask->failCount;?></th>
|
||||
<th class='c-actions-3 text-center'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -64,7 +64,7 @@
|
||||
<td><?php printf('%03d', $task->id);?></td>
|
||||
<td class='c-name' title="<?php echo $task->name?>"><?php echo html::a(inlink('unitCases', "taskID=$task->id"), $task->name);?></td>
|
||||
<td class='c-name' title="<?php echo $task->executionName?>"><?php echo $task->executionName?></td>
|
||||
<td class='c-name'><?php echo ($task->build == 'trunk' || empty($task->buildName)) ? $lang->trunk : html::a($this->createLink('build', 'view', "buildID=$task->build",'',true), $task->buildName);?></td>
|
||||
<td class='c-name' title="<?php echo $task->buildName;?>"><?php echo ($task->build == 'trunk' || empty($task->buildName)) ? $lang->trunk : html::a($this->createLink('build', 'view', "buildID=$task->build"), $task->buildName, '', 'data-app="execution"');?></td>
|
||||
<td><?php echo zget($users, $task->owner);?></td>
|
||||
<td><?php echo $task->begin?></td>
|
||||
<td class='text-center'><?php echo $task->caseCount?></td>
|
||||
@@ -96,8 +96,7 @@ $(function()
|
||||
{
|
||||
$('#<?php echo $browseType?>UnitTab').addClass('selected');
|
||||
$('#browseunitsTab').addClass('btn-active-text');
|
||||
$('#navbar li[data-id="testtask"]').removeClass('active');
|
||||
$('#navbar li[data-id="testcase"]').addClass('active');
|
||||
$('#subNavbar li[data-id="case"]').addClass('active');
|
||||
})
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -99,4 +99,10 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#subNavbar li[data-id="case"]').addClass('active');
|
||||
})
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -51,12 +51,7 @@ js::set('flow', $config->global->flow);
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
<?php if($this->config->global->flow == 'full'):?>
|
||||
$('#subNavbar [data-id=testcase]').addClass('active');
|
||||
<?php else:?>
|
||||
$('#navbar li.active').removeClass('active');
|
||||
$('#navbar li[data-id=unit]').addClass('active');
|
||||
<?php endif;?>
|
||||
$('#subNavbar li[data-id="case"]').addClass('active');
|
||||
})
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
+9
-49
@@ -95,23 +95,9 @@ class tree extends control
|
||||
}
|
||||
elseif($viewType == 'bug')
|
||||
{
|
||||
$this->lang->navGroup->tree = 'qa';
|
||||
$productPairs = array();
|
||||
if($from == 'project')
|
||||
{
|
||||
$this->lang->navGroup->tree = 'project';
|
||||
$productPairs = $this->product->getProductPairsByProject($this->session->project);
|
||||
}
|
||||
elseif($from == 'qa')
|
||||
{
|
||||
$this->app->loadConfig('qa');
|
||||
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
|
||||
$productPairs = $this->product->getPairs();
|
||||
}
|
||||
|
||||
$this->loadModel('bug')->setMenu($productPairs, $rootID);
|
||||
$this->lang->tree->menu = $this->lang->bug->menu;
|
||||
$this->lang->tree->menuOrder = $this->lang->bug->menuOrder;
|
||||
$this->app->loadConfig('qa');
|
||||
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
|
||||
$this->app->rawModule = 'bug';
|
||||
|
||||
$title = $this->lang->tree->manageBug;
|
||||
$position[] = html::a($this->createLink('bug', 'browse', "product=$rootID"), $product->name);
|
||||
@@ -130,25 +116,9 @@ class tree extends control
|
||||
}
|
||||
elseif($viewType == 'case')
|
||||
{
|
||||
$this->lang->navGroup->tree = 'qa';
|
||||
|
||||
$productPairs = array();
|
||||
if($from == 'project')
|
||||
{
|
||||
$this->lang->navGroup->tree = 'project';
|
||||
$productPairs = $this->product->getProductPairsByProject($this->session->project);
|
||||
}
|
||||
elseif($from == 'qa')
|
||||
{
|
||||
$this->lang->navGroup->tree = 'qa';
|
||||
$this->app->loadConfig('qa');
|
||||
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
|
||||
$productPairs = $this->product->getPairs();
|
||||
}
|
||||
|
||||
$this->loadModel('testcase')->setMenu($productPairs, $rootID);
|
||||
$this->lang->tree->menu = $this->lang->testcase->menu;
|
||||
$this->lang->tree->menuOrder = $this->lang->testcase->menuOrder;
|
||||
$this->app->loadConfig('qa');
|
||||
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
|
||||
$this->app->rawModule = 'testcase';
|
||||
|
||||
$title = $this->lang->tree->manageCase;
|
||||
$position[] = html::a($this->createLink('testcase', 'browse', "product=$rootID"), $product->name);
|
||||
@@ -156,21 +126,11 @@ class tree extends control
|
||||
}
|
||||
elseif($viewType == 'caselib')
|
||||
{
|
||||
$this->lang->navGroup->tree = 'qa';
|
||||
if($from == 'project')
|
||||
{
|
||||
$this->lang->navGroup->tree = 'project';
|
||||
}
|
||||
elseif($from == 'qa')
|
||||
{
|
||||
$this->lang->navGroup->tree = 'qa';
|
||||
$this->app->loadConfig('qa');
|
||||
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
|
||||
}
|
||||
$this->app->loadConfig('qa');
|
||||
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
|
||||
|
||||
$this->caselib->setLibMenu($this->caselib->getLibraries(), $rootID);
|
||||
$this->lang->tree->menu = $this->lang->caselib->menu;
|
||||
$this->lang->tree->menuOrder = $this->lang->caselib->menuOrder;
|
||||
$this->app->rawModule = 'caselib';
|
||||
|
||||
$title = $this->lang->tree->manageCaseLib;
|
||||
$position[] = html::a($this->createLink('caselib', 'browse', "libID=$rootID"), $lib->name);
|
||||
|
||||
Reference in New Issue
Block a user