* Finish task #3222.
This commit is contained in:
@@ -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';
|
||||
|
||||
+15
-10
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 = '基本信息';
|
||||
|
||||
@@ -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 = '基本信息';
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/datepicker.html.php';?>
|
||||
<?php js::set('confirmDelete', $lang->testtask->confirmDelete)?>
|
||||
<?php js::set('flow', $this->config->global->flow);?>
|
||||
<?php
|
||||
$scope = $this->session->testTaskVersionScope;
|
||||
<?php
|
||||
$scope = $this->session->testTaskVersionScope;
|
||||
$status = $this->session->testTaskVersionStatus;
|
||||
?>
|
||||
<?php js::set('status', $status);?>
|
||||
@@ -26,21 +27,28 @@ $status = $this->session->testTaskVersionStatus;
|
||||
<?php $viewName = $scope == 'local'? $productName : $lang->testtask->all;?>
|
||||
<button class='btn btn-primary btn-sm' type='button' data-toggle='dropdown'><?php echo $viewName;?> <span class='caret'></span></button>
|
||||
<ul class='dropdown-menu' style='max-height:240px;overflow-y:auto'>
|
||||
<?php
|
||||
<?php
|
||||
echo "<li>" . html::a(inlink('browse', "productID=$productID&branch=0&type=all,$status"), $lang->testtask->all) . "</li>";
|
||||
echo "<li>" . html::a(inlink('browse', "productID=$productID&branch=$branch&type=local,$status"), $productName) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li id='waitTab'><?php echo html::a(inlink('browse', "productID=$productID&branch=$branch&type=$scope,wait"), $lang->testtask->wait);?></li>
|
||||
<li id='doingTab'><?php echo html::a(inlink('browse', "productID=$productID&branch=$branch&type=$scope,doing"), $lang->testtask->testing);?></li>
|
||||
<li id='blockedTab'><?php echo html::a(inlink('browse', "productID=$productID&branch=$branch&type=$scope,blocked"), $lang->testtask->blocked);?></li>
|
||||
<li id='doneTab'><?php echo html::a(inlink('browse', "productID=$productID&branch=$branch&type=$scope,done"), $lang->testtask->done);?></li>
|
||||
<li id='totalStatusTab'><?php echo html::a(inlink('browse', "productID=$productID&branch=$branch&type=$scope,totalStatus"), $lang->testtask->totalStatus);?></li>
|
||||
<li style='margin-left: 20px;'>
|
||||
<?php $condition = "productID=$productID&branch=$branch&type=$scope,$status&orderBy=$orderBy&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID"?>
|
||||
<div class='input-group w-400px input-group-sm'>
|
||||
<span class='input-group-addon'><?php echo $lang->testtask->beginAndEnd;?></span>
|
||||
<div class='datepicker-wrapper datepicker-date'><?php echo html::input('date', $beginTime, "class='w-100px form-control form-date' onchange='changeDate(this.value, \"$endTime\", \"$condition\")'");?></div>
|
||||
<span class='input-group-addon'><?php echo $lang->testtask->to;?></span>
|
||||
<div class='datepicker-wrapper datepicker-date'><?php echo html::input('date', $endTime, "class='form-control form-date' onchange='changeDate(\"$beginTime\", this.value, \"$condition\")'");?></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="actions"><?php common::printIcon('testtask', 'create', "product=$productID");?></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
Reference in New Issue
Block a user