Merge branch 'master' into 256
This commit is contained in:
@@ -32,7 +32,7 @@ $config->testcase->custom->createFields = $config->testcase->customCreateFi
|
||||
$config->testcase->custom->batchCreateFields = 'module,story,%s';
|
||||
$config->testcase->custom->batchEditFields = 'branch,module,stage,status,pri,story';
|
||||
|
||||
$config->testcase->excludeCheckFileds = ',pri,type,stage,needReview,story,';
|
||||
$config->testcase->excludeCheckFileds = ',pri,type,stage,needReview,story,branch,';
|
||||
|
||||
global $lang;
|
||||
$config->testcase->search['module'] = 'testcase';
|
||||
@@ -88,11 +88,11 @@ $config->testcase->datatable->fieldList['id']['required'] = 'yes';
|
||||
|
||||
$config->testcase->datatable->fieldList['product']['title'] = 'priAB';
|
||||
$config->testcase->datatable->fieldList['product']['control'] = 'hidden';
|
||||
$config->testcase->datatable->fieldList['product']['dataSource'] = array('module' => 'port', 'method' => 'getRelatedObjects', 'params' => 'testcase&product&id,name');
|
||||
$config->testcase->datatable->fieldList['product']['dataSource'] = array('module' => 'product', 'method' => 'getPairs', 'params' => '&0&&all');
|
||||
|
||||
$config->testcase->datatable->fieldList['module']['title'] = 'module';
|
||||
$config->testcase->datatable->fieldList['module']['control'] = 'select';
|
||||
$config->testcase->datatable->fieldList['module']['dataSource'] = array('module' => 'tree', 'method' => 'getOptionMenu', 'params' => '$productID&case');
|
||||
$config->testcase->datatable->fieldList['module']['dataSource'] = array('module' => 'testcase', 'method' => 'getDatatableModules', 'params' => '$productID');
|
||||
|
||||
$config->testcase->datatable->fieldList['title']['title'] = 'title';
|
||||
$config->testcase->datatable->fieldList['title']['fixed'] = 'left';
|
||||
@@ -103,7 +103,7 @@ $config->testcase->datatable->fieldList['branch']['title'] = 'branch';
|
||||
$config->testcase->datatable->fieldList['branch']['fixed'] = 'left';
|
||||
$config->testcase->datatable->fieldList['branch']['width'] = '100';
|
||||
$config->testcase->datatable->fieldList['branch']['required'] = 'no';
|
||||
$config->testcase->datatable->fieldList['branch']['dataSource'] = array('module' => 'port', 'method' => 'getRelatedObjects', 'params' => 'testcase&branch&id,name');
|
||||
$config->testcase->datatable->fieldList['branch']['dataSource'] = array('module' => 'branch', 'method' => 'getPairs', 'params' => '$productID');
|
||||
|
||||
$config->testcase->datatable->fieldList['pri']['title'] = 'priAB';
|
||||
$config->testcase->datatable->fieldList['pri']['fixed'] = 'left';
|
||||
|
||||
+50
-21
@@ -60,13 +60,13 @@ class testcase extends control
|
||||
else
|
||||
{
|
||||
$mode = ($this->app->methodName == 'create' and empty($this->config->CRProduct)) ? 'noclosed' : '';
|
||||
$products = $this->product->getPairs($mode);
|
||||
$products = $this->product->getPairs($mode, 0, '', 'all');
|
||||
}
|
||||
if(empty($products) and !helper::isAjaxRequest()) return print($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$tab&activeMenu=testcase&objectID=$objectID")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$products = $this->product->getPairs();
|
||||
$products = $this->product->getPairs('', 0, '', 'all');
|
||||
}
|
||||
$this->view->products = $this->products = $products;
|
||||
}
|
||||
@@ -118,6 +118,8 @@ class testcase extends control
|
||||
$linkedProducts = $this->product->getProducts($projectID, 'all', '', false);
|
||||
$this->products = count($linkedProducts) > 1 ? array('0' => $this->lang->product->all) + $linkedProducts : $linkedProducts;
|
||||
$productID = count($linkedProducts) > 1 ? $productID : key($linkedProducts);
|
||||
$hasProduct = $this->dao->findById($projectID)->from(TABLE_PROJECT)->fetch('hasProduct');
|
||||
if(!$hasProduct) unset($this->config->testcase->search['fields']['product']);
|
||||
|
||||
$this->loadModel('project')->setMenu($projectID);
|
||||
}
|
||||
@@ -163,7 +165,8 @@ class testcase extends control
|
||||
$actionURL = $this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID");
|
||||
$this->config->testcase->search['onMenuBar'] = 'yes';
|
||||
|
||||
$this->testcase->buildSearchForm($productID, $this->products, $queryID, $actionURL, $projectID);
|
||||
$searchProducts = $this->product->getPairs('', 0, '', 'all');
|
||||
$this->testcase->buildSearchForm($productID, $searchProducts, $queryID, $actionURL, $projectID);
|
||||
|
||||
$showModule = !empty($this->config->datatable->testcaseBrowse->showModule) ? $this->config->datatable->testcaseBrowse->showModule : '';
|
||||
|
||||
@@ -242,6 +245,7 @@ class testcase extends control
|
||||
{
|
||||
$groupBy = empty($groupBy) ? 'story' : $groupBy;
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
$product = $this->product->getByID($productID);
|
||||
if($branch === '') $branch = $this->cookie->preBranch;
|
||||
|
||||
$this->app->loadLang('testtask');
|
||||
@@ -250,7 +254,7 @@ class testcase extends control
|
||||
if($this->app->tab == 'project')
|
||||
{
|
||||
$products = array('0' => $this->lang->product->all) + $this->product->getProducts($this->session->project, 'all', '', false);
|
||||
$this->lang->modulePageNav = $this->product->select($products, $productID, 'testcase', 'groupCase', "projectID=$projectID", $branch);
|
||||
if(!$product->shadow) $this->lang->modulePageNav = $this->product->select($products, $productID, 'testcase', 'groupCase', $projectID, $branch);
|
||||
}
|
||||
|
||||
$this->session->set('caseList', $this->app->getURI(true), $this->app->tab);
|
||||
@@ -291,7 +295,7 @@ class testcase extends control
|
||||
$this->view->suiteID = 0;
|
||||
$this->view->moduleID = 0;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->product = $this->product->getByID($productID);
|
||||
$this->view->product = $product;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -318,16 +322,16 @@ class testcase extends control
|
||||
if($this->app->tab == 'project')
|
||||
{
|
||||
$this->loadModel('project')->setMenu($this->session->project);
|
||||
$this->app->rawModule = 'qa';
|
||||
$this->lang->project->menu->qa['subMenu']->testcase['subModule'] = 'story';
|
||||
$products = $this->product->getProducts($this->session->project, 'all', '', false);
|
||||
$productID = $this->product->saveState($productID, $products);
|
||||
$this->lang->modulePageNav = $this->product->select($products, $productID, 'testcase', 'zeroCase', "projectID=$projectID", $branchID);
|
||||
$product = $this->product->getByID($productID);
|
||||
if(!$product->shadow) $this->lang->modulePageNav = $this->product->select($products, $productID, 'testcase', 'zeroCase', $projectID, $branchID);
|
||||
}
|
||||
else
|
||||
{
|
||||
$products = $this->product->getPairs();
|
||||
$productID = $this->product->saveState($productID, $products);
|
||||
$product = $this->product->getByID($productID);
|
||||
$this->loadModel('qa');
|
||||
$this->app->rawModule = 'testcase';
|
||||
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
|
||||
@@ -345,8 +349,6 @@ class testcase extends control
|
||||
$stories = array_chunk($stories, $pager->recPerPage);
|
||||
|
||||
$this->view->title = $this->lang->story->zeroCase;
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $products[$productID]);
|
||||
$this->view->position[] = $this->lang->story->zeroCase;
|
||||
|
||||
$this->view->stories = empty($stories) ? $stories : $stories[$pageID - 1];
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
@@ -356,7 +358,7 @@ class testcase extends control
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID);
|
||||
$this->view->browseType = '';
|
||||
$this->view->product = $this->product->getByID($productID);
|
||||
$this->view->product = $product;
|
||||
$this->view->pager = $pager;
|
||||
$this->display();
|
||||
}
|
||||
@@ -406,6 +408,7 @@ class testcase extends control
|
||||
|
||||
$this->loadModel('action');
|
||||
$this->action->create('case', $caseID, 'Opened');
|
||||
if($this->testcase->getStatus('create') == 'wait') $this->action->create('case', $caseID, 'submitReview');
|
||||
|
||||
/* If the story is linked project, make the case link the project. */
|
||||
$this->testcase->syncCase2Project($caseResult['caseInfo'], $caseID);
|
||||
@@ -571,6 +574,7 @@ class testcase extends control
|
||||
$this->view->precondition = $precondition;
|
||||
$this->view->keywords = $keywords;
|
||||
$this->view->steps = $steps;
|
||||
$this->view->hiddenProduct = !empty($product->shadow);
|
||||
$this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted');
|
||||
$this->view->branch = $branch;
|
||||
$this->view->product = $product;
|
||||
@@ -758,13 +762,15 @@ class testcase extends control
|
||||
|
||||
$caseID = (int)$caseID;
|
||||
$case = $this->testcase->getById($caseID, $version);
|
||||
$case = $this->loadModel('story')->checkNeedConfirm($case);
|
||||
|
||||
if(!$case)
|
||||
{
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => '404 Not found'));
|
||||
return print(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index')));
|
||||
}
|
||||
|
||||
$case = $this->loadModel('story')->checkNeedConfirm($case);
|
||||
|
||||
if($from == 'testtask')
|
||||
{
|
||||
$run = $this->loadModel('testtask')->getRunByCase($taskID, $caseID);
|
||||
@@ -833,7 +839,7 @@ class testcase extends control
|
||||
$this->view->caseModule = empty($case->module) ? '' : $this->tree->getById($case->module);
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->actions = $this->loadModel('action')->getList('case', $caseID);
|
||||
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('testcase', $caseID);
|
||||
$this->view->preAndNext = !isOnlybody() ? $this->loadModel('common')->getPreAndNextObject('testcase', $caseID) : '';
|
||||
$this->view->runID = $from == 'testcase' ? 0 : $run->id;
|
||||
$this->view->isLibCase = $isLibCase;
|
||||
$this->view->caseFails = $caseFails;
|
||||
@@ -855,6 +861,9 @@ class testcase extends control
|
||||
{
|
||||
$this->loadModel('story');
|
||||
|
||||
$case = $this->testcase->getById($caseID);
|
||||
if(!$case) return print(js::error($this->lang->notFound) . js::locate('back'));
|
||||
|
||||
$testtasks = $this->loadModel('testtask')->getGroupByCases($caseID);
|
||||
$testtasks = empty($testtasks[$caseID]) ? array() : $testtasks[$caseID];
|
||||
|
||||
@@ -872,6 +881,8 @@ class testcase extends control
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$actionID = $this->action->create('case', $caseID, $action, $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
if($case->status != 'wait' and $this->post->status == 'wait') $this->action->create('case', $caseID, 'submitReview');
|
||||
}
|
||||
|
||||
$this->executeHooks($caseID);
|
||||
@@ -886,8 +897,6 @@ class testcase extends control
|
||||
}
|
||||
}
|
||||
|
||||
$case = $this->testcase->getById($caseID);
|
||||
if(!$case) return print(js::error($this->lang->notFound) . js::locate('back'));
|
||||
if($case->auto == 'unit')
|
||||
{
|
||||
$this->lang->testcase->subMenu->testcase->feature['alias'] = '';
|
||||
@@ -1390,6 +1399,8 @@ class testcase extends control
|
||||
$objectID = 0;
|
||||
if($this->app->tab == 'project') $objectID = $case->project;
|
||||
if($this->app->tab == 'execution') $objectID = $case->execution;
|
||||
|
||||
unset($this->config->testcase->search['fields']['product']);
|
||||
$this->testcase->buildSearchForm($case->product, $this->products, $queryID, $actionURL, $objectID);
|
||||
|
||||
/* Get cases to link. */
|
||||
@@ -1403,7 +1414,7 @@ class testcase extends control
|
||||
|
||||
/* Assign. */
|
||||
$this->view->title = $case->title . $this->lang->colon . $this->lang->testcase->linkCases;
|
||||
$this->view->position[] = html::a($this->createLink('product', 'view', "productID=$case->product"), $this->products[$case->product]);
|
||||
$this->view->position[] = html::a($this->createLink('product', 'view', "productID=$case->product"), zget($this->products, $case->product, ''));
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'view', "caseID=$caseID"), $case->title);
|
||||
$this->view->position[] = $this->lang->testcase->linkCases;
|
||||
$this->view->case = $case;
|
||||
@@ -1439,6 +1450,15 @@ class testcase extends control
|
||||
$objectID = 0;
|
||||
if($this->app->tab == 'project') $objectID = $case->project;
|
||||
if($this->app->tab == 'execution') $objectID = $case->execution;
|
||||
|
||||
/* Unset search field 'plan' in single project. */
|
||||
unset($this->config->bug->search['fields']['product']);
|
||||
if($case->project and ($this->app->tab == 'project' or $this->app->tab == 'execution'))
|
||||
{
|
||||
$project = $this->loadModel('project')->getById($case->project);
|
||||
if(!$project->hasProduct and $project->model == 'waterfall') unset($this->config->bug->search['fields']['plan']);
|
||||
}
|
||||
|
||||
$this->bug->buildSearchForm($case->product, $this->products, $queryID, $actionURL, $objectID);
|
||||
|
||||
/* Get cases to link. */
|
||||
@@ -1599,8 +1619,19 @@ class testcase extends control
|
||||
$orderBy = '`' . $field . '`_' . $sort;
|
||||
}
|
||||
|
||||
$product = $this->loadModel('product')->getById($productID);
|
||||
if($product->type != 'normal') $this->lang->testcase->branch = $this->lang->product->branchName[$product->type];
|
||||
$product = $this->loadModel('product')->getById($productID);
|
||||
$products = $this->loadModel('product')->getPairs('', 0, '', 'all');
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
$this->lang->testcase->branch = $this->lang->product->branchName[$product->type];
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->config->testcase->exportFields = str_replace('branch,', '', $this->config->testcase->exportFields);
|
||||
}
|
||||
|
||||
if($product->shadow) $this->config->testcase->exportFields = str_replace('product,', '', $this->config->testcase->exportFields);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$this->loadModel('file');
|
||||
@@ -1662,7 +1693,6 @@ class testcase extends control
|
||||
|
||||
/* Get users, products and projects. */
|
||||
$users = $this->loadModel('user')->getPairs('noletter');
|
||||
$products = $this->loadModel('product')->getPairs();
|
||||
$branches = $this->loadModel('branch')->getPairs($productID);
|
||||
|
||||
/* Get related objects id lists. */
|
||||
@@ -1802,12 +1832,11 @@ class testcase extends control
|
||||
}
|
||||
|
||||
$fileName = $this->lang->testcase->common;
|
||||
$productName = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch('name');
|
||||
$browseType = isset($this->lang->testcase->featureBar['browse'][$browseType]) ? $this->lang->testcase->featureBar['browse'][$browseType] : '';
|
||||
|
||||
if($taskID) $taskName = $this->dao->findById($taskID)->from(TABLE_TESTTASK)->fetch('name');
|
||||
|
||||
$this->view->fileName = $productName . $this->lang->dash . ($taskID ? $taskName . $this->lang->dash : '') . $browseType . $fileName;
|
||||
$this->view->fileName = zget($products, $productID, '') . $this->lang->dash . ($taskID ? $taskName . $this->lang->dash : '') . $browseType . $fileName;
|
||||
$this->view->allExportFields = $this->config->testcase->exportFields;
|
||||
$this->view->customExport = true;
|
||||
$this->display();
|
||||
|
||||
@@ -2,3 +2,7 @@
|
||||
.group-header > a {line-height: 20px; display: block; max-height: 40px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;}
|
||||
.c-result {width: 80px;}
|
||||
.c-bugs, .c-results, .c-steps {width: 30px;}
|
||||
|
||||
#subHeader #dropMenu .col-left .list-group {margin-bottom: 0px; padding-top: 10px;}
|
||||
#subHeader #dropMenu .col-left {padding-bottom: 0px;}
|
||||
#currentBranch + #dropMenu .col-left {padding-bottom: 30px;}
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
.table table td,.outer .table table tbody > tr:last-child td {padding: 2px 0 2px 5px !important; border: none !important;}
|
||||
.c-name {min-width: 120px;}
|
||||
.c-name{width: 120px;}
|
||||
.c-branch {width: 120px;}
|
||||
.c-line-number {width: 50px;}
|
||||
.c-id {width: 40px;}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
.thWidth {width: 86px !important;}
|
||||
.thWidth {width: 94px !important;}
|
||||
.lifeThWidth {width: 70px !important;}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#subHeader #dropMenu .col-left .list-group {margin-bottom: 0px; padding-top: 10px;}
|
||||
#subHeader #dropMenu .col-left {padding-bottom: 0px;}
|
||||
#currentBranch + #dropMenu .col-left {padding-bottom: 30px;}
|
||||
@@ -20,6 +20,7 @@ $(function()
|
||||
$(select).trigger("chosen:updated");
|
||||
}
|
||||
});
|
||||
$('.pager a.pager-item').attr('data-app', app);
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#zerocaseTab').addClass('btn-active-text');
|
||||
$('.pager').attr('data-app', tab);
|
||||
});
|
||||
|
||||
+56
-19
@@ -58,7 +58,7 @@ class testcaseModel extends model
|
||||
->add('fromBug', $bugID)
|
||||
->setDefault('openedBy', $this->app->user->account)
|
||||
->setDefault('openedDate', $now)
|
||||
->setIF($this->config->systemMode == 'new' and $this->app->tab == 'project', 'project', $this->session->project)
|
||||
->setIF($this->app->tab == 'project', 'project', $this->session->project)
|
||||
->setIF($this->app->tab == 'execution', 'execution', $this->session->execution)
|
||||
->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion((int)$this->post->story))
|
||||
->remove('steps,expects,files,labels,stepType,forceNotReview')
|
||||
@@ -163,7 +163,7 @@ class testcaseModel extends model
|
||||
|
||||
$data[$i] = new stdclass();
|
||||
$data[$i]->product = $productID;
|
||||
if($this->config->systemMode == 'new' && $this->app->tab == 'project') $data[$i]->project = $this->session->project;
|
||||
if($this->app->tab == 'project') $data[$i]->project = $this->session->project;
|
||||
$data[$i]->branch = $cases->branch[$i];
|
||||
$data[$i]->module = $cases->module[$i];
|
||||
$data[$i]->type = $cases->type[$i];
|
||||
@@ -346,7 +346,7 @@ class testcaseModel extends model
|
||||
->where('t1.project')->eq((int)$executionID)
|
||||
->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID)->fi()
|
||||
->beginIF(!empty($moduleID))->andWhere('t4.path')->like("%,$moduleID,%")->fi()
|
||||
->beginIF(!empty($productID))->andWhere('t2.branch')->eq($branchID)->fi()
|
||||
->beginIF(!empty($productID) and $branchID !== 'all')->andWhere('t2.branch')->eq($branchID)->fi()
|
||||
->andWhere('t2.deleted')->eq('0')
|
||||
->andWhere('t3.version > t2.storyVersion')
|
||||
->andWhere("t3.status")->eq('active')
|
||||
@@ -362,7 +362,7 @@ class testcaseModel extends model
|
||||
->beginIF($browseType != 'all' and $browseType != 'byModule')->andWhere('t2.status')->eq($browseType)->fi()
|
||||
->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID)->fi()
|
||||
->beginIF(!empty($moduleID))->andWhere('t3.path')->like("%,$moduleID,%")->fi()
|
||||
->beginIF(!empty($productID))->andWhere('t2.branch')->eq($branchID)->fi()
|
||||
->beginIF(!empty($productID) and $branchID !== 'all')->andWhere('t2.branch')->eq($branchID)->fi()
|
||||
->andWhere('t2.deleted')->eq('0')
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
@@ -1326,10 +1326,12 @@ class testcaseModel extends model
|
||||
*/
|
||||
public static function isClickable($case, $action, $module = 'testcase')
|
||||
{
|
||||
global $config;
|
||||
|
||||
$action = strtolower($action);
|
||||
|
||||
if($module == 'testcase' && $action == 'createbug') return $case->caseFails > 0;
|
||||
if($module == 'testcase' && $action == 'review') return isset($case->caseStatus) ? $case->caseStatus == 'wait' : $case->status == 'wait';
|
||||
if($module == 'testcase' && $action == 'createbug') return $case->caseFails > 0;
|
||||
if($module == 'testcase' && $action == 'review') return isset($case->caseStatus) ? $case->caseStatus == 'wait' : $case->status == 'wait';
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1436,7 +1438,15 @@ class testcaseModel extends model
|
||||
$cases[$key] = $caseData;
|
||||
$line++;
|
||||
}
|
||||
if(!empty($fieldNames)) dao::$errors = sprintf($this->lang->testcase->noRequireTip, implode(',', $fieldNames));
|
||||
if(!empty($fieldNames))
|
||||
{
|
||||
$tipContent = '';
|
||||
foreach($requiredFields as $field)
|
||||
{
|
||||
if(isset($fieldNames[$field])) $tipContent .= ",{$fieldNames[$field]}";
|
||||
}
|
||||
dao::$errors = sprintf($this->lang->testcase->noRequireTip, trim($tipContent, ','));
|
||||
}
|
||||
|
||||
if(dao::isError()) return false;
|
||||
|
||||
@@ -1541,7 +1551,7 @@ class testcaseModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->config->systemMode == 'new' && $this->app->tab == 'project') $caseData->project = $this->session->project;
|
||||
if($this->app->tab == 'project') $caseData->project = $this->session->project;
|
||||
$caseData->version = 1;
|
||||
$caseData->openedBy = $this->app->user->account;
|
||||
$caseData->openedDate = $now;
|
||||
@@ -1912,14 +1922,23 @@ class testcaseModel extends model
|
||||
*/
|
||||
public function buildSearchForm($productID, $products, $queryID, $actionURL, $projectID = 0)
|
||||
{
|
||||
$product = ($this->app->tab == 'project' and empty($productID)) ? $products : array($productID => $products[$productID]) + array('all' => $this->lang->testcase->allProduct);
|
||||
$this->config->testcase->search['params']['product']['values'] = $product;
|
||||
$productList = array();
|
||||
if($this->app->tab == 'project' and empty($productID))
|
||||
{
|
||||
$productList = $products;
|
||||
}
|
||||
else
|
||||
{
|
||||
$productList = array('all' => $this->lang->all);
|
||||
if(isset($products[$productID])) $productList = array($productID => $products[$productID]) + $productList;
|
||||
}
|
||||
$this->config->testcase->search['params']['product']['values'] = array('') + $productList;
|
||||
|
||||
$module = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0);
|
||||
if(!$productID)
|
||||
{
|
||||
$module = array();
|
||||
foreach($products as $id => $product) $module += $this->loadModel('tree')->getOptionMenu($id, 'case', 0);
|
||||
foreach($products as $id => $name) $module += $this->loadModel('tree')->getOptionMenu($id, 'case', 0);
|
||||
}
|
||||
$this->config->testcase->search['params']['module']['values'] = $module;
|
||||
|
||||
@@ -1933,8 +1952,8 @@ class testcaseModel extends model
|
||||
else
|
||||
{
|
||||
$this->app->loadLang('branch');
|
||||
$productInfo = $this->loadModel('product')->getByID($productID);
|
||||
$this->config->testcase->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$productInfo->type]);
|
||||
$product = $this->loadModel('product')->getByID($productID);
|
||||
$this->config->testcase->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
|
||||
$this->config->testcase->search['params']['branch']['values'] = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, '', $projectID) + array('all' => $this->lang->branch->all);
|
||||
}
|
||||
if(!$this->config->testcase->needReview) unset($this->config->testcase->search['params']['status']['values']['wait']);
|
||||
@@ -2250,9 +2269,10 @@ class testcaseModel extends model
|
||||
$data->order = ++ $lastOrder;
|
||||
$this->dao->insert(TABLE_PROJECTCASE)->data($data)->exec();
|
||||
|
||||
$objectType = $objectInfo[$projectID]->type;
|
||||
$object = $objectInfo[$projectID];
|
||||
$objectType = $object->type;
|
||||
if($objectType == 'project') $this->action->create('case', $caseID, 'linked2project', '', $projectID);
|
||||
if(in_array($objectType, array('sprint', 'stage'))) $this->action->create('case', $caseID, 'linked2execution', '', $projectID);
|
||||
if(in_array($objectType, array('sprint', 'stage')) and $object->multiple) $this->action->create('case', $caseID, 'linked2execution', '', $projectID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2432,13 +2452,13 @@ class testcaseModel extends model
|
||||
{
|
||||
$menu .= $this->buildMenu('testtask', 'runCase', "$extraParams&version=$case->currentVersion", $case, 'view', 'play', '', 'showinonlybody', false, "data-width='95%'");
|
||||
$menu .= $this->buildMenu('testtask', 'results', "$extraParams&version=$case->version", $case, 'view', '', '', 'showinonlybody', false, "data-width='95%'");
|
||||
$menu .= $this->buildMenu('testcase', 'importToLib', $params, $case, 'view', 'assets', '', 'showinonlybody iframe', true, "data-width='500px'");
|
||||
if(!isonlybody()) $menu .= $this->buildMenu('testcase', 'importToLib', $params, $case, 'view', 'assets', '', 'showinonlybody iframe', true, "data-width='500px'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$menu .= $this->buildMenu('testtask', 'runCase', "$extraParams&version=$case->currentVersion", $case, 'view', 'play', '', 'showinonlybody iframe', false, "data-width='95%'");
|
||||
$menu .= $this->buildMenu('testtask', 'results', "$extraParams&version=$case->version", $case, 'view', '', '', 'showinonlybody iframe', false, "data-width='95%'");
|
||||
$menu .= $this->buildMenu('testcase', 'importToLib', $params, $case, 'view', 'assets', '', 'showinonlybody iframe', true, "data-width='500px'");
|
||||
if(!isonlybody()) $menu .= $this->buildMenu('testcase', 'importToLib', $params, $case, 'view', 'assets', '', 'showinonlybody iframe', true, "data-width='500px'");
|
||||
}
|
||||
if($case->caseFails > 0)
|
||||
{
|
||||
@@ -2447,7 +2467,7 @@ class testcaseModel extends model
|
||||
}
|
||||
if($this->config->testcase->needReview || !empty($this->config->testcase->forceReview))
|
||||
{
|
||||
$menu .= $this->buildMenu('testcase', 'review', $params, $case, 'view', '', '', 'iframe', '', '', $this->lang->testcase->reviewAB);
|
||||
$menu .= $this->buildMenu('testcase', 'review', $params, $case, 'view', '', '', 'showinonlybody iframe', '', '', $this->lang->testcase->reviewAB);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2513,7 +2533,7 @@ class testcaseModel extends model
|
||||
|
||||
if($this->config->testcase->needReview || !empty($this->config->testcase->forceReview))
|
||||
{
|
||||
common::printIcon('testcase', 'review', $params, $case, 'browse', 'glasses', '', 'iframe');
|
||||
common::printIcon('testcase', 'review', $params, $case, 'browse', 'glasses', '', 'showinonlybody iframe');
|
||||
}
|
||||
$menu .= $this->buildMenu('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=", $case, 'browse', 'bug', '', 'iframe', '', "data-width='90%'");
|
||||
$menu .= $this->buildMenu('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'browse', 'copy');
|
||||
@@ -2613,4 +2633,21 @@ class testcaseModel extends model
|
||||
}
|
||||
return $stepData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get modules for datatable.
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getDatatableModules($productID)
|
||||
{
|
||||
$branches = $this->loadModel('branch')->getPairs($productID);
|
||||
$modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', '');
|
||||
if(count($branches) <= 1) return $modules;
|
||||
|
||||
foreach($branches as $branchID => $branchName) $modules += $this->tree->getOptionMenu($productID, 'case', 0, $branchID);
|
||||
return $modules;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ js::set('suiteID', $suiteID);
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if(common::hasPriv('testcase', 'batchChangeBranch') and $this->session->currentProductType != 'normal'):?>
|
||||
<?php if(common::hasPriv('testcase', 'batchChangeBranch') and $this->session->currentProductType and $this->session->currentProductType != 'normal'):?>
|
||||
<div class="btn-group dropup">
|
||||
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->product->branchName[$this->session->currentProductType];?> <span class="caret"></span></button>
|
||||
<?php $withSearch = count($branchTagOption) > 6;?>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php js::set('flow', $config->global->flow);?>
|
||||
<?php $isProjectApp = $this->app->tab == 'project'?>
|
||||
<?php $currentModule = $isProjectApp ? 'project' : 'testcase';?>
|
||||
<?php $currentMethod = $isProjectApp ? 'testcase' : 'browse';?>
|
||||
<?php $projectParam = $isProjectApp ? "projectID={$this->session->project}&" : '';?>
|
||||
<?php $isProjectApp = $this->app->tab == 'project'?>
|
||||
<?php $currentModule = $isProjectApp ? 'project' : 'testcase';?>
|
||||
<?php $currentMethod = $isProjectApp ? 'testcase' : 'browse';?>
|
||||
<?php $projectParam = $isProjectApp ? "projectID={$this->session->project}&" : '';?>
|
||||
<?php if(common::checkNotCN()):?>
|
||||
<style> .btn-toolbar>.btn {margin-right: 3px !important;}</style>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -42,16 +42,18 @@ foreach(explode(',', $config->testcase->create->requiredFields) as $field)
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->testcase->product;?></th>
|
||||
<td>
|
||||
<th><?php echo $hiddenProduct ? $lang->testcase->module : $lang->testcase->product;?></th>
|
||||
<td class='<?php if($hiddenProduct) echo 'hidden';?>'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('product', $products, $productID, "onchange='loadAll(this.value);' class='form-control chosen'");?>
|
||||
<?php if(isset($product->type) and $product->type != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control' style='width:120px'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td style='padding-left:15px;'>
|
||||
<td style='<?php if(!$hiddenProduct) echo 'padding-left:15px;';?>'>
|
||||
<div class='input-group' id='moduleIdBox'>
|
||||
<?php if(!$hiddenProduct):?>
|
||||
<span class="input-group-addon w-80px"><?php echo $lang->testcase->module?></span>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
echo html::select('module', $moduleOptionMenu, $currentModuleID, "onchange='loadModuleRelated();' class='form-control chosen'");
|
||||
if(count($moduleOptionMenu) == 1)
|
||||
|
||||
@@ -73,6 +73,18 @@ $(function()
|
||||
$('tr:first').addClass("show-detail");
|
||||
$('#tr-detail_1').removeClass("hide");
|
||||
});
|
||||
|
||||
$('#resultsContainer').click(function(event)
|
||||
{
|
||||
if(event.target.id.indexOf('checkAll') !== -1)
|
||||
{
|
||||
var checkAll = document.getElementById(event.target.id);
|
||||
var checkAll = $(checkAll);
|
||||
var isChecked = checkAll.prop('checked');
|
||||
|
||||
checkAll.closest('tbody').children('tr').find('input[type=checkbox]').prop('checked', isChecked);
|
||||
}
|
||||
});
|
||||
});
|
||||
var sessionString = '<?php echo session_name() . '=' . session_id();?>';
|
||||
</script>
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<?php else:?>
|
||||
<tr>
|
||||
<tr class="<?php if($product->shadow) echo 'hidden';?>">
|
||||
<th><?php echo $lang->testcase->product;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
@@ -185,7 +185,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->testcase->module;?></th>
|
||||
<th class='w-100px'><?php echo $lang->testcase->module;?></th>
|
||||
<td>
|
||||
<div class='input-group' id='moduleIdBox'>
|
||||
<?php
|
||||
|
||||
@@ -102,4 +102,5 @@
|
||||
</div>
|
||||
<?php js::set('productID', $productID)?>
|
||||
<?php js::set('branch', $branch)?>
|
||||
<?php js::set('app', $app->tab)?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
<?php echo $lang->idAB;?>
|
||||
</th>
|
||||
<th class='c-pri' title=<?php echo $lang->pri;?>><?php echo $lang->priAB;?></th>
|
||||
<th><?php echo $lang->bug->product;?></th>
|
||||
<th><?php echo $lang->bug->title;?></th>
|
||||
<th class='c-type'><?php echo $lang->bug->type;?></th>
|
||||
<th class='c-user'><?php echo $lang->openedByAB;?></th>
|
||||
@@ -52,7 +51,6 @@
|
||||
<?php printf('%03d', $bug2Link->id);?>
|
||||
</td>
|
||||
<td><span class='<?php echo 'pri' . zget($lang->bug->priList, $bug2Link->pri, $bug2Link->pri)?>'><?php echo zget($lang->bug->priList, $bug2Link->pri, $bug2Link->pri)?></span></td>
|
||||
<td class='c-name'><?php echo html::a($this->createLink('product', 'browse', "productID={$bug2Link->product}&branch={$bug2Link->branch}"), $products[$bug2Link->product], '_blank');?></td>
|
||||
<td class='c-name' title='<?php echo $bug2Link->title;?>'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug2Link->id"), $bug2Link->title, '_blank');?></td>
|
||||
<td><?php echo zget($lang->bug->typeList, $bug2Link->type);?></td>
|
||||
<td><?php echo zget($users, $bug2Link->openedBy);?></td>
|
||||
@@ -83,7 +81,7 @@ $(function()
|
||||
var output = '';
|
||||
$('#linkBugsForm').find('tr.checked').each(function(){
|
||||
var bugID = $(this).find('td.c-id').find('div.checkbox-primary input').attr('value');
|
||||
var bugTitle = "#" + bugID + ' ' + $(this).find('td').eq(3).attr('title');
|
||||
var bugTitle = "#" + bugID + ' ' + $(this).find('td').eq(2).attr('title');
|
||||
var checkbox = "<li title='" + bugTitle + "'><div class='checkbox-primary'><input type='checkbox' checked='checked' name='linkBug[]' " + "value=" + bugID + " /><label class='linkBugTitle'>" + bugTitle + "</label></div></li>";
|
||||
|
||||
output += checkbox;
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
<?php echo $lang->idAB;?>
|
||||
</th>
|
||||
<th class='c-pri' title=<?php echo $lang->pri;?>><?php echo $lang->priAB;?></th>
|
||||
<th><?php echo $lang->testcase->product;?></th>
|
||||
<th><?php echo $lang->testcase->title;?></th>
|
||||
<th class='c-type'><?php echo $lang->testcase->type;?></th>
|
||||
<th class='c-user'><?php echo $lang->openedByAB;?></th>
|
||||
@@ -52,7 +51,6 @@
|
||||
<?php printf('%03d', $case2Link->id);?>
|
||||
</td>
|
||||
<td><span class='<?php echo 'pri' . zget($lang->testcase->priList, $case2Link->pri, $case2Link->pri)?>'><?php echo zget($lang->testcase->priList, $case2Link->pri, $case2Link->pri)?></span></td>
|
||||
<td class='c-name'><?php echo html::a($this->createLink('product', 'browse', "productID={$case2Link->product}&branch={$case2Link->branch}"), $products[$case2Link->product], '_blank');?></td>
|
||||
<td class='c-name' title='<?php echo $case2Link->title;?>'><?php echo html::a($this->createLink('testcase', 'view', "caseID=$case2Link->id"), $case2Link->title, '_blank');?></td>
|
||||
<td><?php echo $lang->testcase->typeList[$case2Link->type];?></td>
|
||||
<td><?php echo zget($users, $case2Link->openedBy);?></td>
|
||||
@@ -83,7 +81,7 @@ $(function()
|
||||
var output = '';
|
||||
$('#linkCasesForm').find('tr.checked').each(function(){
|
||||
var caseID = $(this).find('td.c-id').find('div.checkbox-primary input').attr('value');
|
||||
var caseTitle = "#" + caseID + ' ' + $(this).find('td').eq(3).attr('title');
|
||||
var caseTitle = "#" + caseID + ' ' + $(this).find('td').eq(2).attr('title');
|
||||
var checkbox = "<li title='" + caseTitle + "'><div class='checkbox-primary'><input type='checkbox' checked='checked' name='linkCase[]' " + "value=" + caseID + " /><label class='linkCaseTitle'>" + caseTitle + "</label></div></li>";
|
||||
|
||||
output += checkbox;
|
||||
|
||||
@@ -26,7 +26,7 @@ $(function()
|
||||
<div class="main-header clearfix">
|
||||
<h2><?php echo $lang->testcase->import;?></h2>
|
||||
</div>
|
||||
<form target='hiddenwin' method='post'>
|
||||
<form class='main-form' target='hiddenwin' method='post'>
|
||||
<div class="table-responsive">
|
||||
<table class='table table-form' id='showData'>
|
||||
<thead>
|
||||
@@ -163,7 +163,7 @@ $(function()
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan='10' class='text-center form-actions'>
|
||||
<td colspan='11' class='text-center form-actions'>
|
||||
<?php
|
||||
$submitText = $isEndPage ? $this->lang->save : $this->lang->file->saveAndNext;
|
||||
if(!$insert and $dataInsert === '')
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
<td><?php echo common::hasPriv('caselib', 'browse') ? html::a($this->createLink('caselib', 'browse', "libID=$case->lib"), $libName) : $libName;?></td>
|
||||
</tr>
|
||||
<?php else:?>
|
||||
<tr>
|
||||
<tr class='<?php if($product->shadow) echo 'hide';?>'>
|
||||
<th class='thWidth'><?php echo $lang->testcase->product;?></th>
|
||||
<td><?php echo (common::hasPriv('product', 'browse') and $productName) ? html::a($this->createLink('product', 'browse', "productID=$case->product"), $productName) : $productName;?></td>
|
||||
</tr>
|
||||
@@ -158,9 +158,11 @@
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->testcase->module;?></th>
|
||||
<th class='thWidth'><?php echo $lang->testcase->module;?></th>
|
||||
<td>
|
||||
<?php
|
||||
$tab = $this->app->tab;
|
||||
|
||||
if(empty($modulePath))
|
||||
{
|
||||
echo "/";
|
||||
@@ -174,7 +176,7 @@
|
||||
|
||||
foreach($modulePath as $key => $module)
|
||||
{
|
||||
if($this->app->tab == 'qa' || $this->app->tab == 'ops' || $this->app->tab == 'product')
|
||||
if($tab == 'qa' || $tab == 'ops' || $tab == 'product')
|
||||
{
|
||||
if($isLibCase)
|
||||
{
|
||||
@@ -185,8 +187,8 @@
|
||||
if(!common::printLink('testcase', 'browse', "productID=$case->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name;
|
||||
}
|
||||
}
|
||||
if($this->app->tab == 'project' and !common::printLink('project', 'testcase', "projectID={$this->session->project}&productID=$case->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name;
|
||||
if($this->app->tab == 'execution') echo $module->name;
|
||||
if($tab == 'project' and !common::printLink('project', 'testcase', "projectID={$this->session->project}&productID=$case->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name;
|
||||
if($tab == 'execution' or $tab == 'product') echo $module->name;
|
||||
if(isset($modulePath[$key + 1])) echo $lang->arrow;
|
||||
}
|
||||
}
|
||||
@@ -199,7 +201,7 @@
|
||||
<td>
|
||||
<?php
|
||||
$class = isonlybody() ? 'showinonlybody' : 'iframe';
|
||||
$param = $this->app->tab == 'project' ? "&version=0&projectID={$this->session->project}" : '';
|
||||
$param = $tab == 'project' ? "&version=0&projectID={$this->session->project}" : '';
|
||||
if(isset($case->storyTitle))
|
||||
{
|
||||
if(common::hasPriv('story', 'view'))
|
||||
@@ -261,7 +263,7 @@
|
||||
{
|
||||
echo "(<span class='warning' title={$lang->testcase->fromCaselib}>{$lang->testcase->changed}</span> ";
|
||||
if(common::hasPriv('testcase', 'confirmLibcaseChange')) echo html::a($this->createLink('testcase', 'confirmLibcaseChange', "caseID=$case->id&libcaseID=$case->fromCaseID"), $lang->testcase->sync, 'hiddenwin', "class='btn btn-mini btn-info'");
|
||||
if(common::hasPriv('testcase', 'ignoreLibcaseChange')) echo html::a($this->createLink('testcase', 'ignoreLibcaseChange', "caseID=$case->id"), $lang->testcase->ignore, 'hiddenwin', "class='btn btn-mini btn-info'");
|
||||
if(common::hasPriv('testcase', 'ignoreLibcaseChange')) echo html::a($this->createLink('testcase', 'ignoreLibcaseChange', "caseID=$case->id"), $lang->testcase->ignore, 'hiddenwin', "class='btn btn-mini btn-info'");
|
||||
echo ")";
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../testcase/view/caseheader.html.php';?>
|
||||
<?php js::set('resetActive', false);?>
|
||||
<?php js::set('tab', $app->tab);?>
|
||||
<div id='mainContent' class='main-control'>
|
||||
<?php if(empty($stories)):?>
|
||||
<div class="table-empty-tip">
|
||||
@@ -139,7 +140,8 @@
|
||||
|
||||
if(common::hasPriv('story', 'batchChangeStage'))
|
||||
{
|
||||
echo "<div class='btn-group dropup'>";
|
||||
$class = count($stories) <= 3 ? 'dropdown' : 'dropup';
|
||||
echo "<div class='btn-group $class'>";
|
||||
echo html::commonButton($lang->story->stageAB . "<span class='caret'></span>", "data-toggle='dropdown'");
|
||||
echo "<ul class='dropdown-menu'>";
|
||||
$lang->story->stageList[''] = $lang->null;
|
||||
|
||||
Reference in New Issue
Block a user