- |
+ |
project->productStories, inlink('linkStory', "project={$project->id}"));
diff --git a/module/report/control.php b/module/report/control.php
index 819b34bf2f..b73e895cab 100644
--- a/module/report/control.php
+++ b/module/report/control.php
@@ -128,7 +128,7 @@ class report extends control
$this->app->loadConfig('project');
$begin = $begin ? strtotime($begin) : time();
$end = $end ? strtotime($end) : time() + (7 * 24 * 3600);
- $end += 24 * 2600;
+ $end += 24 * 3600;
$beginWeekDay = date('w', $begin);
$begin = date('Y-m-d', $begin);
$end = date('Y-m-d', $end);
diff --git a/module/sso/control.php b/module/sso/control.php
index 06469f98b7..e577a8c83c 100644
--- a/module/sso/control.php
+++ b/module/sso/control.php
@@ -128,7 +128,7 @@ class sso extends control
*/
public function ajaxSetConfig()
{
- if(strpos($this->app->company->admins, $this->app->user->account) === false) die('deny');
+ if(!$this->app->user->admin) die('deny');
if($_POST)
{
diff --git a/module/testcase/config.php b/module/testcase/config.php
index 8de53999a5..8a4c99efa3 100644
--- a/module/testcase/config.php
+++ b/module/testcase/config.php
@@ -25,7 +25,7 @@ $config->testcase->exportFields = '
$config->testcase->customCreateFields = 'story,stage,pri,keywords';
$config->testcase->customBatchCreateFields = 'module,stage,story,pri,precondition,keywords';
-$config->testcase->customBatchEditFields = 'module,stage,precondition,status,pri,keywords';
+$config->testcase->customBatchEditFields = 'module,story,stage,precondition,status,pri,keywords';
$config->testcase->custom = new stdclass();
$config->testcase->custom->createFields = $config->testcase->customCreateFields;
diff --git a/module/testcase/control.php b/module/testcase/control.php
index 2e3210042a..8c20cfd08b 100644
--- a/module/testcase/control.php
+++ b/module/testcase/control.php
@@ -119,7 +119,7 @@ class testcase extends control
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule, $linkedLibs) : array();
$moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createCaseLink'), '', $branch);
- $libModuleTree = $this->tree->getTestLibTreeInCase('case', $productID, array('treeModel', 'createCaseLink'));
+ $libModuleTree = $this->tree->getCaseLibTreeInCase('case', $productID, array('treeModel', 'createCaseLink'));
if($libModuleTree) $moduleTree = substr($moduleTree, 0, strrpos($moduleTree, '')) . $libModuleTree . '';
/* Assign. */
@@ -190,6 +190,7 @@ class testcase extends control
$this->view->users = $this->user->getPairs('noletter');
$this->view->browseType = 'group';
$this->view->groupBy = $groupBy;
+ $this->view->orderBy = $groupBy;
$this->view->groupByList = $groupByList;
$this->view->cases = $groupCases;
$this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID);
@@ -620,7 +621,7 @@ class testcase extends control
$this->view->libID = $case->lib;
$this->view->libName = $libraries[$case->lib];
$this->view->libraries = $libraries;
- $this->view->moduleOptionMenu = $this->tree->getOptionMenu($case->lib, $viewType = 'testlib', $startModuleID = 0);
+ $this->view->moduleOptionMenu = $this->tree->getOptionMenu($case->lib, $viewType = 'caselib', $startModuleID = 0);
}
else
{
@@ -635,7 +636,7 @@ class testcase extends control
if($case->lib and $case->fromLib)
{
$libName = $this->loadModel('testsuite')->getById($case->lib)->name;
- $libModules = $this->tree->getOptionMenu($case->lib, 'testlib');
+ $libModules = $this->tree->getOptionMenu($case->lib, 'caselib');
foreach($libModules as $moduleID => $moduleName)
{
if($moduleID == 0) continue;
@@ -693,7 +694,7 @@ class testcase extends control
$caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList));
/* Get the edited cases. */
- $cases = $this->dao->select('*')->from(TABLE_CASE)->where('id')->in($caseIDList)->fetchAll('id');
+ $cases = $this->testcase->getByList($caseIDList);
/* The cases of a product. */
if($productID)
@@ -706,7 +707,7 @@ class testcase extends control
$this->lang->testcase->menu = $this->lang->testsuite->menu;
/* Set modules. */
- $modules = $this->tree->getOptionMenu($libID, $viewType = 'testlib', $startModuleID = 0, $branch);
+ $modules = $this->tree->getOptionMenu($libID, $viewType = 'caselib', $startModuleID = 0, $branch);
$modules = array('ditto' => $this->lang->testcase->ditto) + $modules;
$this->view->modules = $modules;
@@ -744,8 +745,29 @@ class testcase extends control
$this->loadModel('my')->setMenu();
$this->view->position[] = html::a($this->server->http_referer, $this->lang->my->testCase);
$this->view->title = $this->lang->testcase->batchEdit;
+
+ /* Set modules. */
+ $productIdList = array();
+ $libs = array();
+ $existModules = array();
+ foreach($cases as $case)
+ {
+ if($case->lib and $case->fromLib) $libs[$case->lib] = $case->lib;
+ $productIdList[$case->product] = $case->product;
+ $existModules[$case->module] = $case->module;
+ }
+
+ $products = $this->product->getByIdList($productIdList);
+ $modules = array();
+ foreach($products as $product)
+ {
+ $productModules = $this->tree->getOptionMenu($product->id, $viewType = 'case', $startModuleID = 0);
+ foreach($productModules as $moduleID => $moduleName) $modules[$moduleID] = '/' . $product->name . $moduleName;
+ }
+ if($libs) $modules += $this->tree->getExistLibModules($libs, $existModules);
+ $this->view->modules = array('ditto' => $this->lang->testcase->ditto) + $modules;
}
-
+
if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']);
/* Judge whether the editedTasks is too large and set session. */
$showSuhosinInfo = false;
@@ -754,7 +776,7 @@ class testcase extends control
if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? $this->lang->suhosinInfo : $this->lang->maxVarsInfo;
$this->loadModel('story');
- $this->view->stories = $this->story->getProductStoryPairs($productID, $case->branch);
+ $this->view->stories = $this->story->getProductStoryPairs($productID, $branch);
/* Set custom. */
foreach(explode(',', $this->config->testcase->customBatchEditFields) as $field) $customFields[$field] = $this->lang->testcase->$field;
@@ -1536,7 +1558,7 @@ class testcase extends control
$modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, $branch);
$libName = $libraries[$libID];
- $libModules = $this->tree->getOptionMenu($libID, 'testlib');
+ $libModules = $this->tree->getOptionMenu($libID, 'caselib');
foreach($libModules as $moduleID => $moduleName)
{
if($moduleID == 0) continue;
diff --git a/module/testcase/css/batchedit.css b/module/testcase/css/batchedit.css
index df6b376c7a..4c4be58690 100644
--- a/module/testcase/css/batchedit.css
+++ b/module/testcase/css/batchedit.css
@@ -1,3 +1,4 @@
.w-340px {width:340px}
.chosen {z-index:99}
.chosen-container[id^="module"] .chosen-drop {min-width: 400px; border-top: 1px solid #ddd!important}
+.chosen-container[id^="stories"] .chosen-drop {min-width: 400px; border-top: 1px solid #ddd!important}
diff --git a/module/testcase/css/report.css b/module/testcase/css/report.css
new file mode 100644
index 0000000000..83f749b531
--- /dev/null
+++ b/module/testcase/css/report.css
@@ -0,0 +1,3 @@
+.table-bordered caption {border: 1px solid #ddd;}
+.table-bordered tr > th:first-child, .table-bordered tr > td:first-child {border-left: 1px solid #ddd!important}
+.table-bordered tr > th:last-child, .table-bordered tr > td:last-child {border-right: 1px solid #ddd!important}
diff --git a/module/testcase/css/view.css b/module/testcase/css/view.css
index 45e75cea5a..9371ee4e3e 100644
--- a/module/testcase/css/view.css
+++ b/module/testcase/css/view.css
@@ -1 +1,5 @@
#steps {margin-bottom: 15px}
+.outer .col-side{transition: all 0.1s;position: relative;}
+.outer.hide-side .col-side{width:0px;}
+.outer .col-side .side-handle{right:0px;top:10px;}
+.outer.hide-side .main-side{display:none;}
diff --git a/module/testcase/js/edit.js b/module/testcase/js/edit.js
index 25970fb19a..602030e67c 100644
--- a/module/testcase/js/edit.js
+++ b/module/testcase/js/edit.js
@@ -53,7 +53,7 @@ function loadLinkCases(caseID)
function loadLibModules(libID)
{
- link = createLink('tree', 'ajaxGetOptionMenu', 'libID=' + libID + '&viewtype=testlib&branch=0&rootModuleID=0&returnType=html&needManage=true');
+ link = createLink('tree', 'ajaxGetOptionMenu', 'libID=' + libID + '&viewtype=caselib&branch=0&rootModuleID=0&returnType=html&needManage=true');
$('#moduleIdBox').load(link, function()
{
$(this).find('select').chosen(defaultChosenOptions)
diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php
index 66cd242575..6c5f269115 100644
--- a/module/testcase/lang/zh-cn.php
+++ b/module/testcase/lang/zh-cn.php
@@ -147,7 +147,7 @@ $lang->testcase->stageList['bvt'] = '版本验证阶段';
$lang->testcase->reviewResultList[''] = '';
$lang->testcase->reviewResultList['pass'] = '确认通过';
-$lang->testcase->reviewResultList['clarify'] = '有待明确';
+$lang->testcase->reviewResultList['clarify'] = '继续完善';
$lang->testcase->groups[''] = '分组查看';
$lang->testcase->groups['story'] = '需求分组';
diff --git a/module/testcase/model.php b/module/testcase/model.php
index 7f3334febc..c7d9fb47ce 100644
--- a/module/testcase/model.php
+++ b/module/testcase/model.php
@@ -382,7 +382,7 @@ class testcaseModel extends model
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($caseQuery)
->beginIF($queryProductID != 'all')->andWhere('product')->eq($productID)->fi()
->andWhere('deleted')->eq(0)
- ->orderBy($orderBy)->page($pager)->fetchAll();
+ ->orderBy($orderBy)->page($pager)->fetchAll('id');
return $cases;
}
@@ -401,7 +401,7 @@ class testcaseModel extends model
return $this->dao->select('t1.assignedTo AS assignedTo, t2.*')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->leftJoin(TABLE_TESTTASK)->alias('t3')->on('t1.task = t3.id')
- ->Where('t1.assignedTo')->eq($account)
+ ->where('t1.assignedTo')->eq($account)
->andWhere('t1.status')->ne('done')
->andWhere('t3.status')->ne('done')
->andWhere('t3.deleted')->eq(0)
@@ -421,6 +421,7 @@ class testcaseModel extends model
public function getByOpenedBy($account, $orderBy = 'id_desc', $pager = null)
{
return $this->dao->findByOpenedBy($account)->from(TABLE_CASE)
+ ->andWhere('product')->ne(0)
->andWhere('deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll();
}
@@ -720,6 +721,7 @@ class testcaseModel extends model
if($data->pris[$caseID] == 'ditto') $data->pris[$caseID] = isset($prev['pri']) ? $prev['pri'] : 3;
if($data->modules[$caseID] == 'ditto') $data->modules[$caseID] = isset($prev['module']) ? $prev['module'] : 0;
if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : '';
+ if($data->stories[$caseID] == '') $data->stories[$caseID] = 0;
$prev['pri'] = $data->pris[$caseID];
$prev['module'] = $data->modules[$caseID];
@@ -1264,7 +1266,7 @@ class testcaseModel extends model
{
$caseBugs = $this->dao->select('count(*) as count, `case`')->from(TABLE_BUG)->where('`case`')->in($caseIdList)->andWhere('deleted')->eq(0)->groupBy('`case`')->fetchPairs('case', 'count');
$results = $this->dao->select('count(*) as count, `case`')->from(TABLE_TESTRESULT)->where('`case`')->in($caseIdList)->groupBy('`case`')->fetchPairs('case', 'count');
- $caseFailCount = $this->dao->select('`case` AS name, COUNT(*) AS value')->from(TABLE_TESTRESULT)->where('caseResult')->eq('fail')->andwhere('`case`')->in($caseIdList)->groupBy('name')->orderBy('value DESC')->fetchAll('name');
+ $caseFailCount = $this->dao->select('`case` AS name, COUNT(*) AS value')->from(TABLE_TESTRESULT)->where('caseResult')->eq('fail')->andwhere('`case`')->in($caseIdList)->groupBy('name')->orderBy('value DESC')->fetchPairs('name','value');
$stepNumber = $this->dao->select('count(distinct t1.id) as count, t1.`case`')->from(TABLE_CASESTEP)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.`case`=t2.`id`')
->where('t1.`case`')->in($caseIdList)
@@ -1284,13 +1286,13 @@ class testcaseModel extends model
->fetchPairs('case', 'count');
}
- foreach($cases as $case)
+ foreach($cases as $key => $case)
{
$caseID = $type == 'case' ? $case->id : $case->case;
- $case->bugs = isset($caseBugs[$caseID]) ? $caseBugs[$caseID] : 0;
- $case->results = isset($results[$caseID]) ? $results[$caseID] : 0;
- $case->caseFailCount = isset($results[$caseID]) ? $caseFailCount[$caseID]->value : 0;
- $case->stepNumber = isset($stepNumber[$caseID]) ? $stepNumber[$caseID] : 0;
+ $case->bugs = isset($caseBugs[$caseID]) ? $caseBugs[$caseID] : 0;
+ $case->results = isset($results[$caseID]) ? $results[$caseID] : 0;
+ $case->caseFailCount = isset($caseFailCount[$caseID])? $caseFailCount[$caseID] : 0;
+ $case->stepNumber = isset($stepNumber[$caseID]) ? $stepNumber[$caseID] : 0;
}
return $cases;
diff --git a/module/testcase/view/batchedit.html.php b/module/testcase/view/batchedit.html.php
index 01e8dd07bb..f3fa234c67 100644
--- a/module/testcase/view/batchedit.html.php
+++ b/module/testcase/view/batchedit.html.php
@@ -36,7 +36,7 @@ foreach(explode(',', $showFields) as $field)
'> priAB;?> |
'>statusAB;?> |
'>testcase->module;?> |
- testcase->story;?> |
+ '>testcase->story;?> |
testcase->title;?> |
testcase->type;?> |
'> testcase->precondition;?> |
diff --git a/module/testcase/view/createbug.html.php b/module/testcase/view/createbug.html.php
index bb5433aa15..dce1e2c1e6 100644
--- a/module/testcase/view/createbug.html.php
+++ b/module/testcase/view/createbug.html.php
@@ -11,7 +11,7 @@
*/
?>
-
@@ -29,6 +29,17 @@ $(function()
$this.find('.collapse-handle').toggleClass('icon-chevron-down', !show).toggleClass('icon-chevron-up', show);;
});
+ $(".step-group input[type='checkbox']").click(function()
+ {
+ var $next = $(this).closest('tr').next();
+ while($next.length && $next.hasClass('step-item'))
+ {
+ var isChecked = $(this).prop('checked');
+ $next.find("input[type='checkbox']").prop('checked', isChecked);
+ $next = $next.next();
+ }
+ });
+
$('#casesResults table caption .result-tip').html($('#resultTip').html());
$('tr').remove('#result-success');
diff --git a/module/testcase/view/importlib.html.php b/module/testcase/view/importlib.html.php
index 1aa64836d1..e07cad654b 100644
--- a/module/testcase/view/importlib.html.php
+++ b/module/testcase/view/importlib.html.php
@@ -17,7 +17,7 @@
icons['import']);?> testcase->importFromLib;?>
testcase->selectLib;?>
-
+
diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php
index 5ef1a1ff58..a554d9365d 100644
--- a/module/testcase/view/view.html.php
+++ b/module/testcase/view/view.html.php
@@ -48,7 +48,7 @@
common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$case->id&version=$case->currentVersion", '', 'button', '', '', 'runCase', false, "data-width='95%'");
common::printIcon('testtask', 'results', "runID=$runID&caseID=$case->id&version=$case->version", '', 'button', '', '', 'results', false, "data-width='95%'");
- if($caseFailCount > 0) common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", '', 'button', 'bug', '', 'iframe');
+ if($caseFailCount > 0) common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", '', 'button', 'bug', '', 'iframe', '', "data-width='90%'");
}
if($config->testcase->needReview) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'button', 'review', '', 'iframe');
echo '';
@@ -127,6 +127,7 @@
+
|