* Product Kanban is compatible with the classic model.

This commit is contained in:
hufangzhou
2021-09-06 09:30:05 +08:00
parent 67cc48e3cb
commit a69ffad760
4 changed files with 69 additions and 17 deletions
+1
View File
@@ -1183,6 +1183,7 @@ class product extends control
$this->view->productList = $productList;
$this->view->planList = $planList;
$this->view->projectList = $projectList;
$this->view->executionList = $executionList;
$this->view->projectProduct = $projectProduct;
$this->view->latestExecutions = $projectLatestExecutions;
$this->view->hourList = $hourList;
+6 -3
View File
@@ -1,8 +1,11 @@
#kanban {padding: 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 th, .table td {border-top: 2px solid #fff; border-bottom: 2px solid #fff; border-left: 3px solid #fff; border-bottom: 3px solid #fff;}
.table th {border: 2px solid #fff;}
.table td {border-top: 5px solid #fff; border-bottom: 5px solid #fff; border-left: 2px solid #fff; border-right: 2px solid #fff;}
.table tbody tr:last-child td {border-bottom: unset;}
td.plan, td.release, td.project, td.execution {vertical-align: top !important;}
td.plan, td.release, td.project, td.execution, td.classicProject {vertical-align: top !important;}
td.program {padding-top: 10px !important; padding-bottom: 10px !important;}
.main-table tbody>tr>td:first-child, .main-table thead>tr>th:first-child {padding: 0 4px 10px 4px;}
.main-table tbody>tr>td {padding: 0 10px 10px;}
.table .program {writing-mode: vertical-lr; padding-left: 4px !important; color: #fff;}
@@ -22,6 +25,6 @@ td > div.board:first-child {margin-top: 5px;}
.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;}
.project .table-row > .table-col:last-child, .execution .table-row > .table-col:last-child, .classicProject .table-row > .table-col:last-child{width: 24px; padding-top: 2px;}
.scroll {overflow-x: hidden; overflow-y: auto;}
+11 -7
View File
@@ -1554,29 +1554,33 @@ class productModel extends model
->orderBy('begin desc')
->fetchGroup('product', 'id');
$executionList = $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1')
$executionListKey = $this->config->systemMode == 'new' ? 'project' : 'productID';
$executionList = $this->dao->select('t1.product as productID,t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project=t2.id')
->where('type')->in('stage,sprint')
->andWhere('t2.project')->in(array_keys($projectList))
->beginIF($this->config->systemMode == 'new')->andWhere('t2.project')->in(array_keys($projectList))->fi()
->andWhere('t1.product')->in(array_keys($productList))
->andWhere('status')->eq('doing')
->andWhere('deleted')->eq('0')
->orderBy('id_desc')
->fetchGroup('project', 'id');
->fetchGroup($executionListKey, 'id');
$projectLatestExecutions = array();
$latestExecutionList = array();
foreach($executionList as $projectID => $executions)
if($this->config->systemMode == 'new')
{
$latestExecutionList[key($executions)] = current($executions);
$projectLatestExecutions[$projectID] = current($executions);
foreach($executionList as $projectID => $executions)
{
$latestExecutionList[key($executions)] = current($executions);
$projectLatestExecutions[$projectID] = current($executions);
}
}
$hourList = $this->loadModel('project')->computerProgress($latestExecutionList);
$releaseList = $this->dao->select('id,product,name,marker')->from(TABLE_RELEASE)->where('product')->in(array_keys($productList))->fetchGroup('product', 'id');
return array('programList' => $programList, 'productList' => $productList, 'planList' => $planList, 'projectList' => $projectList, 'projectProduct' => $projectProduct, 'projectLatestExecutions' => $projectLatestExecutions, 'hourList' => $hourList, 'releaseList' => $releaseList);
return array('programList' => $programList, 'productList' => $productList, 'planList' => $planList, 'projectList' => $projectList, 'executionList' => $executionList, 'projectProduct' => $projectProduct, 'projectLatestExecutions' => $projectLatestExecutions, 'hourList' => $hourList, 'releaseList' => $releaseList);
}
/**
+51 -7
View File
@@ -23,16 +23,24 @@
<caption><?php echo $type == 'myProducts' ? $lang->product->myProduct : $lang->product->otherProduct;?></caption>
<thead>
<tr>
<th rowspan="2" class="w-20px" style="border-right: 0; border-left: 0; background: #32C5FF;"></th>
<th rowspan="2" style="border-left: 0px;"><?php echo $lang->product->unclosedProduct;?></th>
<th rowspan="2"><?php echo $lang->product->unexpiredPlan;?></th>
<th colspan="2"><?php echo $lang->product->doing;?></th>
<th rowspan="2"><?php echo $lang->product->normalRelease;?></th>
<?php
$rowspan = $config->systemMode == 'new' ? "rowspan='2'" : '';
$colspan = $config->systemMode == 'new' ? "colspan='2'" : '';
?>
<?php if($config->systemMode == 'new'):?>
<th <?php echo $rowspan;?> class="w-20px" style="border-right: 0; border-left: 0; background: #32C5FF;"></th>
<?php endif;?>
<th <?php echo $rowspan;?> style="border-left: 0px;"><?php echo $lang->product->unclosedProduct;?></th>
<th <?php echo $rowspan;?>><?php echo $lang->product->unexpiredPlan;?></th>
<th <?php echo $colspan;?>><?php echo $lang->product->doing;?></th>
<th <?php echo $rowspan;?>><?php echo $lang->product->normalRelease;?></th>
</tr>
<?php if($config->systemMode == 'new'):?>
<tr>
<th><?php echo $lang->product->doingProject;?></th>
<th><?php echo $lang->product->doingExecution;;?></th>
<th><?php echo $lang->product->doingExecution;?></th>
</tr>
<?php endif;?>
</thead>
<tbody>
<?php $colorIndex = 0;?>
@@ -47,7 +55,7 @@
if(($doingCounts < $planCounts or $doingCounts < $releaseCount) and ($planCounts > 5 or $releaseCount > 5)) $scroll = 'scroll';
?>
<tr>
<?php if($i == 0):?>
<?php if($i == 0 and $config->systemMode == 'new'):?>
<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 class="product">
@@ -72,6 +80,7 @@
<?php endif;?>
</div>
</td>
<?php if($config->systemMode == 'new'):?>
<td class="project">
<?php if(isset($projectProduct[$productID])):?>
<?php foreach($projectProduct[$productID] as $projectID => $project):?>
@@ -141,6 +150,41 @@
<?php endforeach;?>
<?php endif;?>
</td>
<?php endif;?>
<?php if($config->systemMode == 'classic'):?>
<td class="classicProject">
<div>
<?php if(isset($executionList[$productID])):?>
<?php foreach($executionList[$productID] as $executionID => $execution):?>
<?php
$borderStyle = '';
$delay = helper::diffDate(helper::today(), $execution->end);
$borderStyle = $delay > 0 ? 'border-left: 3px solid red' : 'border-left: 3px solid #0bd986';
?>
<div class="board-item" style="<?php echo $borderStyle;?>">
<div class="table-row">
<div class="table-col text-ellipsis">
<?php if(common::hasPriv('execution', 'task')):?>
<?php echo html::a($this->createLink('execution', 'task', "executionID=$executionID"), $execution->name, '', "title={$execution->name} class='text-ellipsis'");?>
<?php else:?>
<?php echo "<span title={$execution->name}>{$execution->name}</span>"?>
<?php endif;?>
</div>
<div class="table-col">
<div class="c-progress">
<?php $hourList[$executionID] = isset($hourList[$executionID]) ? $hourList[$executionID] : $emptyHour; ?>
<div class='progress-pie' data-doughnut-size='90' data-color='#3CB371' data-value='<?php echo round($hourList[$executionID]->progress);?>' data-width='24' data-height='24' data-back-color='#e8edf3'>
<div class='progress-info'><?php echo round($hourList[$executionID]->progress);?></div>
</div>
</div>
</div>
</div>
</div>
<?php endforeach;?>
<?php endif;?>
</div>
</td>
<?php endif;?>
<td class="release">
<div class="<?php echo $scroll;?>">
<?php if(isset($releaseList[$productID])):?>