diff --git a/config/filter.php b/config/filter.php index 868577e010..99e4c601cd 100644 --- a/config/filter.php +++ b/config/filter.php @@ -158,7 +158,6 @@ $filter->todo->export->cookie['checkedItem'] = 'reg::checked'; $filter->user->login->cookie['keepLogin'] = 'equal::on'; - $filter->block->default->get['hash'] = 'reg::md5'; $filter->block->main->get['blockid'] = 'code'; $filter->block->main->get['blockTitle'] = 'reg::any'; diff --git a/module/testtask/control.php b/module/testtask/control.php index fd600f5313..2859cf64c0 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -39,18 +39,18 @@ class testtask extends control } /** - * Browse test tasks. - * - * @param int $productID - * @param string $type - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID + * Browse test tasks. + * + * @param int $productID + * @param string $type + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ - public function browse($productID = 0, $branch = '', $type = 'local,wait', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function browse($productID = 0, $branch = '', $type = 'local,wait', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $beginTime = 0, $endTime = 0) { /* Save session. */ $this->session->set('testtaskList', $this->app->getURI(true)); @@ -59,6 +59,9 @@ class testtask extends control $this->session->set('testTaskVersionScope', $scopeAndStatus[0]); $this->session->set('testTaskVersionStatus', $scopeAndStatus[1]); + $beginTime = $beginTime ? date('Y-m-d', strtotime($beginTime)) : ''; + $endTime = $endTime ? date('Y-m-d', strtotime($endTime)) : ''; + /* Set menu. */ $productID = $this->product->saveState($productID, $this->products); if($branch === '') $branch = (int)$this->cookie->preBranch; @@ -77,10 +80,12 @@ class testtask extends control $this->view->productID = $productID; $this->view->productName = $this->products[$productID]; $this->view->orderBy = $orderBy; - $this->view->tasks = $this->testtask->getProductTasks($productID, $branch, $sort, $pager, $scopeAndStatus); + $this->view->tasks = $this->testtask->getProductTasks($productID, $branch, $sort, $pager, $scopeAndStatus, $beginTime, $endTime); $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); $this->view->pager = $pager; $this->view->branch = $branch; + $this->view->beginTime = $beginTime; + $this->view->endTime = $endTime; $this->display(); } diff --git a/module/testtask/js/browse.js b/module/testtask/js/browse.js index a83e3be0cb..cb53ac254d 100644 --- a/module/testtask/js/browse.js +++ b/module/testtask/js/browse.js @@ -6,3 +6,29 @@ $(document).ready(function() $('#modulemenu > .nav > li[data-id=' + status + ']').addClass('active'); } }); + +function changeDate(begin, end, condition) +{ + if(begin.indexOf('-') != -1) + { + var beginarray = begin.split("-"); + var begin = ''; + for(i=0 ; i < beginarray.length ; i++) + { + begin = begin + beginarray[i]; + } + } + if(end.indexOf('-') != -1) + { + var endarray = end.split("-"); + var end = ''; + for(i=0 ; i < endarray.length ; i++) + { + end = end + endarray[i]; + } + } + + condition = condition + '&beginTime=' + begin + '&endTime=' + end; + link = createLink('testtask', 'browse', condition); + location.href=link; +} diff --git a/module/testtask/lang/en.php b/module/testtask/lang/en.php index 7c5f2d630c..1ea4461b91 100644 --- a/module/testtask/lang/en.php +++ b/module/testtask/lang/en.php @@ -69,6 +69,9 @@ $lang->testtask->lastRunner = 'Last Runner'; $lang->testtask->lastRunDate = 'Last RunDate'; $lang->testtask->date = 'Date'; +$lang->testtask->beginAndEnd = 'Date'; +$lang->testtask->to = 'To'; + $lang->testtask->legendDesc = 'Desc'; $lang->testtask->legendReport = 'Report'; $lang->testtask->legendBasicInfo = 'Basic Info'; diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php index a48b65fced..956a6e97d4 100644 --- a/module/testtask/lang/zh-cn.php +++ b/module/testtask/lang/zh-cn.php @@ -69,6 +69,9 @@ $lang->testtask->lastRunner = '最后执行人'; $lang->testtask->lastRunDate = '最后执行时间'; $lang->testtask->date = '测试时间'; +$lang->testtask->beginAndEnd = '起止时间'; +$lang->testtask->to = '至'; + $lang->testtask->legendDesc = '版本描述'; $lang->testtask->legendReport = '测试总结'; $lang->testtask->legendBasicInfo = '基本信息'; diff --git a/module/testtask/lang/zh-tw.php b/module/testtask/lang/zh-tw.php index 148e8f68ce..542cb14a2c 100644 --- a/module/testtask/lang/zh-tw.php +++ b/module/testtask/lang/zh-tw.php @@ -69,6 +69,9 @@ $lang->testtask->lastRunner = '最後執行人'; $lang->testtask->lastRunDate = '最後執行時間'; $lang->testtask->date = '測試時間'; +$lang->testtask->beginAndEnd = '起止時間'; +$lang->testtask->to = '至'; + $lang->testtask->legendDesc = '版本描述'; $lang->testtask->legendReport = '測試總結'; $lang->testtask->legendBasicInfo = '基本信息'; diff --git a/module/testtask/model.php b/module/testtask/model.php index a94bab9b27..104de76185 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -97,7 +97,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getProductTasks($productID, $branch = 0, $orderBy = 'id_desc', $pager = null, $scopeAndStatus = array()) + public function getProductTasks($productID, $branch = 0, $orderBy = 'id_desc', $pager = null, $scopeAndStatus = array(), $beginTime = 0, $endTime = 0) { if($this->config->global->flow == 'onlyTest') { @@ -128,6 +128,8 @@ class testtaskModel extends model ->beginIF($scopeAndStatus[1] == 'totalStatus')->andWhere('t1.status')->in(array('blocked','doing','wait','done'))->fi() ->beginIF($scopeAndStatus[1] != 'totalStatus')->andWhere('t1.status')->eq($scopeAndStatus[1])->fi() ->beginIF($branch)->andWhere("if(t4.branch, t4.branch, t5.branch) = '$branch'")->fi() + ->beginIF($beginTime)->andWhere('t1.begin')->ge($beginTime)->fi() + ->beginIF($endTime)->andWhere('t1.end')->le($endTime)->fi() ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); diff --git a/module/testtask/view/browse.html.php b/module/testtask/view/browse.html.php index 42e9065a20..0bdeeb7a3f 100644 --- a/module/testtask/view/browse.html.php +++ b/module/testtask/view/browse.html.php @@ -11,10 +11,11 @@ */ ?> + testtask->confirmDelete)?> config->global->flow);?> -session->testTaskVersionScope; +session->testTaskVersionScope; $status = $this->session->testTaskVersionStatus; ?> @@ -26,21 +27,28 @@ $status = $this->session->testTaskVersionStatus; testtask->all;?> -
  • testtask->wait);?>
  • testtask->testing);?>
  • testtask->blocked);?>
  • testtask->done);?>
  • testtask->totalStatus);?>
  • +
  • + recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID"?> +
    + testtask->beginAndEnd;?> +
    + testtask->to;?> +
    +
    +
  • -