* Finish task #7361.

This commit is contained in:
holan20180123
2020-07-23 15:49:13 +08:00
parent 6c0eb72b10
commit 78e714df92
12 changed files with 66 additions and 15 deletions
+4 -1
View File
@@ -1,5 +1,8 @@
<div class='panel-body scrollbar-hover'>
<?php foreach ($lang->block->flowchart as $rowIndex => $flow):?>
<?php if($this->config->global->flow == 'onlyStory' and in_array($rowIndex, ['project', 'dev', 'tester'])) continue; ?>
<?php if($this->config->global->flow == 'onlyTask' and in_array($rowIndex, ['product', 'dev', 'tester'])) continue; ?>
<?php if($this->config->global->flow == 'onlyTest' and in_array($rowIndex, ['project', 'product'])) continue; ?>
<?php $idx = 0; ?>
<div class='row row-<?php echo $rowIndex?>'>
<?php foreach ($flow as $flowItem):?>
@@ -44,4 +47,4 @@
.block-sm .flow-item > div:before, .block-sm .flow-item > div:after {border-width: 15px 0 15px 6px;}
.block-sm .row-3 .flow-item-1, .block-sm .row-3 .flow-item-3 {width: 25%}
.block-sm .flow-item > div:after {right: -6px;}
</style>
</style>
@@ -154,6 +154,7 @@ $(function()
</div>
</div>
</div>
<?php if($this->config->global->flow != 'onlyTask'): ?>
<div class="product-info">
<div class="progress-info"><i class="icon icon-check-circle text-success icon-sm"></i> <span class="text-muted"><?php echo $lang->story->released;?></span> <strong><?php echo $project->releasedStories;?></strong></div>
<div class="progress">
@@ -195,6 +196,7 @@ $(function()
</div>
</div>
</div>
<?php endif;?>
</div>
</div>
</div>
+10
View File
@@ -46,6 +46,7 @@
<div class="col col-right">
<h4><small class="text-muted"><?php echo date(DT_DATE3)?></small> <?php echo $lang->block->leftToday?></h4>
<div class="row tiles">
<?php if($this->config->global->flow != 'onlyTest' and $this->config->global->flow != 'onlyStory'):?>
<div class="col tile">
<div class="tile-title"><?php echo $lang->block->myTask?></div>
<div class="tile-amount"><?php echo empty($tasks) ? 0 : html::a($this->createLink('my', 'task', 'type=assignedTo'), (int)$tasks);?></div>
@@ -55,6 +56,8 @@
</div>
<?php endif;?>
</div>
<?php endif;?>
<?php if($this->config->global->flow != 'onlyTask' and $this->config->global->flow != 'onlyStory'):?>
<div class="col tile">
<div class="tile-title"><?php echo $lang->block->myBug?></div>
<div class="tile-amount"><?php echo empty($bugs) ? 0 : html::a($this->createLink('my', 'bug', 'type=assignedTo'), (int)$bugs);?></div>
@@ -64,10 +67,14 @@
</div>
<?php endif;?>
</div>
<?php endif;?>
<?php if($this->config->global->flow != 'onlyTask' and $this->config->global->flow != 'onlyTest'):?>
<div class="col tile">
<div class="tile-title"><?php echo $lang->block->myStory?></div>
<div class="tile-amount"><?php echo empty($stories) ? 0 : html::a($this->createLink('my', 'story', 'type=assignedTo'), (int)$stories);?></div>
</div>
<?php endif;?>
<?php if($this->config->global->flow != 'onlyStory' and $this->config->global->flow != 'onlyTest'):?>
<div class="col tile">
<div class="tile-title"><?php echo $lang->block->myProject?></div>
<div class="tile-amount"><?php echo empty($projects) ? 0 : html::a($this->createLink('project', 'all', 'type=undone'), (int)$projects);?></div>
@@ -77,10 +84,13 @@
</div>
<?php endif;?>
</div>
<?php endif;?>
<?php if($this->config->global->flow != 'onlyTask' and $this->config->global->flow != 'onlyTest'):?>
<div class="col tile">
<div class="tile-title"><?php echo $lang->block->myProduct?></div>
<div class="tile-amount"><?php echo empty($products) ? 0 : html::a($this->createLink('product', 'all', 'product=0&line=0&status=noclosed'), (int)$products);?></div>
</div>
<?php endif;?>
</div>
</div>
</div>
+14 -6
View File
@@ -67,7 +67,7 @@ class bug extends control
* @access public
* @return void
*/
public function browse($productID = 0, $branch = '', $browseType = 'unclosed', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function browse($productID = 0, $branch = '', $browseType = '', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->loadModel('datatable');
@@ -77,18 +77,26 @@ class bug extends control
/* Set productID, moduleID, queryID and branch. */
$productID = $this->product->saveState($productID, $this->products);
$branch = ($branch == '') ? (int)$this->cookie->preBranch : (int)$branch;
$branchID = $browseType == '' ? $branch : ($browseType == 'bybranch' ? (int)$param : ($this->cookie->bugBranch ? $this->cookie->bugBranch : $branch));
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch)
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch or $browseType == 'bybranch')
{
$_COOKIE['bugModule'] = 0;
setcookie('bugModule', 0, 0, $this->config->webRoot, '', false, false);
}
if($browseType == 'bymodule') setcookie('bugModule', (int)$param, 0, $this->config->webRoot, '', false, false);
if($browseType != 'bymodule') $this->session->set('bugBrowseType', $browseType);
if($browseType == 'bymodule' or $browseType == '')
{
setcookie('bugModule', (int)$param, 0, $this->config->webRoot, '', false, false);
$_COOKIE['bugBranch'] = 0;
setcookie('bugBranch', 0, 0, $this->config->webRoot, '', false, false);
if($browseType == '') $browseType = 'unclosed';
}
if($browseType == 'bybranch') setcookie('bugBranch', (int)$param, 0, $this->config->webRoot, '', false, false);
if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('bugBrowseType', $browseType);
$moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->bugModule ? $this->cookie->bugModule : 0));
$moduleID = ($browseType == 'bymodule') ? (int)$param : (($browseType == 'bysearch' or $browseType == 'bybranch') ? 0 : ($this->cookie->bugModule ? $this->cookie->bugModule : 0));
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
/* Set menu and save session. */
@@ -111,7 +119,7 @@ class bug extends control
$projects = $this->loadModel('project')->getPairs('empty|withdelete');
/* Get bugs. */
$bugs = $this->bug->getBugs($productID, $projects, $branch, $browseType, $moduleID, $queryID, $sort, $pager);
$bugs = $this->bug->getBugs($productID, $projects, $branchID, $browseType, $moduleID, $queryID, $sort, $pager);
/* Process the sql, get the conditon partion, save it to session. */
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug', $browseType == 'needconfirm' ? false : true);
+1
View File
@@ -354,6 +354,7 @@ class bugModel extends model
/* Set modules and browse type. */
$modules = $moduleID ? $this->loadModel('tree')->getAllChildId($moduleID) : '0';
$browseType = ($browseType == 'bymodule' and $this->session->bugBrowseType and $this->session->bugBrowseType != 'bysearch') ? $this->session->bugBrowseType : $browseType;
$browseType = $browseType == 'bybranch' ? 'bymodule' : $browseType;
/* Get bugs by browse type. */
$bugs = array();
+3 -1
View File
@@ -52,7 +52,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
$menuBrowseType = strpos($menuItem->name, 'QUERY') === 0 ? 'bySearch' : $menuItem->name;
$label = "<span class='text'>{$menuItem->text}</span>";
if($this->session->bugBrowseType == 'bysearch') $browseType = 'all';
if($this->session->bugBrowseType != 'bysearch' && $browseType == 'bymodule') $browseType = $this->session->bugBrowseType;
if($this->session->bugBrowseType != 'bysearch' && ($browseType == 'bymodule' or $browseType == 'bybranch')) $browseType = $this->session->bugBrowseType;
$label .= $menuBrowseType == $browseType ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>" : '';
$active = $menuBrowseType == $browseType ? 'btn-active-text' : '';
@@ -401,6 +401,8 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
</div>
<script>
$('#module' + moduleID).closest('li').addClass('active');
var branchID = $.cookie('bugBranch');
$('#branch' + branchID).closest('li').addClass('active');
<?php if($browseType == 'bysearch'):?>
if($('#query li.active').size() == 0) $.toggleQueryBox(true);
<?php endif;?>
+14 -6
View File
@@ -101,7 +101,7 @@ class product extends control
* @access public
* @return void
*/
public function browse($productID = 0, $branch = '', $browseType = 'unclosed', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function browse($productID = 0, $branch = '', $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Lower browse type. */
$browseType = strtolower($browseType);
@@ -116,18 +116,26 @@ class product extends control
/* Set product, module and query. */
$productID = $this->product->saveState($productID, $this->products);
$branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch;
$branchID = $browseType == '' ? $branch : ($browseType == 'bybranch' ? (int)$param : ($this->cookie->storyBranch ? $this->cookie->storyBranch : $branch));
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch)
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch or $browseType == 'bybranch')
{
$_COOKIE['storyModule'] = 0;
setcookie('storyModule', 0, 0, $this->config->webRoot, '', false, false);
}
if($browseType == 'bymodule') setcookie('storyModule', (int)$param, 0, $this->config->webRoot, '', false, false);
if($browseType != 'bymodule') $this->session->set('storyBrowseType', $browseType);
if($browseType == 'bymodule' or $browseType == '')
{
setcookie('storyModule', (int)$param, 0, $this->config->webRoot, '', false, false);
$_COOKIE['storyBranch'] = 0;
setcookie('storyBranch', 0, 0, $this->config->webRoot, '', false, false);
if($browseType == '') $browseType = 'unclosed';
}
if($browseType == 'bybranch') setcookie('storyBranch', (int)$param, 0, $this->config->webRoot, '', false, false);
if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('storyBrowseType', $browseType);
$moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->storyModule ? $this->cookie->storyModule : 0));
$moduleID = ($browseType == 'bymodule') ? (int)$param : (($browseType == 'bysearch' or $browseType == 'bybranch') ? 0 : ($this->cookie->storyModule ? $this->cookie->storyModule : 0));
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
/* Set menu. */
@@ -146,7 +154,7 @@ class product extends control
$pager = new pager($recTotal, $recPerPage, $pageID);
/* Get stories. */
$stories = $this->product->getStories($productID, $branch, $browseType, $queryID, $moduleID, $storyType, $sort, $pager);
$stories = $this->product->getStories($productID, $branchID, $browseType, $queryID, $moduleID, $storyType, $sort, $pager);
/* Process the sql, get the conditon partion, save it to session. */
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', $browseType != 'bysearch');
+1
View File
@@ -562,6 +562,7 @@ class productModel extends model
/* Set modules and browse type. */
$modules = $moduleID ? $this->loadModel('tree')->getAllChildID($moduleID) : '0';
$browseType = ($browseType == 'bymodule' and $this->session->storyBrowseType and $this->session->storyBrowseType != 'bysearch') ? $this->session->storyBrowseType : $browseType;
$browseType = $browseType == 'bybranch' ? 'bymodule' : $browseType;
/* Get stories by browseType. */
$stories = array();
+2
View File
@@ -421,7 +421,9 @@ js::set('foldAll', $lang->project->treeLevel['root']);
</div>
<script>
var moduleID = <?php echo $moduleID?>;
var branchID = $.cookie('storyBranch');
$('#module<?php echo $moduleID;?>').closest('li').addClass('active');
$('#branch' + branchID).closest('li').addClass('active');
$(function()
{
+12
View File
@@ -102,6 +102,12 @@ class testreportModel extends model
->get();
$data->members = trim($data->members, ',');
$builds = array();
$build = $this->loadModel('build')->getById($data->builds);
if(!empty($build->id)) $builds[$build->id] = $build;
$bugs = $this->getBugs4Test($builds, $data->product, $data->begin, $data->end);
if(!empty($bugs)) $data->bugs = implode(",", array_keys($bugs));
$data = $this->loadModel('file')->processImgURL($data, $this->config->testreport->editor->create['id'], $this->post->uid);
$this->dao->insert(TABLE_TESTREPORT)->data($data)->autocheck()
->batchCheck($this->config->testreport->create->requiredFields, 'notempty')
@@ -136,6 +142,12 @@ class testreportModel extends model
->get();
$data->members = trim($data->members, ',');
$builds = array();
$build = $this->loadModel('build')->getById($data->builds);
if(!empty($build->id)) $builds[$build->id] = $build;
$bugs = $this->getBugs4Test($builds, $data->product, $data->begin, $data->end);
$data->bugs = !empty($bugs) ? implode(",", array_keys($bugs)) : '';
$data = $this->loadModel('file')->processImgURL($data, $this->config->testreport->editor->edit['id'], $this->post->uid);
$this->dao->update(TABLE_TESTREPORT)->data($data)->autocheck()
->batchCheck($this->config->testreport->edit->requiredFields, 'notempty')
+1 -1
View File
@@ -404,7 +404,7 @@ class treeModel extends model
{
$linkHtml = ($type == 'case' and !empty($extra)) ? '<a>' . $branch . '</a>' : $this->createBranchLink($type, $rootID, $branchID, $branch);
$linkHtml = $manage ? html::a(inlink('browse', "root=$rootID&viewType=$type&currentModuleID=0&branch=$branchID"), $branch) : $linkHtml;
if($type == 'story' || $type == 'bug') $linkHtml = '<a>' . $branch . '</a>';
if($type == 'story' or $type == 'bug') $linkHtml = html::a(inlink('browse', "productID=$rootID&branch=&browseType=bybranch&param=$branchID"), $branch, "", "id=branch" . $branchID);
if($firstBranch and $product->type != 'normal')
{
$linkHtml = '<a>' . $this->lang->product->branchName[$product->type] . '</a><ul><li>' . $linkHtml;