From 19aaf9740c4e7b65936bcfdcc8bf6e69d186e571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Fri, 14 Jan 2022 14:31:59 +0800 Subject: [PATCH] * Fix details and add upgrade logic. --- module/execution/lang/en.php | 5 ++++- module/execution/lang/zh-cn.php | 3 +++ module/kanban/js/view.js | 1 + module/project/css/index.css | 2 +- module/project/view/index.html.php | 8 ++++++++ module/upgrade/model.php | 31 +++++++++++++++++++++++++++--- 6 files changed, 45 insertions(+), 5 deletions(-) diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 7bc628095b..3f3905ff27 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -164,7 +164,7 @@ global $config; if($config->systemMode == 'new') { $lang->execution->aclList['private'] = 'Private (for team members and execution stakeholders)'; - $lang->execution->aclList['open'] = 'Inherited Execution ACL (for who can access the current execution)'; + $lang->execution->aclList['open'] = 'Inherited Project ACL (for who can access the current project)'; } else { @@ -172,6 +172,9 @@ else $lang->execution->aclList['open'] = "Public (Users who can visit {$lang->executionCommon} can access it.)"; } +$lang->execution->kanbanAclList['private'] = 'Private'; +$lang->execution->kanbanAclList['open'] = 'Inherited Project'; + $lang->execution->storyPoint = 'Story Point'; $lang->execution->burnByList['left'] = 'View by remaining hours'; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 208d7ab166..148047ed53 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -172,6 +172,9 @@ else $lang->execution->aclList['open'] = "公开(有{$lang->executionCommon}视图权限即可访问)"; } +$lang->execution->kanbanAclList['private'] = '私有'; +$lang->execution->kanbanAclList['open'] = '继承项目'; + $lang->execution->storyPoint = '故事点'; $lang->execution->burnByList['left'] = '按剩余工时查看'; diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index bae556df3f..7ec9e82ef2 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -463,6 +463,7 @@ function updateRegion(regionID, regionData = []) if(!regionData) regionData = regions[regionID]; $region.data('zui.kanban').render(regionData.groups); + resetRegionHeight('open'); return true; } diff --git a/module/project/css/index.css b/module/project/css/index.css index 9b4d305bec..ce1b9580f7 100644 --- a/module/project/css/index.css +++ b/module/project/css/index.css @@ -21,7 +21,7 @@ #cards .kanban-members > span:before {left: -4px;} #cards .kanban-members > span:after {right: -4px;} #cards .kanban-members-total {display: inline-block; margin-left: 6px; position: relative; top: 3px} -#cards .kanbanAcl {position: absolute; right: 0px; bottom: 2px; color: #838a9d;} +#cards .kanbanAcl {position: absolute; right: 0px; bottom: 0px; color: #838a9d;} .kanbans .kanban-actions {float: right; visibility: hidden;} .kanbans .kanban-actions .dropdown-menu.pull-right {top:31px; right: -84px; left: auto;} diff --git a/module/project/view/index.html.php b/module/project/view/index.html.php index 8ca002d7b9..7bb8010911 100644 --- a/module/project/view/index.html.php +++ b/module/project/view/index.html.php @@ -97,7 +97,15 @@ +
project->teamSumCount, count($members));?>
+
+ + acl == 'private') $icon = 'lock';?> + acl == 'extend') $icon = 'inherit-space';?> + + execution->kanbanAclList, $kanban->acl, '');?> +
diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 6f1b48d905..a1ccf11096 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -5373,6 +5373,7 @@ class upgradeModel extends model */ public function moveKanbanData() { + /* Move common kanban data. */ $cards = $this->dao->select('id,kanban,`column`,lane')->from(TABLE_KANBANCARD)->fetchAll('id'); $cellGroup = array(); @@ -5398,13 +5399,37 @@ class upgradeModel extends model $this->dao->insert(TABLE_KANBANCELL)->data($cell)->exec(); } - $lanePairs = $this->dao->select('id')->from(TABLE_KANBANLANE)->where('execution')->gt(0)->fetchPairs(); - $this->dao->delete()->from(TABLE_KANBANLANE)->where('execution')->gt(0)->exec(); - $this->dao->delete()->from(TABLE_KANBANCOLUMN)->where('lane')->in($lanePairs)->exec(); + /* Drop group kanban data. */ + $groupLanePairs = $this->dao->select('id')->from(TABLE_KANBANLANE)->where('`groupby`')->ne('')->fetchPairs(); + $this->dao->delete()->from(TABLE_KANBANLANE)->where('id')->in($groupLanePairs)->exec(); + $this->dao->delete()->from(TABLE_KANBANCOLUMN)->where('lane')->in($groupLanePairs)->exec(); + /* Move execution kanban data. */ + $executionKanban = $this->dao->select('t1.id as `lane`, t1.execution, t1.type, t2.id as `column`, t2.cards')->from(TABLE_KANBANLANE)->alias('t1') + ->leftJoin(TABLE_KANBANCOLUMN)->alias('t2')->on('t1.id = t2.lane') + ->where('t1.execution')->gt(0) + ->fetchGroup('lane'); + + foreach($executionKanban as $laneID => $laneGroup) + { + foreach($laneGroup as $colData) + { + $cell = new stdclass(); + $cell->kanban = $colData->execution; + $cell->lane = $laneID; + $cell->column = $colData->column; + $cell->type = $colData->type; + $cell->cards = $colData->cards; + + $this->dao->insert(TABLE_KANBANCELL)->data($cell)->exec(); + } + } + + /* Drop unused field. */ $this->dao->exec("ALTER TABLE " . TABLE_KANBANCARD . " DROP COLUMN `lane`;"); $this->dao->exec("ALTER TABLE " . TABLE_KANBANCARD . " DROP COLUMN `column`;"); $this->dao->exec("ALTER TABLE " . TABLE_KANBANCOLUMN . " DROP COLUMN `lane`;"); + $this->dao->exec("ALTER TABLE " . TABLE_KANBANCOLUMN . " DROP COLUMN `cards`;"); } /**