* Finish task #54349.

This commit is contained in:
liumengyi
2022-05-17 14:50:31 +08:00
parent f19a716ba0
commit fb4e586acf
11 changed files with 68 additions and 16 deletions
+1 -1
View File
@@ -476,7 +476,7 @@ $lang->company->menuOrder[30] = 'addUser';
$lang->admin->menu = new stdclass();
$lang->admin->menu->index = array('link' => "$lang->indexPage|admin|index", 'alias' => 'register,certifytemail,certifyztmobile,ztcompany');
$lang->admin->menu->company = array('link' => "{$lang->personnel->common}|company|browse|", 'subModule' => ',user,dept,group,');
$lang->admin->menu->model = array('link' => "$lang->model|custom|browsestoryconcept|", 'class' => 'dropdown dropdown-hover', 'exclude' => 'custom-index,custom-set,custom-product,custom-execution,custom-required,custom-flow,custom-score,custom-feedback,custom-timezone,custom-mode');
$lang->admin->menu->model = array('link' => "$lang->model|custom|browsestoryconcept|", 'class' => 'dropdown dropdown-hover', 'exclude' => 'custom-index,custom-set,custom-product,custom-execution,custom-kanban,custom-required,custom-flow,custom-score,custom-feedback,custom-timezone,custom-mode');
$lang->admin->menu->custom = array('link' => "{$lang->custom->common}|custom|index", 'exclude' => 'custom-browsestoryconcept,custom-timezone,custom-estimate');
$lang->admin->menu->extension = array('link' => "{$lang->extension->common}|extension|browse", 'subModule' => 'extension');
$lang->admin->menu->dev = array('link' => "$lang->redev|dev|api", 'alias' => 'db', 'subModule' => 'dev,editor,entry');
+21
View File
@@ -518,6 +518,27 @@ class custom extends control
$this->display();
}
/**
* Set whether the kanban is read-only.
*
* @access public
* @return void
*/
public function kanban()
{
if($_POST)
{
$this->loadModel('setting')->setItem("system.common.CRKanban@{$this->config->vision}", $this->post->kanban);
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload'));
}
$this->view->title = $this->lang->custom->kanban;
$this->view->position[] = $this->lang->custom->common;
$this->view->position[] = $this->view->title;
$this->display();
}
/**
* Set flow.
*
+7
View File
@@ -49,6 +49,7 @@ $lang->custom->switch = "Switch";
$lang->custom->oneUnit = "One {$lang->hourCommon}";
$lang->custom->convertRelationTitle = "Please firstly set the conversion factor from {$lang->hourCommon} to %s";
$lang->custom->superReviewers = "Super Reviewer";
$lang->custom->kanban = "Kanban";
if($config->systemMode == 'new') $lang->custom->execution = 'Execution';
if($config->systemMode == 'classic' || !$config->systemMode) $lang->custom->execution = $lang->executionCommon;
@@ -79,11 +80,13 @@ $lang->custom->saveTips = 'After clicking save, the current %s will b
$lang->custom->numberError = 'The interval must be greater than zero!';
$lang->custom->closedExecution = 'Closed ' . $lang->executionCommon;
$lang->custom->closedKanban = 'Closed ' . $lang->custom->kanban;
$lang->custom->closedProduct = 'Closed ' . $lang->productCommon;
if($config->systemMode == 'new') $lang->custom->object['project'] = 'Project';
$lang->custom->object['product'] = $lang->productCommon;
$lang->custom->object['execution'] = $lang->custom->execution;
$lang->custom->object['kanban'] = $lang->custom->kanban;
$lang->custom->object['story'] = 'Story';
$lang->custom->object['task'] = 'Task';
$lang->custom->object['bug'] = 'Bug';
@@ -174,6 +177,7 @@ $lang->custom->notice->conceptResult = 'According to your preference, <b>
$lang->custom->notice->conceptPath = 'Go to Admin -> Custom -> Concept to set it.';
$lang->custom->notice->readOnlyOfProduct = 'If Change Forbidden, any change on stories, bugs, cases, efforts, releases and plans of the closed product is also forbidden.';
$lang->custom->notice->readOnlyOfExecution = "If Change Forbidden, any change on tasks, builds, efforts and stories of the closed {$lang->executionCommon} is also forbidden.";
$lang->custom->notice->readOnlyOfKanban = "If Change Forbidden, any change on kanban card and related operations of {$lang->custom->kanban} is also forbidden.";
$lang->custom->notice->URSREmpty = 'Custom requirement name can not be empty!';
$lang->custom->notice->confirmDelete = 'Are you sure you want to delete it?';
$lang->custom->notice->confirmReviewCase = 'Set the case in Wait to Normal?';
@@ -232,6 +236,9 @@ $lang->custom->CRProduct[0] = 'Change Forbidden';
$lang->custom->CRExecution[1] = 'Change Allowed';
$lang->custom->CRExecution[0] = 'Change Forbidden';
$lang->custom->CRKanban[1] = 'Change Allowed';
$lang->custom->CRKanban[0] = 'Change Forbidden';
$lang->custom->moduleName['product'] = $lang->productCommon;
$lang->custom->moduleName['productplan'] = 'Plan';
$lang->custom->moduleName['execution'] = $lang->custom->execution;
+7
View File
@@ -49,6 +49,7 @@ $lang->custom->switch = "切换";
$lang->custom->oneUnit = "一个{$lang->hourCommon}";
$lang->custom->convertRelationTitle = "请先设置{$lang->hourCommon}转换为%s的换算系数";
$lang->custom->superReviewers = "超级评审人";
$lang->custom->kanban = "看板";
if($config->systemMode == 'new') $lang->custom->execution = '执行';
if($config->systemMode == 'classic' || !$config->systemMode) $lang->custom->execution = $lang->executionCommon;
@@ -79,11 +80,13 @@ $lang->custom->saveTips = '点击保存后,则以当前%s为默认
$lang->custom->numberError = '区间必须大于零';
$lang->custom->closedExecution = '已关闭' . $lang->custom->execution;
$lang->custom->closedKanban = '已关闭' . $lang->custom->kanban;
$lang->custom->closedProduct = '已关闭' . $lang->productCommon;
if($config->systemMode == 'new') $lang->custom->object['project'] = '项目';
$lang->custom->object['product'] = $lang->productCommon;
$lang->custom->object['execution'] = $lang->custom->execution;
$lang->custom->object['kanban'] = $lang->custom->kanban;
$lang->custom->object['story'] = $lang->SRCommon;
$lang->custom->object['task'] = '任务';
$lang->custom->object['bug'] = 'Bug';
@@ -174,6 +177,7 @@ $lang->custom->notice->conceptResult = '我们已经根据您的选择为
$lang->custom->notice->conceptPath = '您可以在:后台 -> 自定义 -> 流程页面修改。';
$lang->custom->notice->readOnlyOfProduct = '禁止修改后,已关闭' . $lang->productCommon . '下的' . $lang->SRCommon . '、Bug、用例、日志、发布、计划都禁止修改。';
$lang->custom->notice->readOnlyOfExecution = "禁止修改后,已关闭{$lang->custom->execution}下的任务、版本、日志以及关联需求都禁止修改。";
$lang->custom->notice->readOnlyOfKanban = "禁止修改后,已关闭{$lang->custom->kanban}下的卡片以及相关设置都禁止修改。";
$lang->custom->notice->URSREmpty = '自定义需求名称不能为空!';
$lang->custom->notice->confirmDelete = '您确定要删除吗?';
$lang->custom->notice->confirmReviewCase = '是否将待评审的用例修改为正常状态?';
@@ -232,6 +236,9 @@ $lang->custom->CRProduct[0] = '禁止修改';
$lang->custom->CRExecution[1] = '允许修改';
$lang->custom->CRExecution[0] = '禁止修改';
$lang->custom->CRKanban[1] = '允许修改';
$lang->custom->CRKanban[0] = '禁止修改';
$lang->custom->moduleName['product'] = $lang->productCommon;
$lang->custom->moduleName['productplan'] = '计划';
$lang->custom->moduleName['execution'] = $lang->custom->execution;
+2 -2
View File
@@ -5,8 +5,8 @@
foreach($lang->custom->object as $object => $name)
{
if(strpos('story|todo|block', $object) !== false) echo "<span class='divider'></span>";
if(strpos('execution|product', $object) !== false) common::printLink('custom', $object, "", "<span class='text'>{$lang->custom->$object}</span>", '', "class='btn btn-link' id='{$object}Tab'");
if(strpos('execution|product', $object) === false) common::printLink('custom', 'set', "module=$object&field=" . key($lang->custom->{$object}->fields), "<span class='text'>{$name}</span>", '', "class='btn btn-link' id='{$object}Tab'");
if(strpos('execution|product|kanban', $object) !== false) common::printLink('custom', $object, "", "<span class='text'>{$lang->custom->$object}</span>", '', "class='btn btn-link' id='{$object}Tab'");
if(strpos('execution|product|kanban', $object) === false) common::printLink('custom', 'set', "module=$object&field=" . key($lang->custom->{$object}->fields), "<span class='text'>{$name}</span>", '', "class='btn btn-link' id='{$object}Tab'");
if($object == 'user') common::printLink('custom', 'required', "", "<span class='text'>{$lang->custom->required}</span>", '', "class='btn btn-link' id='requiredTab'");
}
+3
View File
@@ -741,6 +741,9 @@ class kanban extends control
}
}
$region = $this->kanban->getRegionByID($regionID);
$this->view->kanban = $this->kanban->getByID($region->kanban);
$this->view->columns = $columnsData;
$this->display();
+10
View File
@@ -40,6 +40,7 @@ function fullScreen()
$('.action').hide();
$('.kanban-group-header').hide();
$(".title").attr("disabled", true).css("pointer-events", "none");
$('.kanban-col.kanban-header-col').css('padding', '0px 0px 0px 0px');
window.sortableDisabled = true;
$.cookie('isFullScreen', 1);
};
@@ -76,12 +77,15 @@ function fullScreen()
*/
function exitFullScreen()
{
$('.region-actions > div > .action').show();
if(kanban.status == 'closed') return;
$('#kanbanContainer').removeClass('fullscreen')
.off('scroll', tryUpdateKanbanAffix);
$('.actions').show();
$('.action').show();
$('.kanban-group-header').show();
$(".title").attr("disabled", false).css("pointer-events", "auto");
$('.kanban-col.kanban-header-col').css('padding', '0px 30px');
window.sortableDisabled = false;
$.cookie('isFullScreen', 0);
}
@@ -1408,6 +1412,12 @@ $(function()
initSortable();
resetRegionHeight('open');
if(!CRKanban && kanban.status == "closed")
{
fullScreen();
$('.region-actions > div > .action').show();
}
});
function initSortable()
+11 -9
View File
@@ -2940,24 +2940,26 @@ class kanbanModel extends model
$actions .= "<div class='btn-group'>";
$actions .= "<a href='javascript:fullScreen();' id='fullScreenBtn' $btnColor class='btn btn-link'><i class='icon icon-fullscreen'></i> {$this->lang->kanban->fullScreen}</a>";
$printSettingBtn = (common::hasPriv('kanban', 'createRegion') or $printSetHeightBtn or common::hasPriv('kanban', 'performable') or common::hasPriv('kanban', 'edit') or common::hasPriv('kanban', 'close') or common::hasPriv('kanban', 'enableArchived') or common::hasPriv('kanban', 'delete'));
$CRKanban = ($this->config->CRKanban or $kanban->status != 'closed');
$printRegionBtn = ($CRKanban and (common::hasPriv('kanban', 'createRegion') or $printSetHeightBtn or common::hasPriv('kanban', 'performable') or common::hasPriv('kanban', 'enableArchived') or common::hasPriv('kanban', 'import') or common::hasPriv('kanban', 'setColumnWidth')));
$printKanbanBtn = (common::hasPriv('kanban', 'edit') or common::hasPriv('kanban', 'close') or common::hasPriv('kanban', 'delete'));
if($printSettingBtn)
if($printRegionBtn or $printKanbanBtn)
{
$actions .= "<a data-toggle='dropdown' $btnColor class='btn btn-link dropdown-toggle setting' type='button'>" . '<i class="icon icon-cog-outline"></i> ' . $this->lang->kanban->setting . '</a>';
$actions .= "<ul id='kanbanActionMenu' class='dropdown-menu text-left'>";
if(common::hasPriv('kanban', 'createRegion')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'createRegion', "kanbanID=$kanban->id", '', true), '<i class="icon icon-plus"></i>' . $this->lang->kanban->createRegion, '', "class='iframe btn btn-link'") . '</li>';
if(common::hasPriv('kanban', 'createRegion') and $CRKanban) $actions .= '<li>' . html::a(helper::createLink('kanban', 'createRegion', "kanbanID=$kanban->id", '', true), '<i class="icon icon-plus"></i>' . $this->lang->kanban->createRegion, '', "class='iframe btn btn-link'") . '</li>';
$importWidth = $this->app->getClientLang() == 'en' ? '700' : '550';
if(common::hasPriv('kanban', 'import')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'import', "kanbanID=$kanban->id", '', true), '<i class="icon icon-import"></i>' . $this->lang->kanban->import, '', "class='iframe btn btn-link' data-width=$importWidth") . '</li>';
if(common::hasPriv('kanban', 'enableArchived')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'enableArchived', "kanbanID=$kanban->id", '', true), '<i class="icon icon-card-archive"></i>' . $this->lang->kanban->archived, '', "class='iframe btn btn-link' data-width=400") . '</li>';
if($printSetHeightBtn)
if(common::hasPriv('kanban', 'import') and $CRKanban) $actions .= '<li>' . html::a(helper::createLink('kanban', 'import', "kanbanID=$kanban->id", '', true), '<i class="icon icon-import"></i>' . $this->lang->kanban->import, '', "class='iframe btn btn-link' data-width=$importWidth") . '</li>';
if(common::hasPriv('kanban', 'enableArchived') and $CRKanban) $actions .= '<li>' . html::a(helper::createLink('kanban', 'enableArchived', "kanbanID=$kanban->id", '', true), '<i class="icon icon-card-archive"></i>' . $this->lang->kanban->archived, '', "class='iframe btn btn-link' data-width=400") . '</li>';
if($printSetHeightBtn and $CRKanban)
{
$width = $this->app->getClientLang() == 'en' ? '750' : '650';
$actions .= '<li>' . html::a(helper::createLink('kanban', 'setLaneHeight', "kanbanID=$kanban->id", '', true), '<i class="icon icon-size-height"></i>' . $this->lang->kanban->laneHeight, '', "class='iframe btn btn-link' data-width='$width'") . '</li>';
}
if(common::hasPriv('kanban', 'setColumnWidth')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'setColumnWidth', "kanbanID=$kanban->id", '', true), '<i class="icon icon-size-width"></i>' . $this->lang->kanban->columnWidth, '', "class='iframe btn btn-link' data-width=400") . '</li>';
if(common::hasPriv('kanban', 'performable')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'performable', "kanbanID=$kanban->id", '', true), '<i class="icon icon-checked"></i>' . $this->lang->kanban->manageProgress, '', "class='iframe btn btn-link' data-width=40%") . '</li>';
if(common::hasPriv('kanban', 'setColumnWidth') and $CRKanban) $actions .= '<li>' . html::a(helper::createLink('kanban', 'setColumnWidth', "kanbanID=$kanban->id", '', true), '<i class="icon icon-size-width"></i>' . $this->lang->kanban->columnWidth, '', "class='iframe btn btn-link' data-width=400") . '</li>';
if(common::hasPriv('kanban', 'performable') and $CRKanban) $actions .= '<li>' . html::a(helper::createLink('kanban', 'performable', "kanbanID=$kanban->id", '', true), '<i class="icon icon-checked"></i>' . $this->lang->kanban->manageProgress, '', "class='iframe btn btn-link' data-width=40%") . '</li>';
$kanbanActions = '';
$attr = $kanban->status == 'closed' ? "disabled='disabled'" : '';
@@ -2966,7 +2968,7 @@ class kanbanModel extends model
if(common::hasPriv('kanban', 'delete')) $kanbanActions .= '<li>' . html::a(helper::createLink('kanban', 'delete', "kanbanID=$kanban->id"), '<i class="icon icon-trash"></i>' . $this->lang->kanban->delete, 'hiddenwin', "class='btn btn-link'") . '</li>';
if($kanbanActions)
{
$actions .= ((common::hasPriv('kanban', 'createRegion') or $printSetHeightBtn or common::hasPriv('kanban', 'performable') or common::hasPriv('kanban', 'setColumnWidth')) and (common::hasPriv('kanban', 'edit') or common::hasPriv('kanban', 'close') or common::hasPriv('kanban', 'enableArchived') or common::hasPriv('kanban', 'delete'))) ? "<li class='divider'></li>" . $kanbanActions : $kanbanActions;
$actions .= $printRegionBtn ? "<li class='divider'></li>" . $kanbanActions : $kanbanActions;
}
$actions .= "</ul>";
}
+1
View File
@@ -21,6 +21,7 @@ $laneCount = 0;
foreach($regions as $region) $laneCount += $region->laneCount;
js::set('vision', $this->config->vision);
js::set('CRKanban', $this->config->CRKanban);
js::set('regions', $regions);
js::set('kanban', $kanban);
js::set('kanbanLang', $lang->kanban);
+3 -2
View File
@@ -172,8 +172,9 @@ $app->loadLang('productplan');
</div>
<div class='col-xs-2 card-actions' <?php if($kanban->performable) echo "id='performable'";?>>
<?php
$canRestore = commonModel::hasPriv('kanban', 'restoreCard');
$canDelete = commonModel::hasPriv('kanban', 'deleteCard');
$CRKanban = ($this->config->CRKanban or $kanban->status != 'closed');
$canRestore = (commonModel::hasPriv('kanban', 'restoreCard') and $CRKanban);
$canDelete = (commonModel::hasPriv('kanban', 'deleteCard') and $CRKanban);
if($canRestore) echo html::a(inlink('restoreCard', "cardID={$card->id}"), $lang->kanban->restore, '', "class='btn btn-xs btn-primary' target='hiddenwin'");
@@ -35,7 +35,7 @@
<div class="item-body">
<div class="item parent-item hr" data-archived='<?php echo $column->archived;?>' data-id="<?php echo $column->id;?>">
<div class="title text-ellipsis"><?php echo $column->name;?></div>
<?php if(commonModel::hasPriv('kanban', 'restoreColumn') && $column->archived == '1') echo html::a(inlink('restoreColumn', "columnID={$column->id}"), $lang->kanban->restore, '', "class='btn btn-primary' target='hiddenwin'");?>
<?php if(commonModel::hasPriv('kanban', 'restoreColumn') && $column->archived == '1' && ($this->config->CRKanban or $kanban->status != 'closed')) echo html::a(inlink('restoreColumn', "columnID={$column->id}"), $lang->kanban->restore, '', "class='btn btn-primary' target='hiddenwin'");?>
</div>
<?php if(!empty($column->child) && $column->archived == '0'):?>
<?php $count = 1;?>
@@ -43,7 +43,7 @@
<?php $class = $count == count($column->child) ? 'hr' : '';?>
<div class="item child-item <?php echo $class;?>" data-id="<?php echo $childColumn->id;?>" data-archived='<?php echo $childColumn->archived;?>'>
<div class="title text-ellipsis"><label class="label label-child"><?php echo $lang->kanban->child;?></label><?php echo $childColumn->name;?></div>
<?php if(commonModel::hasPriv('kanban', 'restoreColumn') && $childColumn->archived == '1') echo html::a(inlink('restoreColumn', "columnID={$childColumn->id}"), $lang->kanban->restore, '', "class='btn btn-primary' target='hiddenwin'");?>
<?php if(commonModel::hasPriv('kanban', 'restoreColumn') && $childColumn->archived == '1' && ($this->config->CRKanban or $kanban->status != 'closed')) echo html::a(inlink('restoreColumn', "columnID={$childColumn->id}"), $lang->kanban->restore, '', "class='btn btn-primary' target='hiddenwin'");?>
</div>
<?php $count ++;?>
<?php endforeach;?>