From a69ffad7605078880a75bda4464dc8bdc7cde51e Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 6 Sep 2021 09:30:05 +0800 Subject: [PATCH] * Product Kanban is compatible with the classic model. --- module/product/control.php | 1 + module/product/css/kanban.css | 9 +++-- module/product/model.php | 18 +++++---- module/product/view/kanban.html.php | 58 +++++++++++++++++++++++++---- 4 files changed, 69 insertions(+), 17 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index d6d3a47a52..58bdeeace2 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -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; diff --git a/module/product/css/kanban.css b/module/product/css/kanban.css index 13e8cba18f..eba3633328 100644 --- a/module/product/css/kanban.css +++ b/module/product/css/kanban.css @@ -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;} diff --git a/module/product/model.php b/module/product/model.php index 7f5169436c..ff9d2d910e 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -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); } /** diff --git a/module/product/view/kanban.html.php b/module/product/view/kanban.html.php index 2092f8d447..8baf4088f8 100644 --- a/module/product/view/kanban.html.php +++ b/module/product/view/kanban.html.php @@ -23,16 +23,24 @@ product->myProduct : $lang->product->otherProduct;?> - - product->unclosedProduct;?> - product->unexpiredPlan;?> - product->doing;?> - product->normalRelease;?> + systemMode == 'new' ? "rowspan='2'" : ''; + $colspan = $config->systemMode == 'new' ? "colspan='2'" : ''; + ?> + systemMode == 'new'):?> + class="w-20px" style="border-right: 0; border-left: 0; background: #32C5FF;"> + + style="border-left: 0px;">product->unclosedProduct;?> + >product->unexpiredPlan;?> + >product->doing;?> + >product->normalRelease;?> + systemMode == 'new'):?> product->doingProject;?> - product->doingExecution;;?> + product->doingExecution;?> + @@ -47,7 +55,7 @@ if(($doingCounts < $planCounts or $doingCounts < $releaseCount) and ($planCounts > 5 or $releaseCount > 5)) $scroll = 'scroll'; ?> - + systemMode == 'new'):?> @@ -72,6 +80,7 @@ + systemMode == 'new'):?> $project):?> @@ -141,6 +150,41 @@ + + systemMode == 'classic'):?> + +
+ + $execution):?> + end); + $borderStyle = $delay > 0 ? 'border-left: 3px solid red' : 'border-left: 3px solid #0bd986'; + ?> +
+
+
+ + createLink('execution', 'task', "executionID=$executionID"), $execution->name, '', "title={$execution->name} class='text-ellipsis'");?> + + name}>{$execution->name}"?> + +
+
+
+ +
+
progress);?>
+
+
+
+
+
+ + +
+ +