From e0cd53d4cf3c9e5483b294964fb3c06ca6faf0f8 Mon Sep 17 00:00:00 2001 From: Catouse Date: Wed, 26 Aug 2020 13:52:18 +0800 Subject: [PATCH] * task #7660, improve UI for cmmigantt block. --- module/block/control.php | 2 +- module/block/js/dashboard.js | 17 ++++---- module/block/view/cmmiganttblock.html.php | 36 ++++++++++------- module/block/view/programteamblock.html.php | 43 ++++++++++----------- module/programplan/model.php | 5 ++- 5 files changed, 56 insertions(+), 47 deletions(-) diff --git a/module/block/control.php b/module/block/control.php index b63a02e337..c70cfc6292 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1118,7 +1118,7 @@ class block extends control $productID = isset($this->session->product) ? 0 : $this->session->product; if($productID && !array_key_exists($productID, $products)) $productID = 0; - $this->view->plans = $this->loadModel('programplan')->getDataForGantt($this->session->program, $productID, 0, 'task'); + $this->view->plans = $this->loadModel('programplan')->getDataForGantt($this->session->program, $productID, 0, 'task', false); $this->view->products = $products; $this->view->productID = $productID; } diff --git a/module/block/js/dashboard.js b/module/block/js/dashboard.js index d18e2fabbb..8eafeb9f3d 100644 --- a/module/block/js/dashboard.js +++ b/module/block/js/dashboard.js @@ -1,7 +1,7 @@ /** * Delete block. - * - * @param int $index + * + * @param int $index * @access public * @return void */ @@ -26,8 +26,8 @@ function deleteBlock(index) /** * Sort blocks. - * - * @param array $orders format is {'blockid' : 1, 'block1' : 2} + * + * @param array $orders format is {'blockid' : 1, 'block1' : 2} * @param function $callback * @access public * @return void @@ -65,7 +65,7 @@ function refreshBlock($panel, afterRefresh) else { $panel.children('.panel-move-handler,style,script').remove(); - $panel.find('.panel-body,.empty-tip').replaceWith($data); + $panel.find('.panel-body,.empty-tip').first().replaceWith($data); } $panel.find('.progress-pie').progressPie(); if($.isFunction(afterRefresh)) @@ -78,6 +78,7 @@ function refreshBlock($panel, afterRefresh) }); } $panel.find('.tablesorter').sortTable(); + $panel.find('.chosen').chosen(); initTableHeader($panel); $(".sparkline").sparkline(); }).fail(function() @@ -121,7 +122,7 @@ function initTableHeader($wrapper) if(!$table.length || !$table.children('thead').length || ($panel.find('#assigntomeBlock').length && $panel.find('#assigntomeBlock > div').length > 1)) return; var isFixed = $panel.find('.panel-body').height() < $table.outerHeight(); - + $panel.toggleClass('with-fixed-header', isFixed); var $header = $panel.children('.table-header-fixed').toggle(isFixed); if(!isFixed) @@ -194,7 +195,7 @@ function checkRefreshProgress($dashboard, doneCallback) * @param index $index * @access public * @return void - */ + */ function hiddenBlock(index) { $.getJSON(createLink('block', 'delete', 'index=' + index + '&module=' + module + '&type=hidden'), function(data) @@ -240,7 +241,7 @@ $(function() { resizeBlock(e.element.data('id'), isSideCol ? 4 : 8); }); - + e.element.toggleClass('block-sm', isSideCol); } }).on('click', '.refresh-panel', function() diff --git a/module/block/view/cmmiganttblock.html.php b/module/block/view/cmmiganttblock.html.php index 0bf2235561..d64cbdee89 100644 --- a/module/block/view/cmmiganttblock.html.php +++ b/module/block/view/cmmiganttblock.html.php @@ -1,6 +1,9 @@
+ +
programplan->noData;?>
+
@@ -9,6 +12,7 @@
+
diff --git a/module/block/view/programteamblock.html.php b/module/block/view/programteamblock.html.php index da67cfe13f..58feb5de83 100644 --- a/module/block/view/programteamblock.html.php +++ b/module/block/view/programteamblock.html.php @@ -8,13 +8,12 @@ $maxConsumed = 0;
- teamCount, $maxTeamCount); $maxConsumed = max($program->consumed, $maxConsumed); ?> -
name;?>
+
name;?>
@@ -47,26 +46,26 @@ $maxConsumed = 0;
diff --git a/module/programplan/model.php b/module/programplan/model.php index 1a66e9cd71..4dd79f4075 100644 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -106,10 +106,11 @@ class programplanModel extends model * @param int $productID * @param int $baselineID * @param string $selectCustom + * @param bool $returnJson * @access public * @return string */ - public function getDataForGantt($programID, $productID, $baselineID = 0, $selectCustom = '') + public function getDataForGantt($programID, $productID, $baselineID = 0, $selectCustom = '', $returnJson = true) { $this->loadModel('stage'); @@ -240,7 +241,7 @@ class programplanModel extends model $datas['data'][$index]->taskProgress = $progress; } - return json_encode($datas); + return $returnJson ? json_encode($datas) : $datas; } public function getTotalPercent($plan)