This commit is contained in:
王怡栋
2021-08-31 17:00:16 +08:00
16 changed files with 96 additions and 81 deletions
+1 -1
View File
@@ -327,7 +327,7 @@ js::set('moduleID', $moduleID);
<td colspan="3" class="text-center form-actions">
<?php $browseLink = $this->session->bugList ? $this->session->bugList : $this->inlink('browse', "productID=$productID");?>
<?php echo html::submitButton();?>
<?php if($caseID) echo html::linkButton($lang->goback, $browseLink, 'self', '', 'btn btn-wide');?>
<?php if($caseID) echo html::a($browseLink, $lang->goback, '', 'class="btn btn-wide"');?>
<?php if(!$caseID) echo html::backButton();?>
<?php echo html::hidden('case', (int)$caseID) . html::hidden('caseVersion', (int)$version);?>
<?php echo html::hidden('result', (int)$runID) . html::hidden('testtask', empty($testtask) ? 0 : $testtask->id);?>
+1 -1
View File
@@ -94,7 +94,7 @@ $lang->my->menu->work['subMenu']->task = array('link' => "{$lang->task->comm
if($config->URAndSR) $lang->my->menu->work['subMenu']->requirement = "$lang->URCommon|my|work|mode=requirement";
$lang->my->menu->work['subMenu']->story = "$lang->SRCommon|my|work|mode=story";
$lang->my->menu->work['subMenu']->bug = "{$lang->bug->common}|my|work|mode=bug";
$lang->my->menu->work['subMenu']->testcase = "{$lang->testcase->common}|my|work|mode=testcase&type=assigntome";
$lang->my->menu->work['subMenu']->testcase = array('link' => "{$lang->testcase->common}|my|work|mode=testcase&type=assigntome", 'subModule' => 'testtask');
$lang->my->menu->work['subMenu']->testtask = "{$lang->testtask->common}|my|work|mode=testtask&type=wait";
$lang->my->menu->work['menuOrder'][5] = 'task';
+1 -1
View File
@@ -2310,7 +2310,7 @@ EOT;
{
$libs = $this->getLibsByObject('book', 0, '', $appendLib);
$this->app->rawMethod = 'book';
if($libID == 0 and !empty($libs)) $libID = reset($libs)->id;
if(!empty($libs) and ($libID == 0 or !isset($libs[$libID]))) $libID = reset($libs)->id;
$this->lang->modulePageNav = $this->select($type, $objects, $objectID, $libs, $libID);
$object = new stdclass();
+1 -1
View File
@@ -52,7 +52,7 @@ if(empty($type)) $type = 'product';
echo '</ul></div>';
}
if($type == 'book' and ($canEditLib or $canManageBook))
if($type == 'book' and ($canEditLib or $canManageBook) and !empty($libs))
{
echo "<div class='menu-actions'>";
echo html::a('javascript:;', "<i class='icon icon-ellipsis-v'></i>", '', "data-toggle='dropdown' class='btn btn-link'");
+1 -1
View File
@@ -406,7 +406,7 @@ class gitlabModel extends model
$allResults = array();
for($page = 1; true; $page ++)
{
$results = json_decode(commonModel::http($host . "?private_token={$gitlab->token}&simple=true&membership=true&page={$page}&per_page=100"));
$results = json_decode(commonModel::http($host . "?private_token={$gitlab->token}&simple=true&page={$page}&per_page=100"));
if(empty($results) or $page > 10) break;
$allResults = array_merge($allResults, $results);
}
+3 -1
View File
@@ -443,7 +443,9 @@ class my extends control
$this->loadModel('testtask');
/* Save session. */
$this->session->set('caseList', $this->app->getURI(true), 'qa');
$uri = $this->app->getURI(true);
$this->session->set('caseList', $uri, 'qa');
$this->session->set('bugList', $uri . "#app={$this->app->tab}", 'qa');
/* Load pager. */
$this->app->loadClass('pager', $static = true);
+11 -6
View File
@@ -1,12 +1,15 @@
#kanban {padding: 10px;}
.main-table tbody>tr>td {padding: 0 10px 10px;}
.table caption {background: #fff; border-top-left-radius: 2px; border-top-right-radius: 2px; margin-bottom: 0; font-weight: 500; padding-top: 0;}
.table .program {writing-mode: vertical-lr; padding-left: 4px !important; color: #fff;}
.table th, .table td {border-top: 2px solid #fff; border-bottom: 2px solid #fff; border-left: 3px solid #fff; border-bottom: 3px solid #fff;}
.table tbody tr:last-child td {border-bottom: unset;}
td.project, td.execution {padding: 10px 0 !important;}
td.plan, td.release {vertical-align: top !important;}
td.plan, td.release, td.project, td.execution {vertical-align: top !important;}
.main-table tbody>tr>td {padding: 0 10px 10px;}
.table .program {writing-mode: vertical-lr; padding-left: 4px !important; color: #fff;}
td.product {padding-top: 10px !important;}
td.project, td.execution {padding: 0 0 10px 0 !important;}
td > div:not(.board) > .board-item:first-child {margin-top: 10px;}
td > div.board:first-child {margin-top: 5px;}
.board-item {border: 1px solid #ebebeb; padding: 3px 10px; cursor: default; border-radius: 2px; background-color: #fff; text-align: left;}
.board-item:hover {border-color: #ccc;}
@@ -14,8 +17,10 @@ td.plan, td.release {vertical-align: top !important;}
.board + .board {margin-top: 5px;}
.board-item + .board-item {margin-top: 10px;}
.project .board, .execution .board {padding-top: 5px; border-top: 2px solid #fff;}
.project .board:first-child, .execution .board:first-child {padding-top: 0; border-top: unset;}
.project .board:first-child, .execution .board:first-child {padding-top: 5px; border-top: unset;}
.release .board-item {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center;}
.emptyBoard {padding: 3px 10px; cursor: default;}
.project .table-row > .table-col:last-child, .execution .table-row > .table-col:last-child {width: 24px; padding-top: 2px;}
.scroll {overflow-x: hidden;; overflow-y: auto;}
+40 -22
View File
@@ -39,29 +39,38 @@
<?php foreach($programs as $programID => $programProduct):?>
<?php $i = 0;?>
<?php foreach($programProduct as $productID):?>
<?php
$scroll = '';
$doingCounts = isset($projectProduct[$productID]) ? count($projectProduct[$productID]) : 0;
$planCounts = isset($planList[$productID]) ? count($planList[$productID]) : 0;
$releaseCount = isset($releaseList[$productID]) ? count($releaseList[$productID]) : 0;
if(($doingCounts < $planCounts or $doingCounts < $releaseCount) and ($planCounts > 5 or $releaseCount > 5)) $scroll = 'scroll';
?>
<tr>
<?php if($i == 0):?>
<td rowspan="<?php echo count($programs[$programID])?>" class="program text-ellipsis" style="background: <?php echo $this->lang->product->kanbanColorList[$colorIndex];?>"><?php echo zget($programList, $programID);?></td>
<?php endif;?>
<td title="<?php echo $productList[$productID]->name;?>">
<td class="product">
<?php if(common::hasPriv('product', 'browse')):?>
<?php echo '<span>' . html::a($this->createLink('product', 'browse', "productID=$productID"), $productList[$productID]->name, '', "title={$productList[$productID]->name}") . '</span>';?>
<?php echo "<span>" . html::a($this->createLink('product', 'browse', "productID=$productID"), $productList[$productID]->name, '', "title={$productList[$productID]->name}") . '</span>';?>
<?php else:?>
<?php echo "<span title={$productList[$productID]->name}>{$productList[$productID]->name}</span>";?>
<?php endif;?>
</td>
<td class="plan">
<?php if(isset($planList[$productID])):?>
<?php foreach($planList[$productID] as $planID => $plan):?>
<div class="board-item text-ellipsis">
<?php if(common::hasPriv('productplan', 'view')):?>
<?php echo html::a($this->createLink('productplan', 'view', "planID=$planID"), $plan->title, '', "title={$plan->title}");?>
<?php else:?>
<?php echo "<span title={$plan->title}>{$plan->title}</span>"?>
<div class="<?php echo $scroll;?>">
<?php if(isset($planList[$productID])):?>
<?php foreach($planList[$productID] as $planID => $plan):?>
<div class="board-item text-ellipsis">
<?php if(common::hasPriv('productplan', 'view')):?>
<?php echo html::a($this->createLink('productplan', 'view', "planID=$planID"), $plan->title, '', "title={$plan->title}");?>
<?php else:?>
<?php echo "<span title={$plan->title}>{$plan->title}</span>"?>
<?php endif;?>
</div>
<?php endforeach;?>
<?php endif;?>
</div>
<?php endforeach;?>
<?php endif;?>
</td>
<td class="project">
<?php if(isset($projectProduct[$productID])):?>
@@ -133,18 +142,20 @@
<?php endif;?>
</td>
<td class="release">
<?php if(isset($releaseList[$productID])):?>
<?php foreach($releaseList[$productID] as $releaseID => $release):?>
<div class="board-item">
<?php if(common::hasPriv('release', 'view')):?>
<?php echo html::a($this->createLink('release', 'view', "releaseID=$releaseID"), $release->name, '', "title={$release->name} class='text-ellipsis'");?>
<?php else:?>
<?php echo "<span title={$release->name}>{$release->name}</span>"?>
<div class="<?php echo $scroll;?>">
<?php if(isset($releaseList[$productID])):?>
<?php foreach($releaseList[$productID] as $releaseID => $release):?>
<div class="board-item">
<?php if(common::hasPriv('release', 'view')):?>
<?php echo html::a($this->createLink('release', 'view', "releaseID=$releaseID"), $release->name, '', "title={$release->name} class='text-ellipsis'");?>
<?php else:?>
<?php echo "<span title={$release->name}>{$release->name}</span>"?>
<?php endif;?>
<?php if($release->marker) echo "&nbsp;<span><i class='icon icon-flag red'></i></span>";?>
</div>
<?php endforeach;?>
<?php endif;?>
<?php if($release->marker) echo "&nbsp;<span><i class='icon icon-flag red'></i></span>";?>
</div>
<?php endforeach;?>
<?php endif;?>
</td>
<?php $i ++;?>
</tr>
@@ -168,7 +179,14 @@ $(function()
}
})
$('.emptyBoard').parent().height($('.project .board').height());
$('.board').height($('.project .board').height());
$('.table div.scroll').each(function()
{
var count = $(this).parent().siblings('td.project').children('.board').length >= 5 ? $(this).parent().siblings('td.project').children('.board').length : 5;
var preHeight = $(this).parent().siblings('td.project').children('.board').length >= 5 ? $('.board').outerHeight(true) : $(this).find('.board-item').outerHeight(true);
$(this).css('max-height', preHeight * count);
})
})
</script>
<?php include '../../common/view/footer.html.php';?>
-1
View File
@@ -305,7 +305,6 @@ class project extends control
$this->view->title = $this->lang->project->kanban;
$this->view->kanbanGroup = $kanbanGroup;
$this->view->latestExecutions = $latestExecutions;
$this->view->statusCount = $statusCount;
$this->view->programPairs = array(0 => $this->lang->project->noProgram) + $this->loadModel('program')->getPairs(true);
$this->display();
+5 -7
View File
@@ -5,15 +5,13 @@
.board-item:hover {border-color: #ccc;}
.board-project .board-item + .board-item {margin-top: 10px;}
.board-project {padding: 10px;}
.board-wait, .board-closed {vertical-align: top !important;}
.board-project {padding: 0 10px 10px 10px;}
.board-project .board-item:first-child {margin-top: 10px;}
.board-doing {padding: 0px !important; vertical-align: top !important;}
.board-doing, .board-wait, .board-closed {padding: 0px !important; vertical-align: top !important;}
.board-doing .board-doing-project,.board-doing .board-doing-execution {padding: 10px;}
.board-doing .board-doing-project:not(:last-child),
.board-doing .board-doing-execution:not(:last-child) {padding: 10px; border-bottom: 2px solid #fff;}
.board-doing .board-doing-project:last-child,
.board-doing .board-doing-execution:last-child {padding: 10px;}
.board-doing .board-doing-execution:not(:last-child) {border-bottom: 2px solid #fff;}
.board-doing-project .table-row .table-col:last-child, .c-progress {width: 30px;}
.board-doing-execution .table-row .table-col:last-child, .c-progress {width: 30px;}
+27
View File
@@ -0,0 +1,27 @@
$(function()
{
$("div[class^='board-doing-']").height($('.board-doing-project').height());
$('.board-program').each(function()
{
var boardWaitCount = $(this).find('.board-wait .board-item').length;
var boardClosedCount = $(this).find('.board-closed .board-item').length;
var boardDoingCount = $(this).find('.board-doing .board-item').length;
if((boardWaitCount > 5 || boardClosedCount > 5) && (boardWaitCount > boardDoingCount || boardClosedCount > boardDoingCount))
{
var boardHeight = 0;
if(boardDoingCount > 5)
{
boardHeight = $('.board-doing-project').outerHeight(true) * boardDoingCount;
}
else
{
var boardHeight = $(this).find('.board-project .board-item').outerHeight(true) * 5;
}
$(this).find('.board-project').css("height", boardHeight);
$(this).find('.board-project').css("overflow", 'auto');
}
});
})
+1 -4
View File
@@ -1798,7 +1798,6 @@ class projectModel extends model
$myProjects = array();
$otherProjects = array();
$statusCount = array();
foreach($projects as $project)
{
if(strpos('wait,doing,closed', $project->status) === false) continue;
@@ -1809,17 +1808,15 @@ class projectModel extends model
if($project->PM == $this->app->user->account)
{
$myProjects[$topProgram][$project->status][$project->id] = $project;
$statusCount['my'][$topProgram][$project->status] = count($myProjects[$topProgram][$project->status]);
}
else
{
$otherProjects[$topProgram][$project->status][$project->id] = $project;
$statusCount['other'][$topProgram][$project->status] = count($otherProjects[$topProgram][$project->status]);
}
}
return array('kanbanGroup' => array('my' => $myProjects, 'other' => $otherProjects), 'latestExecutions' => $latestExecutions, 'statusCount' => $statusCount);
return array('kanbanGroup' => array('my' => $myProjects, 'other' => $otherProjects), 'latestExecutions' => $latestExecutions);
}
/**
+2 -11
View File
@@ -10,13 +10,11 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php $colorIndex = 0;?>
<?php if(empty($kanbanGroup)):?>
<div class="table-empty-tip">
<p><span class="text-muted"><?php echo $lang->project->empty;?></span></p>
</div>
<?php else:?>
<?php foreach($kanbanGroup as $type => $projectGroup):?>
<?php if(empty($projectGroup)) continue;?>
<div id="kanban" class="main-table fade auto-fade-in" data-ride="table" data-checkable="false" data-group="true">
@@ -39,7 +37,7 @@
</thead>
<tbody>
<?php foreach($projectGroup as $programID => $statusList):?>
<tr>
<tr class='board-program'>
<td class='text-center' style='background: <?php echo $lang->project->laneColorList[$colorIndex];?>; color: #fff; padding-left: 2px; writing-mode: vertical-lr;'><?php echo zget($programPairs, $programID);?></td>
<?php foreach(array('wait','doing','closed') as $status):?>
<?php if($status == 'doing'):?>
@@ -110,7 +108,7 @@
</td>
<?php else:?>
<td class='board-<?php echo $status;?>'>
<div class='board-project' <?php if(isset($statusCount[$type][$programID][$status]) and isset($statusCount[$type][$programID]['doing']) and ($statusCount[$type][$programID][$status] > $statusCount[$type][$programID]['doing'])) echo "style='max-height: 273px; overflow: auto;'";?>>
<div class='board-project'>
<?php if(isset($statusList[$status])):?>
<?php foreach($statusList[$status] as $project):?>
<div class='board-item' <?php echo "style='border-left: 3px solid " . $lang->execution->statusColorList[$status] . "'";?>>
@@ -143,11 +141,4 @@
</div>
<?php endforeach;?>
<?php endif;?>
<script>
$(function()
{
$("div[class^='board-doing-']").height($('.board-doing-project').height());
})
</script>
<?php include '../../common/view/footer.html.php';?>
-23
View File
@@ -1752,29 +1752,6 @@ class repoModel extends model
return $buildedURL;
}
/**
* Get gitlab projects.
*
* @param string $host
* @param string $token
* @access public
* @return array
*/
public function getGitlabProjects($host, $token)
{
$host = rtrim($host, '/');
$host .= '/api/v4/projects';
$allResults = array();
for($page = 1; true; $page ++)
{
$results = json_decode(common::http($host . "?private_token=$token&simple=true&membership=true&page={$page}&per_page=100"));
if(empty($results) or $page > 10) break;
$allResults = $allResults + $results;
}
return $allResults;
}
/**
* Process gitlab repo.
*
+1 -1
View File
@@ -67,7 +67,7 @@
<?php foreach($caseIDList as $caseID):?>
<?php
if(!isset($cases[$caseID])) continue;
if(!$productID and !$cases[$caseID]->lib)
if((!$productID and !$cases[$caseID]->lib) or $app->tab != 'qa')
{
$product = $this->product->getByID($cases[$caseID]->product);
$branches = $product->type == 'normal' ? array('' => '') : $this->loadModel('branch')->getPairs($product->id);
+1
View File
@@ -44,6 +44,7 @@ a.showMoreImage:hover {opacity: 1;}
.table-footer .checked+div .btn, .table-actions .btn:hover {background: #16a8f8; border-color: #16a8f8}
#userMenu>ul>li {margin-right: 10px;}
#userNav .dropdown-menu>li>a>.icon-w {top: 2px;}
.icon-plus-solid-circle:before {font-size: 30px; color: #3b92f7;}
.create-list {min-width: 120px !important;}
.create-list>li>a {padding-left: 35px !important;}