From a8110589a41574bd6fbc90bd74ecb3b274c7636c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 7 Apr 2017 10:10:24 +0800 Subject: [PATCH] * adjust for web and fix bugs. --- module/index/control.php | 1 - module/product/control.php | 2 +- module/qa/control.php | 2 +- module/report/model.php | 15 +++++++++------ module/testcase/view/caseheader.html.php | 2 ++ module/testtask/control.php | 3 +++ module/testtask/model.php | 1 + module/testtask/view/view.html.php | 6 ++++++ module/tree/control.php | 7 +++++++ 9 files changed, 30 insertions(+), 9 deletions(-) diff --git a/module/index/control.php b/module/index/control.php index 3f47bd2f86..a48e7c0ced 100644 --- a/module/index/control.php +++ b/module/index/control.php @@ -32,7 +32,6 @@ class index extends control */ public function index() { - if($this->app->getViewType() == 'mhtml') $this->locate($this->createLink($this->config->locate->module, $this->config->locate->method, $this->config->locate->params)); $this->locate($this->createLink('my', 'index')); } diff --git a/module/product/control.php b/module/product/control.php index 43c9f2a44b..117c0b3346 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -63,7 +63,7 @@ class product extends control if($locate == 'yes') $this->locate($this->createLink($this->moduleName, 'browse')); - unset($this->lang->product->menu->index); + if($this->app->getViewType() != 'mhtml') unset($this->lang->product->menu->index); $productID = $this->product->saveState($productID, $this->products); $branch = (int)$this->cookie->preBranch; $this->product->setMenu($this->products, $productID, $branch); diff --git a/module/qa/control.php b/module/qa/control.php index e9e873414f..1b72f5471a 100644 --- a/module/qa/control.php +++ b/module/qa/control.php @@ -35,7 +35,7 @@ class qa extends control if($homepage == 'browse' and $locate == 'auto') $locate = 'yes'; if($locate == 'yes') $this->locate($this->createLink('bug', 'browse')); - unset($this->lang->qa->menu->index); + if($this->app->viewType != 'mhtml') unset($this->lang->qa->menu->index); $productID = $this->product->saveState($productID, $this->products); $branch = (int)$this->cookie->preBranch; $this->qa->setMenu($this->products, $productID, $branch); diff --git a/module/report/model.php b/module/report/model.php index 8509c23cde..c876eef398 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -188,14 +188,17 @@ class reportModel extends model foreach($unplannedStories as $story) { $product = $story->product; - if(!isset($products[$product]->plans[0])) + if(isset($products[$product])) { - $products[$product]->plans[0] = new stdClass(); - $products[$product]->plans[0]->title = $this->lang->report->unplanned; - $products[$product]->plans[0]->begin = ''; - $products[$product]->plans[0]->end = ''; + if(!isset($products[$product]->plans[0])) + { + $products[$product]->plans[0] = new stdClass(); + $products[$product]->plans[0]->title = $this->lang->report->unplanned; + $products[$product]->plans[0]->begin = ''; + $products[$product]->plans[0]->end = ''; + } + $products[$product]->plans[0]->status[$story->status] = isset($products[$product]->plans[0]->status[$story->status]) ? $products[$product]->plans[0]->status[$story->status] + 1 : 1; } - $products[$product]->plans[0]->status[$story->status] = isset($products[$product]->plans[0]->status[$story->status]) ? $products[$product]->plans[0]->status[$story->status] + 1 : 1; } unset($products['']); diff --git a/module/testcase/view/caseheader.html.php b/module/testcase/view/caseheader.html.php index 056259f063..47e888e2a5 100644 --- a/module/testcase/view/caseheader.html.php +++ b/module/testcase/view/caseheader.html.php @@ -49,6 +49,7 @@ echo ''; echo html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySuite¶m=$suiteID"), $suiteName); + echo ""; } echo ''; @@ -68,6 +69,7 @@ if($key == '') continue; echo ''; echo html::a($this->createLink('testcase', 'groupCase', "productID=$productID&branch=$branch&groupBy=$key"), $value); + echo ""; } echo ''; diff --git a/module/testtask/control.php b/module/testtask/control.php index aeecbb87ab..385d18573e 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -263,6 +263,9 @@ class testtask extends control $this->config->testcase->search['module'] = 'testtask'; $this->config->testcase->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct); $this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case'); + + $this->config->testcase->search['fields']['assignedTo'] = $this->lang->testtask->assignedTo; + $this->config->testcase->search['params']['assignedTo'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); $this->config->testcase->search['actionURL'] = inlink('cases', "taskID=$taskID&browseType=bySearch&queryID=myQueryID"); if(!$this->config->testcase->needReview) unset($this->config->testcase->search['params']['status']['values']['wait']); unset($this->config->testcase->search['fields']['branch']); diff --git a/module/testtask/model.php b/module/testtask/model.php index 29e02facee..3270784c30 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -710,6 +710,7 @@ class testtaskModel extends model } $caseQuery = preg_replace('/`(\w+)`/', 't2.`$1`', $caseQuery); + $caseQuery = str_replace(array('t2.`assignedTo`', 't2.`lastRunner`', 't2.`lastRunDate`', 't2.`lastRunResult`'), array('t1.`assignedTo`', 't1.`lastRunner`', 't1.`lastRunDate`', 't1.`lastRunResult`'), $caseQuery); $runs = $this->dao->select('t2.*,t1.*, t2.version as caseVersion')->from(TABLE_TESTRUN)->alias('t1') ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id') ->where($caseQuery) diff --git a/module/testtask/view/view.html.php b/module/testtask/view/view.html.php index 206bac0a63..9caaa94220 100644 --- a/module/testtask/view/view.html.php +++ b/module/testtask/view/view.html.php @@ -60,6 +60,12 @@ testtask->legendDesc;?>
desc;?>
+ report):?> +
+ testtask->legendReport;?> +
report;?>
+
+
diff --git a/module/tree/control.php b/module/tree/control.php index c81df458a0..d7d8dced25 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -337,6 +337,13 @@ class tree extends control } die($output); } + if($returnType == 'mhtml') + { + $changeFunc = ''; + if($viewType == 'task' or $viewType == 'bug' or $viewType == 'case') $changeFunc = "onchange='loadModuleRelated()'"; + $output = html::select("module", $optionMenu, '', "class='input' $changeFunc"); + die($output); + } if($returnType == 'json') die(json_encode($optionMenu)); }