diff --git a/module/execution/control.php b/module/execution/control.php
index 153deec30c..0c473b3597 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -2634,30 +2634,19 @@ class execution extends control
$this->session->set('storyList', $this->app->getURI(true), 'execution');
$this->session->set('rdSearchValue', '');
- $features = $this->execution->getExecutionFeatures($execution);
- $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $browseType, $orderBy, 0, $groupBy);
-
- /* Set lane type. */
- if(!$features['story'] and !$features['qa']) $browseType = 'task';
- $this->session->set('execLaneType', $browseType);
-
- /* Remove lanes if no feature. */
- foreach($kanbanData as $regionID => $region)
- {
- foreach($region->groups as $groupID => $group)
- {
- if(!$features['story'] and $group->lanes[0]->type == 'story') unset($kanbanData[$regionID]->groups[$groupID]);
- if(!$features['qa'] and $group->lanes[0]->type == 'bug') unset($kanbanData[$regionID]->groups[$groupID]);
- }
- $kanbanData[$regionID]->groups = array_values($kanbanData[$regionID]->groups);
- }
-
+ $features = $this->execution->getExecutionFeatures($execution);
+ $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $browseType, $orderBy, 0, $groupBy);
$executionActions = array();
foreach($this->config->execution->statusActions as $action)
{
if($this->execution->isClickable($execution, $action)) $executionActions[] = $action;
}
+ /* Set lane type. */
+ if(!$features['story'] and !$features['qa']) $browseType = 'task';
+ if(!$features['story']) unset($this->lang->kanban->group->task['story']);
+ $this->session->set('execLaneType', $browseType);
+
$userList = array();
$users = $this->loadModel('user')->getPairs('noletter|nodeleted');
$avatarPairs = $this->user->getAvatarPairs('all');
diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js
index 87ac799f21..13228c26c6 100644
--- a/module/execution/js/kanban.js
+++ b/module/execution/js/kanban.js
@@ -215,7 +215,7 @@ $('.c-group').change(function()
{
$('.c-group').show();
- var type = $('#type').val();
+ var type = $('#type').val() ? $('#type').val() : browseType;
var group = $('#group').val();
var link = createLink('execution', 'kanban', 'executionID=' + executionID + '&type=' + type + '&orderBy=id_asc' + '&groupBy=' + group);
location.href = link;
diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php
index faffb7fa8d..993b5092e6 100644
--- a/module/execution/lang/de.php
+++ b/module/execution/lang/de.php
@@ -282,7 +282,7 @@ $lang->execution->treeViewTask = 'Tree View Task';
$lang->execution->treeViewStory = 'Tree View Story';
$lang->execution->storyKanban = 'Story Kanban';
$lang->execution->storySort = 'Story sortieren';
-$lang->execution->importPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered out when imported.';
+$lang->execution->importPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? Only active ' . $lang->SRCommon . ' can be imported.';
$lang->execution->importEditPlanStory = $lang->executionCommon . ' is edited!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered out when imported.';
$lang->execution->importBranchPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? Only the activation stories of the branch associated with this ' .$lang->executionCommon. ' will be associated with the import';
$lang->execution->importBranchEditPlanStory = $lang->executionCommon . ' is edited!\nDo you want to import stories that have been linked to the plan? Only the activation stories of the branch associated with this ' .$lang->executionCommon. ' will be associated with the import';
diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php
index 29cc89a90f..4a54020911 100644
--- a/module/execution/lang/en.php
+++ b/module/execution/lang/en.php
@@ -282,7 +282,7 @@ $lang->execution->treeViewTask = 'Tree View Task';
$lang->execution->treeViewStory = 'Tree View Story';
$lang->execution->storyKanban = 'Story Kanban';
$lang->execution->storySort = 'Rank Story';
-$lang->execution->importPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered out when imported.';
+$lang->execution->importPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? Only active ' . $lang->SRCommon . ' can be imported.';
$lang->execution->importEditPlanStory = $lang->executionCommon . ' is edited!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered out when imported.';
$lang->execution->importBranchPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? Only the activation stories of the branch associated with this ' .$lang->executionCommon. ' will be associated with the import';
$lang->execution->importBranchEditPlanStory = $lang->executionCommon . ' is edited!\nDo you want to import stories that have been linked to the plan? Only the activation stories of the branch associated with this ' .$lang->executionCommon. ' will be associated with the import';
diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php
index 45a067d107..edb6d956ed 100644
--- a/module/execution/lang/fr.php
+++ b/module/execution/lang/fr.php
@@ -282,7 +282,7 @@ $lang->execution->treeViewTask = 'Tree View Task';
$lang->execution->treeViewStory = 'Tree View Story';
$lang->execution->storyKanban = 'Story Kanban';
$lang->execution->storySort = 'Rank Story';
-$lang->execution->importPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered out when imported.';
+$lang->execution->importPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? Only active ' . $lang->SRCommon . ' can be imported.';
$lang->execution->importEditPlanStory = $lang->executionCommon . ' is edited!\nDo you want to import stories that have been linked to the plan? The stories in the draft will be automatically filtered out when imported.';
$lang->execution->importBranchPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan? Only the activation stories of the branch associated with this ' .$lang->executionCommon. ' will be associated with the import';
$lang->execution->importBranchEditPlanStory = $lang->executionCommon . ' is edited!\nDo you want to import stories that have been linked to the plan? Only the activation stories of the branch associated with this ' .$lang->executionCommon. ' will be associated with the import';
diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php
index af29250198..ed2fcaab23 100644
--- a/module/execution/lang/zh-cn.php
+++ b/module/execution/lang/zh-cn.php
@@ -282,7 +282,7 @@ $lang->execution->treeViewTask = '树状图查看任务';
$lang->execution->treeViewStory = "树状图查看{$lang->SRCommon}";
$lang->execution->storyKanban = "{$lang->SRCommon}看板";
$lang->execution->storySort = "{$lang->SRCommon}排序";
-$lang->execution->importPlanStory = '创建' . $lang->executionCommon . '成功!\n是否导入计划关联的相关' . $lang->SRCommon . '?导入时将自动过滤掉草稿状态的' . $lang->SRCommon . '。';
+$lang->execution->importPlanStory = '创建' . $lang->executionCommon . '成功!\n是否导入计划关联的相关' . $lang->SRCommon . '?导入时只能导入激活状态的' . $lang->SRCommon . '。';
$lang->execution->importEditPlanStory = '编辑' . $lang->executionCommon . '成功!\n是否导入计划关联的相关' . $lang->SRCommon . '?导入时将自动过滤掉草稿状态的' . $lang->SRCommon . '。';
$lang->execution->importBranchPlanStory = '创建' . $lang->executionCommon . '成功!\n是否导入计划关联的相关' . $lang->SRCommon . '?导入时将只关联本' . $lang->executionCommon . '所关联分支的激活需求。';
$lang->execution->importBranchEditPlanStory = '编辑' . $lang->executionCommon . '成功!\n是否导入计划关联的相关' . $lang->SRCommon . '?导入时将只关联本' . $lang->executionCommon . '所关联分支的激活需求。';
diff --git a/module/execution/model.php b/module/execution/model.php
index 4a4e430561..01eed079a3 100755
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -1458,32 +1458,34 @@ class executionModel extends model
}
/* The total workload of the first stage should not exceed 100%. */
- if($type == 'create' or (!empty($oldExecution) and $oldExecution->grade == 1))
+ if($type == 'create' or (!empty($oldExecution) and $oldExecution->grade == 1 and isset($this->lang->execution->typeList[$oldExecution->type])))
{
$oldPercentTotal = $this->dao->select('SUM(t2.percent) as total')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project=t2.id')
->where('t1.product')->eq($this->post->products[0])
+ ->beginIF(!empty($_POST['branch'][0]))->andWhere('t1.branch')->eq(current($this->post->branch[0]))->fi()
->andWhere('t2.type')->eq('stage')
->andWhere('t2.grade')->eq(1)
->andWhere('t2.deleted')->eq(0)
- ->andWhere('t2.parent')->eq($oldExecution->parent)
+ ->beginIF($type == 'create')->andWhere('t2.parent')->eq($oldExecution->id)->fi()
+ ->beginIF(!empty($oldExecution) and isset($this->lang->execution->typeList[$oldExecution->type]))->andWhere('t2.parent')->eq($oldExecution->parent)->fi()
->fetch('total');
if(!$oldPercentTotal) $oldPercentTotal = 0;
if($type == 'create') $percentTotal = $percent + $oldPercentTotal;
- if(!empty($oldExecution) and $oldExecution->grade == 1) $percentTotal = $oldPercentTotal - $oldExecution->percent + $this->post->percent;
+ if(!empty($oldExecution) and isset($this->lang->execution->typeList[$oldExecution->type])) $percentTotal = $oldPercentTotal - $oldExecution->percent + $percent;
if($percentTotal > 100)
{
- dao::$errors['percent'] = sprintf($this->lang->execution->workloadTotal, '%', $oldPercentTotal . '%');
+ $printPercent = $type == 'create' ? $oldPercentTotal : $percentTotal;
+ dao::$errors['percent'] = sprintf($this->lang->execution->workloadTotal, '%', $printPercent . '%');
return false;
}
}
if($type == 'update' and $oldExecution->grade > 1)
{
- $parentPlan = $this->loadModel('programPlan')->getByID($oldExecution->parent);
- $childrenTotalPercent = $this->dao->select('SUM(percent) as total')->from(TABLE_EXECUTION)->where('parent')->eq($oldExecution->parent)->andWhere('deleted')->eq(0)->fetch('total');
+ $childrenTotalPercent = $this->dao->select('SUM(percent) as total')->from(TABLE_EXECUTION)->where('parent')->eq($oldExecution->parent)->andWhere('project')->eq($oldExecution->project)->andWhere('deleted')->eq(0)->fetch('total');
$childrenTotalPercent = $childrenTotalPercent - $oldExecution->percent + $this->post->percent;
if($childrenTotalPercent > 100)
@@ -5162,7 +5164,7 @@ class executionModel extends model
}
else
{
- $path = str_replace(",$execution->project", '', $execution->path);
+ $path = str_replace(",$execution->project,", ',', $execution->path);
$trClass = 'table-nest-hide';
$trAttrs = "data-id={$execution->id} data-parent={$execution->parent} data-status={$execution->status}";
$trAttrs .= " data-nest-parent='$execution->parent' data-order='$execution->order' data-nest-path='$path'";
diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php
index 58293d2cde..5b88da0f03 100644
--- a/module/execution/view/kanban.html.php
+++ b/module/execution/view/kanban.html.php
@@ -199,7 +199,7 @@ js::set('priv',