Merge branch 'sgm_kanban' into 'kanban'

* Fix details and add upgrade logic.

See merge request easycorp/zentaopms!1411
This commit is contained in:
王怡栋
2022-01-14 06:37:28 +00:00
6 changed files with 45 additions and 5 deletions

View File

@@ -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';

View File

@@ -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'] = '按剩余工时查看';

View File

@@ -463,6 +463,7 @@ function updateRegion(regionID, regionData = [])
if(!regionData) regionData = regions[regionID];
$region.data('zui.kanban').render(regionData.groups);
resetRegionHeight('open');
return true;
}

View File

@@ -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;}

View File

@@ -97,7 +97,15 @@
</div>
<?php endif;?>
</div>
<div class='kanban-members-total pull-left'><?php echo sprintf($lang->project->teamSumCount, count($members));?></div>
<?php endif;?>
<div class='kanbanAcl'>
<?php $icon = 'unlock';?>
<?php if($kanban->acl == 'private') $icon = 'lock';?>
<?php if($kanban->acl == 'extend') $icon = 'inherit-space';?>
<i class="<?php echo 'icon-' . $icon;?>"></i>
<?php echo zget($lang->execution->kanbanAclList, $kanban->acl, '');?>
</div>
</div>
</div>
</div>

View File

@@ -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`;");
}
/**