diff --git a/module/testtask/config/table.php b/module/testtask/config/table.php index a67596cf37..27b853c31b 100644 --- a/module/testtask/config/table.php +++ b/module/testtask/config/table.php @@ -14,27 +14,33 @@ $config->testtask->dtable->fieldList['title']['fixed'] = 'left'; $config->testtask->dtable->fieldList['build']['name'] = 'buildName'; $config->testtask->dtable->fieldList['build']['title'] = $lang->testtask->build; $config->testtask->dtable->fieldList['build']['type'] = 'text'; +$config->testtask->dtable->fieldList['build']['group'] = 'text'; $config->testtask->dtable->fieldList['product']['name'] = 'productName'; $config->testtask->dtable->fieldList['product']['title'] = $lang->testtask->product; $config->testtask->dtable->fieldList['product']['type'] = 'text'; +$config->testtask->dtable->fieldList['product']['group'] = 'text'; $config->testtask->dtable->fieldList['execution']['name'] = 'executionName'; $config->testtask->dtable->fieldList['execution']['title'] = $lang->testtask->execution; $config->testtask->dtable->fieldList['execution']['type'] = 'text'; +$config->testtask->dtable->fieldList['execution']['group'] = 'text'; $config->testtask->dtable->fieldList['owner']['name'] = 'owner'; $config->testtask->dtable->fieldList['owner']['title'] = $lang->testtask->owner; $config->testtask->dtable->fieldList['owner']['type'] = 'user'; +$config->testtask->dtable->fieldList['owner']['group'] = 'user'; $config->testtask->dtable->fieldList['owner']['userMap'] = array(); $config->testtask->dtable->fieldList['begin']['name'] = 'begin'; $config->testtask->dtable->fieldList['begin']['title'] = $lang->testtask->begin; $config->testtask->dtable->fieldList['begin']['type'] = 'date'; +$config->testtask->dtable->fieldList['begin']['group'] = 'user'; $config->testtask->dtable->fieldList['end']['name'] = 'end'; $config->testtask->dtable->fieldList['end']['title'] = $lang->testtask->end; $config->testtask->dtable->fieldList['end']['type'] = 'date'; +$config->testtask->dtable->fieldList['end']['group'] = 'user'; $config->testtask->dtable->fieldList['status']['name'] = 'status'; $config->testtask->dtable->fieldList['status']['title'] = $lang->testtask->status; diff --git a/module/testtask/js/browse.ui.js b/module/testtask/js/browse.ui.js new file mode 100644 index 0000000000..7641b7ca0d --- /dev/null +++ b/module/testtask/js/browse.ui.js @@ -0,0 +1,7 @@ +$(document).on('change', '#begin,#end', function() +{ + const begin = $('#begin').val().replaceAll('-', ''); + const end = $('#end').val().replaceAll('-', ''); + const params = condition + '&beginTime=' + begin + '&endTime=' + end; + loadPage($.createLink('testtask', 'browse', params), '#mainContent'); +}); diff --git a/module/testtask/ui/browse.html.php b/module/testtask/ui/browse.html.php index da5d7a737b..84b1b430f0 100644 --- a/module/testtask/ui/browse.html.php +++ b/module/testtask/ui/browse.html.php @@ -9,6 +9,10 @@ declare(strict_types=1); * @link https://www.zentao.net */ namespace zin; +$scope = $this->session->testTaskVersionScope; +$status = $this->session->testTaskVersionStatus; +$viewName = $scope == 'local'? $productName : $lang->testtask->all; +jsVar('condition', "productID=$productID&branch=$branch&type=$scope,$status&orderBy=$orderBy&recTotal=0&recPerPage={$pager->recPerPage}&pageID=1"); $this->testtask->buildOperateMenu(null, 'browse'); foreach($tasks as $task) @@ -23,18 +27,46 @@ foreach($tasks as $task) } $config->testtask->dtable->fieldList['owner']['userMap'] = $users; - -$cols = array_values($config->testtask->dtable->fieldList); -$data = array_values($tasks); - -$scope = $this->session->testTaskVersionScope; -$status = $this->session->testTaskVersionStatus; +$productDropdown = dropdown +( + to('trigger', btn($viewName)), + to('menu', menu + ( + set::class('dropdown-menu'), + set::items + ([ + ['text' => $lang->testtask->all, 'url' => helper::createLink('testtask', 'browse', "productID=$productID&branch=0&type=all,$status")], + ['text' => $productName, 'url' => helper::createLink('testtask', 'browse', "productID=$productID&branch=$branch&type=local,$status")], + ]) + ) + ), +); featureBar ( set::current($status), - set::linkParams("productID={$productID}&branch=$branch&type={$scope},{key}") + set::linkParams("productID={$productID}&branch=$branch&type={$scope},{key}"), + to::before($productDropdown), + inputGroup + ( + $lang->testtask->beginAndEnd, + input + ( + set::name('begin'), + set::type('date'), + set::value($beginTime), + ), + $lang->testtask->to, + input + ( + set::name('end'), + set::type('date'), + set::value($endTime), + ) + ) ); +$cols = array_values($config->testtask->dtable->fieldList); +$data = array_values($tasks); toolbar ( btngroup