From 30973efa6a955e7407d10bfe23b63c20427ac59a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=BB=B6=E4=B9=89?= Date: Tue, 27 Sep 2022 08:31:42 +0800 Subject: [PATCH 1/5] * Modify language. --- module/product/lang/de.php | 4 ++-- module/product/lang/en.php | 4 ++-- module/product/lang/fr.php | 4 ++-- module/product/lang/zh-cn.php | 4 ++-- module/product/view/all.html.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/module/product/lang/de.php b/module/product/lang/de.php index 9acbd9b49e..913c2c6eda 100644 --- a/module/product/lang/de.php +++ b/module/product/lang/de.php @@ -37,8 +37,8 @@ $lang->product->addWhitelist = 'Add Whitelist'; $lang->product->unbindWhitelist = 'Remove Whitelist'; $lang->product->track = 'View Stories Matrix'; $lang->product->checkedProducts = '%s products selected'; -$lang->product->pageProducts = 'Total products: %s.'; -$lang->product->pageLines = 'Total product lines: %s, Total products: %s.'; +$lang->product->pageSummary = 'Total products: %s.'; +$lang->product->lineSummary = 'Total product lines: %s, Total products: %s.'; $lang->product->indexAction = "All {$lang->productCommon}"; $lang->product->closeAction = "Close {$lang->productCommon}"; diff --git a/module/product/lang/en.php b/module/product/lang/en.php index 0af7d531d3..bf6a91a961 100644 --- a/module/product/lang/en.php +++ b/module/product/lang/en.php @@ -37,8 +37,8 @@ $lang->product->addWhitelist = 'Add Whitelist'; $lang->product->unbindWhitelist = 'Unbind Whitelist'; $lang->product->track = 'View Stories Matrix'; $lang->product->checkedProducts = '%s products selected'; -$lang->product->pageProducts = 'Total products: %s.'; -$lang->product->pageLines = 'Total product lines: %s, Total products: %s.'; +$lang->product->pageSummary = 'Total products: %s.'; +$lang->product->lineSummary = 'Total product lines: %s, Total products: %s.'; $lang->product->indexAction = "All {$lang->productCommon}"; $lang->product->closeAction = "Close {$lang->productCommon}"; diff --git a/module/product/lang/fr.php b/module/product/lang/fr.php index 6ba1e4179a..6154559fac 100644 --- a/module/product/lang/fr.php +++ b/module/product/lang/fr.php @@ -37,8 +37,8 @@ $lang->product->addWhitelist = 'Add Whitelist'; $lang->product->unbindWhitelist = 'Remove Whitelist'; $lang->product->track = 'Consulter Stories Matrice'; $lang->product->checkedProducts = '%s produits s électionnés'; -$lang->product->pageProducts = 'Total products: %s.'; -$lang->product->pageLines = 'Total product lines: %s, Total products: %s.'; +$lang->product->pageSummary = 'Total products: %s.'; +$lang->product->lineSummary = 'Total product lines: %s, Total products: %s.'; $lang->product->indexAction = "All {$lang->productCommon}"; $lang->product->closeAction = "Fermer {$lang->productCommon}"; diff --git a/module/product/lang/zh-cn.php b/module/product/lang/zh-cn.php index 336926a768..6d33a54d1f 100644 --- a/module/product/lang/zh-cn.php +++ b/module/product/lang/zh-cn.php @@ -37,8 +37,8 @@ $lang->product->addWhitelist = '添加白名单'; $lang->product->unbindWhitelist = '移除白名单'; $lang->product->track = "查看需求矩阵"; $lang->product->checkedProducts = '已选择%s项产品'; -$lang->product->pageProducts = '本页共%s个产品。'; -$lang->product->pageLines = '本页共%s个产品线,%s个产品。'; +$lang->product->pageSummary = '本页共%s个产品。'; +$lang->product->lineSummary = '本页共%s个产品线,%s个产品。'; $lang->product->indexAction = "所有{$lang->productCommon}仪表盘"; $lang->product->closeAction = "关闭{$lang->productCommon}"; diff --git a/module/product/view/all.html.php b/module/product/view/all.html.php index 1d85479802..ace8e852ff 100644 --- a/module/product/view/all.html.php +++ b/module/product/view/all.html.php @@ -253,8 +253,8 @@
product->pageProducts, count($productStats)) : sprintf($lang->product->pageLines, count($lineNames), count($productStats)); - echo "
$content
"; + $summary = empty($productLines) ? sprintf($lang->product->pageSummary, count($productStats)) : sprintf($lang->product->lineSummary, count($lineNames), count($productStats)); + echo "
$summary
"; ?>
Date: Tue, 27 Sep 2022 09:59:14 +0800 Subject: [PATCH 2/5] * Code for task #70495. --- module/task/control.php | 11 ++++--- module/task/css/recordestimate.css | 3 ++ module/task/js/recordestimate.js | 20 ++++++++++++- module/task/view/lineareffort.html.php | 38 ++++++++++++++++-------- module/task/view/recordestimate.html.php | 7 +++-- 5 files changed, 58 insertions(+), 21 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 2f077c93b0..f3efbc6931 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -1112,10 +1112,11 @@ class task extends control * * @param int $taskID * @param string $from + * @param string $orderBy * @access public * @return void */ - public function recordEstimate($taskID, $from = '') + public function recordEstimate($taskID, $from = '', $orderBy = '') { $this->commonAction($taskID); @@ -1174,12 +1175,14 @@ class task extends control $this->session->set('estimateList', $uri, 'execution'); if(isonlybody()) $this->session->set('estimateList', $uri . (strpos($uri, '?') === false ? '?' : '&') . 'onlybody=yes', 'execution'); - $task = $this->task->getById($taskID); - $orderBy = 'date,id'; - if(!empty($task->team) and $task->mode == 'linear') $orderBy = 'order,date,id'; + $task = $this->task->getById($taskID); + if(!empty($task->team) and $task->mode == 'linear' and !$orderBy) $orderBy = 'order_asc'; + if(!$orderBy) $orderBy = 'date_asc'; $this->view->title = $this->lang->task->record; $this->view->task = $task; + $this->view->from = $from; + $this->view->orderBy = $orderBy; $this->view->efforts = $this->task->getTaskEstimate($taskID, '', '', $orderBy); $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); $this->display(); diff --git a/module/task/css/recordestimate.css b/module/task/css/recordestimate.css index 1bf2b838aa..df6eb85fc4 100644 --- a/module/task/css/recordestimate.css +++ b/module/task/css/recordestimate.css @@ -18,3 +18,6 @@ .main-header ul.hours:after{content:")"} .body-modal .main-header>h2 { max-width: 70% !important; margin-right:0px;} .table-record .form-date {border-right: none;} + +.table.has-sort-head thead>tr>th>a:after, .table.has-sort-head thead>tr>th>a:before {top: -7px;} +.table.has-sort-head thead>tr>th>a:hover, .table.has-sort-head thead>tr>th>a:hover:after, .table.has-sort-head thead>tr>th>a:hover:before {color: #000;} diff --git a/module/task/js/recordestimate.js b/module/task/js/recordestimate.js index 0ae15d69f2..e10c2adf66 100644 --- a/module/task/js/recordestimate.js +++ b/module/task/js/recordestimate.js @@ -1,5 +1,24 @@ $(function() { + /* Set default tab. */ + if($.cookie('recordEstimateType') == 'all') + { + $('#recordForm').addClass('hidden'); + $('.my-effort, #legendMyEffort').removeClass('active'); + $('.all-effort, #legendAllEffort').addClass('active'); + } + else + { + $('.my-effort, #legendMyEffort').addClass('active'); + $('#recordForm').removeClass('hidden'); + } + $.cookie('recordEstimateType', null); + + $('.order-btn').on('click', function() + { + $.cookie('recordEstimateType', 'all'); + }); + /* Hide creation logs when displaying team logs. */ $('#linearefforts .tabs ul > li').click(function() { @@ -7,7 +26,6 @@ $(function() $('#recordForm').toggleClass('hidden', tab == '#legendAllEffort'); }); - $('.form-date').datetimepicker('setEndDate', today); $("#recordForm #submit").click(function(e, confirmed) diff --git a/module/task/view/lineareffort.html.php b/module/task/view/lineareffort.html.php index f9f6ad8aaf..9dc02d3971 100644 --- a/module/task/view/lineareffort.html.php +++ b/module/task/view/lineareffort.html.php @@ -16,9 +16,13 @@ foreach($task->team as $team) $teamOrders[$team->order] = $team->account; $myOrders = array(); $allEfforts = array(); $recorders = array(); -foreach($efforts as $effort) +$index = 0; +$allOrders = array(); +$efforts = array_values($efforts); +foreach($efforts as $key => $effort) { - $order = $effort->order; + $prevEffort = $key > 0 ? $efforts[$key - 1] : null; + $order = (!$prevEffort or $prevEffort->order == $effort->order) ? $index : ++$index; $account = $effort->account; $allEfforts[$order][] = $effort; $recorders[$order][$account] = $account; @@ -27,22 +31,29 @@ foreach($efforts as $effort) if(!isset($myOrders[$order])) $myOrders[$order] = 0; $myOrders[$order] += 1; } + $allOrders[$order] = $effort->order + 1; } ?>
-
+
- +
- - + id&from=$from&orderBy=%s"; + $sort = explode(',', $orderBy); + $orderBy = zget($sort, '0', ''); + if(!strpos($orderBy, '_')) $orderBy .= '_asc'; + ?> + + @@ -58,7 +69,7 @@ foreach($efforts as $effort) account != $this->app->user->account) continue;?> - + @@ -84,11 +95,12 @@ foreach($efforts as $effort)
-
task->teamOrder;?>task->date;?>task->teamOrder);?>task->date);?> task->recordedBy;?> task->work;?> task->consumedAB;?>
date;?>
+
- - + id&from=$from&orderBy=%s";?> + + @@ -103,7 +115,7 @@ foreach($efforts as $effort) - + diff --git a/module/task/view/recordestimate.html.php b/module/task/view/recordestimate.html.php index 88be99f99e..4c00a762ac 100644 --- a/module/task/view/recordestimate.html.php +++ b/module/task/view/recordestimate.html.php @@ -56,10 +56,11 @@ if(!empty($members) && $task->mode == 'linear') team) and $task->mode == 'linear'):?> -
task->teamOrder;?>task->date;?>task->teamOrder);?>task->date);?> task->recordedBy;?> task->work;?> task->consumedAB;?>
date;?>
+
- + id&from=$from&orderBy=%s";?> + @@ -100,7 +101,7 @@ if(!empty($members) && $task->mode == 'linear') - + Date: Tue, 27 Sep 2022 10:04:34 +0800 Subject: [PATCH 3/5] * Adjust code. --- module/task/view/lineareffort.html.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/task/view/lineareffort.html.php b/module/task/view/lineareffort.html.php index 9dc02d3971..2cc191da53 100644 --- a/module/task/view/lineareffort.html.php +++ b/module/task/view/lineareffort.html.php @@ -22,9 +22,10 @@ $efforts = array_values($efforts); foreach($efforts as $key => $effort) { $prevEffort = $key > 0 ? $efforts[$key - 1] : null; - $order = (!$prevEffort or $prevEffort->order == $effort->order) ? $index : ++$index; - $account = $effort->account; - $allEfforts[$order][] = $effort; + $order = (!$prevEffort or $prevEffort->order == $effort->order) ? $index : ++$index; + $account = $effort->account; + + $allEfforts[$order][] = $effort; $recorders[$order][$account] = $account; if($app->user->account == $account) { From ff8f0ebbea0beae2653266b3d1d98a999a573d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=BB=B6=E4=B9=89?= Date: Tue, 27 Sep 2022 10:37:54 +0800 Subject: [PATCH 4/5] * Modify project title. --- module/project/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/model.php b/module/project/model.php index 1c27eee429..bfac3be50a 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1979,7 +1979,7 @@ class projectModel extends model if($id == 'name') { $class .= ' text-left'; - $title = "title='{$project->name} ({$this->lang->project->{$project->model}})'"; + $title = "title='{$project->name}" . ($this->config->vision == 'lite' ? "'" : "({$this->lang->project->{$project->model}})'"); } if($id == 'end') From c9f757c6352c7af5769eafc1971eb9f6bb358e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=BB=B6=E4=B9=89?= Date: Tue, 27 Sep 2022 13:23:37 +0800 Subject: [PATCH 5/5] * Adjust code. --- module/product/view/all.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/product/view/all.html.php b/module/product/view/all.html.php index ace8e852ff..88462b928b 100644 --- a/module/product/view/all.html.php +++ b/module/product/view/all.html.php @@ -253,7 +253,7 @@
product->pageSummary, count($productStats)) : sprintf($lang->product->lineSummary, count($lineNames), count($productStats)); + $summary = empty($productLines) ? sprintf($lang->product->pageSummary, count($productStats)) : sprintf($lang->product->lineSummary, count($lineNames), count($productStats)); echo "
$summary
"; ?>
task->date;?>task->date);?> task->recordedBy;?> task->work;?> task->consumed;?>