* finish task #2917.

This commit is contained in:
pengjiangxiu
2017-03-09 17:01:31 +08:00
parent 5e4bae3022
commit c64dd977ae
9 changed files with 58 additions and 4 deletions
+1
View File
@@ -46,3 +46,4 @@ CREATE TABLE `zt_testreport` (
`deleted` enum('0','1') NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
ALTER TABLE `zt_bug` ADD `deadline` date NOT NULL;
+2
View File
@@ -99,6 +99,7 @@ $config->bug->search['fields']['assignedDate'] = $lang->bug->assignedDate;
$config->bug->search['fields']['resolvedDate'] = $lang->bug->resolvedDate;
$config->bug->search['fields']['closedDate'] = $lang->bug->closedDate;
$config->bug->search['fields']['lastEditedDate'] = $lang->bug->lastEditedDateAB;
$config->bug->search['fields']['deadline'] = $lang->bug->deadline;
$config->bug->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->bug->search['params']['keywords'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
@@ -141,6 +142,7 @@ $config->bug->search['params']['assignedDate'] = array('operator' => '=',
$config->bug->search['params']['resolvedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->bug->search['params']['closedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->bug->search['params']['lastEditedDate']= array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->bug->search['params']['deadline'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->bug->datatable = new stdclass();
$config->bug->datatable->defaultField = array('id', 'severity', 'pri', 'title', 'status', 'openedBy', 'openedDate', 'assignedTo', 'resolvedBy', 'resolution', 'resolvedDate', 'actions');
+3
View File
@@ -49,6 +49,7 @@ $lang->bug->resolutionAB = '方案';
$lang->bug->resolvedBuild = '解决版本';
$lang->bug->resolvedDate = '解决日期';
$lang->bug->resolvedDateAB = '解决日期';
$lang->bug->deadline = '截止日期';
$lang->bug->closedBy = '由谁关闭';
$lang->bug->closedDate = '关闭日期';
$lang->bug->duplicateBug = '重复ID';
@@ -105,6 +106,7 @@ $lang->bug->toClosed = '待关闭';
$lang->bug->unclosed = '未关闭';
$lang->bug->longLifeBugs = '久未处理';
$lang->bug->postponedBugs = '被延期';
$lang->bug->overdueBugs = '过期Bug';
$lang->bug->allBugs = '所有';
$lang->bug->byQuery = '搜索';
$lang->bug->needConfirm = '需求变动';
@@ -365,4 +367,5 @@ $lang->bug->featureBar['browse']['unresolved'] = $lang->bug->unResolved;
$lang->bug->featureBar['browse']['toclosed'] = $lang->bug->toClosed;
$lang->bug->featureBar['browse']['longlifebugs'] = $lang->bug->longLifeBugs;
$lang->bug->featureBar['browse']['postponedbugs'] = $lang->bug->postponedBugs;
$lang->bug->featureBar['browse']['overdueBugs'] = $lang->bug->overdueBugs;
$lang->bug->featureBar['browse']['needconfirm'] = $lang->bug->needConfirm;
+38
View File
@@ -244,6 +244,17 @@ class bugModel extends model
elseif($browseType == 'postponedbugs') $bugs = $this->getByPostponedbugs($productID, $branch, $modules, $projects, $sort, $pager);
elseif($browseType == 'needconfirm') $bugs = $this->getByNeedconfirm($productID, $branch, $modules, $projects, $sort, $pager);
elseif($browseType == 'bysearch') $bugs = $this->getBySearch($productID, $queryID, $sort, $pager, $branch);
elseif($browseType == 'overduebugs') $bugs = $this->getByOverdueBugs($productID, $branch, $modules, $projects, $sort, $pager);
/* Delayed or not?. */
foreach ($bugs as $bug)
{
if($bug->deadline != '0000-00-00')
{
$delay = helper::diffDate(helper::today(), $bug->deadline);
if($delay > 0) $bug->delay = $delay;
}
}
return $bugs;
}
@@ -1896,6 +1907,33 @@ class bugModel extends model
->orderBy($orderBy)->page($pager)->fetchAll();
}
/**
* Get bugs the overdueBugs is active or unclosed.
*
* @param int $productID
* @param int $branch
* @param array $modules
* @param array $projects
* @param string $status
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getByOverdueBugs($productID,$branch,$modules, $projects, $orderBy, $pager)
{
return $this->dao->select('*')->from(TABLE_BUG)
->where('project')->in(array_keys($projects))
->andWhere('product')->eq($productID)
->andWhere('status')->ne('closed')
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
->beginIF($modules)->andWhere('module')->in($modules)->fi()
->andWhere('deleted')->eq(0)
->andWhere('deadline')->ne('0000-00-00')
->andWhere('deadline')->lt(helper::today())
->orderBy($orderBy)->page($pager)->fetchAll();
}
/**
* Get bugs the status is active or unclosed.
*
+2 -2
View File
@@ -120,8 +120,8 @@ js::set('bugBrowseType', ($browseType == 'bymodule' and $this->session->bugBrows
<tfoot>
<tr>
<?php
$columns = $this->cookie->windowWidth >= $this->config->wideSize ? 12 : 10;
if($browseType == 'needconfirm') $columns = 7;
$columns = $this->cookie->windowWidth >= $this->config->wideSize ? 13 : 11;
if($browseType == 'needconfirm') $columns = 8;
?>
<td colspan='<?php echo $columns;?>'>
<?php if(!empty($bugs)):?>
+2 -1
View File
@@ -18,6 +18,7 @@
<th class='w-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th> <?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
<th class='w-100px'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->bug->statusAB);?></th>
<th class='w-80px'> <?php common::printOrderLink('deadline', $orderBy, $vars, $lang->bug->deadline);?></th>
<?php if($browseType == 'needconfirm'):?>
<th class='w-200px'><?php common::printOrderLink('story', $orderBy, $vars, $lang->bug->story);?></th>
@@ -76,7 +77,7 @@
}
?>
</td>
<td class="<?php if(isset($bug->delay)) echo 'delayed';?>"><?php if(substr($bug->deadline, 0, 4) > 0) echo substr($bug->deadline, 5, 6)?></td>
<?php if($browseType == 'needconfirm'):?>
<td class='text-left' title="<?php echo $bug->storyTitle?>"><?php echo html::a($this->createLink('story', 'view', "stoyID=$bug->story"), $bug->storyTitle, '_blank');?></td>
<td><?php $lang->bug->confirmStoryChange = $lang->confirm; common::printIcon('bug', 'confirmStoryChange', "bugID=$bug->id", '', 'list', '', 'hiddenwin')?></td>
+5
View File
@@ -12,6 +12,7 @@
?>
<?php
include '../../common/view/header.html.php';
include '../../common/view/datepicker.html.php';
include '../../common/view/kindeditor.html.php';
js::set('page' , 'edit');
js::set('changeProductConfirmed' , false);
@@ -196,6 +197,10 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild);
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->bug->deadline;?></th>
<td><?php echo html::input('deadline', $bug->deadline, "class='form-control form-date'");?></td>
</tr>
<tr>
<th><?php echo $lang->bug->resolvedBy;?></th>
<td><?php echo html::select('resolvedBy', $users, $bug->resolvedBy, "class='form-control chosen'");?></td>
+4
View File
@@ -250,6 +250,10 @@
?>
</td>
</tr>
<tr>
<th><?php echo $lang->bug->deadline;?></th>
<td><?php if($bug->deadline) echo $bug->deadline;?></td>
</tr>
<tr>
<th><?php echo $lang->bug->lblResolved;?></th>
<td><?php if($bug->resolvedBy) echo $users[$bug->resolvedBy] . $lang->at . $bug->resolvedDate;?></td>
+1 -1
View File
@@ -110,7 +110,7 @@ class searchModel extends model
/* Set filed name. */
if($operator == '=' and preg_match('/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/', $value))
{
$condition = '`' . $this->post->$fieldName . "` >= '$value' AND `" . $this->post->$fieldName . "` <= '$value 24:00:00'";
$condition = '`' . $this->post->$fieldName . "` >= '$value' AND `" . $this->post->$fieldName . "` <= '$value 23:59:59'";
$where .= " $andOr ($condition)";
}
elseif($condition)