diff --git a/module/execution/control.php b/module/execution/control.php
index 01863e5d8c..27aa1e597c 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -2036,7 +2036,8 @@ class execution extends control
public function kanban($executionID, $browseType = 'all', $orderBy = 'id_asc', $groupBy = 'default')
{
$this->app->loadLang('bug');
- $this->app->loadLang('story');
+ $this->loadModel('story');
+
if(empty($groupBy)) $groupBy = 'default';
$this->session->set('execLaneType', $browseType);
@@ -2104,6 +2105,7 @@ class execution extends control
$this->view->kanbanData = $kanbanData;
$this->view->executionActions = $executionActions;
$this->view->kanban = $this->lang->execution->kanban;
+ $this->view->reviewStoryParis = $this->story->getExecutionStoryPairs($execution->id, 0, 'all', 0, 'full', 'review');
$this->display();
}
@@ -2129,9 +2131,9 @@ class execution extends control
$this->app->session->set('kanbanType', $browseType, 'execution');
/* Load language. */
- $this->app->loadLang('story');
$this->app->loadLang('task');
$this->app->loadLang('bug');
+ $this->loadModel('story');
$this->loadModel('kanban');
/* Compatibility IE8. */
@@ -2176,23 +2178,22 @@ class execution extends control
$userList['closed']['realname'] = 'Closed';
$userList['closed']['avatar'] = '';
- $this->view->title = $this->lang->execution->kanban;
- $this->view->position[] = html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name);
- $this->view->position[] = $this->lang->execution->kanban;
- $this->view->realnames = $this->loadModel('user')->getPairs('noletter');
- $this->view->storyOrder = $orderBy;
- $this->view->orderBy = 'id_asc';
- $this->view->executionID = $executionID;
- $this->view->productID = $productID;
- $this->view->productNames = $productNames;
- $this->view->productNum = count($products);
- $this->view->allPlans = $allPlans;
- $this->view->browseType = $browseType;
- $this->view->kanbanGroup = $kanbanGroup;
- $this->view->execution = $execution;
- $this->view->groupBy = $groupBy;
- $this->view->canBeChanged = $canBeChanged;
- $this->view->userList = $userList;
+ $this->view->title = $this->lang->execution->kanban;
+ $this->view->realnames = $this->loadModel('user')->getPairs('noletter');
+ $this->view->storyOrder = $orderBy;
+ $this->view->orderBy = 'id_asc';
+ $this->view->executionID = $executionID;
+ $this->view->productID = $productID;
+ $this->view->productNames = $productNames;
+ $this->view->productNum = count($products);
+ $this->view->allPlans = $allPlans;
+ $this->view->browseType = $browseType;
+ $this->view->kanbanGroup = $kanbanGroup;
+ $this->view->execution = $execution;
+ $this->view->groupBy = $groupBy;
+ $this->view->canBeChanged = $canBeChanged;
+ $this->view->userList = $userList;
+ $this->view->reviewStoryParis = $this->story->getExecutionStoryPairs($execution->id, 0, 'all', 0, 'full', 'review');
$this->display();
}
diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js
index 0526035b56..8dc45a2856 100644
--- a/module/execution/js/kanban.js
+++ b/module/execution/js/kanban.js
@@ -461,8 +461,8 @@ function renderStoryItem(item, $item, col)
var $title = $item.find('.title');
if(!$title.length)
{
- $title = $('' + (scaleSize <= 1 ? ' ' : '') + '')
- .attr('href', $.createLink('story', 'view', 'storyID=' + item.id + '&version=0¶m=' + execution.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '80%');
+ $title = $('' + (scaleSize <= 1 ? ' ' : '') + '')
+ .attr('href', $.createLink('story', 'view', 'storyID=' + item.id + '&version=0¶m=' + execution.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '95%');
$title.appendTo($item);
}
$title.attr('title', item.title).find('.text').text(item.title);
@@ -959,6 +959,12 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car
{
if(toColType == 'ready' || toColType == 'backlog')
{
+ if(toColType == 'ready' && typeof(reviewStoryParis[objectID]) != 'undefined')
+ {
+ alert(executionLang.storyDragError);
+ return false;
+ }
+
var link = createLink('kanban', 'ajaxMoveCard', 'cardID=' + objectID + '&fromColID=' + fromColID + '&toColID=' + toColID + '&fromLaneID=' + fromLaneID + '&toLaneID=' + toLaneID + '&execitionID=' + executionID + '&browseType=' + browseType + '&groupBy=' + groupBy + '®ionID=' + regionID+ '&orderBy=' + orderBy );
$.ajax(
{
diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js
index 31001c0e6a..a990a8e1a7 100644
--- a/module/execution/js/taskkanban.js
+++ b/module/execution/js/taskkanban.js
@@ -685,6 +685,12 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car
{
if(toColType == 'ready' || toColType == 'backlog')
{
+ if(toColType == 'ready' && typeof(reviewStoryParis[objectID]) != 'undefined')
+ {
+ alert(executionLang.storyDragError);
+ return false;
+ }
+
var link = createLink('kanban', 'ajaxMoveCard', 'cardID=' + objectID + '&fromColID=' + fromColID + '&toColID=' + toColID + '&fromLaneID=' + fromLaneID + '&toLaneID=' + toLaneID + '&execitionID=' + executionID + '&browseType=' + browseType + '&groupBy=' + groupBy);
$.get(link, function(data)
{
diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php
index 1fec85518d..806186714b 100644
--- a/module/execution/lang/en.php
+++ b/module/execution/lang/en.php
@@ -367,6 +367,7 @@ $lang->execution->unresolvedBug = "[%s] unresolved bugs. ";
$lang->execution->projectNotEmpty = 'Project cannot be empty.';
$lang->execution->confirmStoryToTask = $lang->SRCommon . '%s are converted to tasks in the current. Do you want to convert them anyways?';
$lang->execution->ge = "『%s』should be >= actual begin『%s』.";
+$lang->execution->storyDragError = "The {$lang->SRCommon} is still a draft or has been changed, please drag it after the review";
/* Statistics. */
$lang->execution->charts = new stdclass();
diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php
index 4ec225e111..b8c43a0442 100644
--- a/module/execution/lang/zh-cn.php
+++ b/module/execution/lang/zh-cn.php
@@ -367,6 +367,7 @@ $lang->execution->unresolvedBug = "[%s]个未解决的bug,";
$lang->execution->projectNotEmpty = '所属项目不能为空。';
$lang->execution->confirmStoryToTask = '%s' . $lang->SRCommon . '已经在当前' . $lang->execution->common . '中转了任务,请确认是否重复转任务。';
$lang->execution->ge = "『%s』应当不小于实际开始时间『%s』。";
+$lang->execution->storyDragError = "该{$lang->SRCommon}还是草稿或已变更状态,请评审通过后再拖动";
/* 统计。*/
$lang->execution->charts = new stdclass();
diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php
index 05e5e217a9..80d3bab88d 100644
--- a/module/execution/view/kanban.html.php
+++ b/module/execution/view/kanban.html.php
@@ -51,6 +51,7 @@ js::set('projectID', $projectID);
js::set('vision', $this->config->vision);
js::set('productCount', count($productNames));
js::set('executionID', $execution->id);
+js::set('reviewStoryParis', $reviewStoryParis);
$canSortRegion = commonModel::hasPriv('kanban', 'sortRegion') && count($regions) > 1;
$canEditRegion = commonModel::hasPriv('kanban', 'editRegion');
diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php
index 8be39bc3c1..4d86ea58cd 100644
--- a/module/execution/view/taskkanban.html.php
+++ b/module/execution/view/taskkanban.html.php
@@ -211,4 +211,5 @@ js::set('priv',
fluidBoard);?>
displayCards);?>
+
diff --git a/module/story/model.php b/module/story/model.php
index e6cf7057ce..d5eedc2706 100644
--- a/module/story/model.php
+++ b/module/story/model.php
@@ -2873,7 +2873,7 @@ class storyModel extends model
* @param int $branch
* @param array|string $moduleIdList
* @param string $type full|short
- * @param string $status all|unclosed
+ * @param string $status all|unclosed|review
* @access public
* @return array
*/
@@ -2890,6 +2890,7 @@ class storyModel extends model
->beginIF($branch !== 'all')->andWhere('t2.branch')->eq($branch)->fi()
->beginIF($moduleIdList)->andWhere('t2.module')->in($moduleIdList)->fi()
->beginIF($status == 'unclosed')->andWhere('t2.status')->ne('closed')->fi()
+ ->beginIF($status == 'review')->andWhere('t2.status')->in('draft,changed')->fi()
->orderBy('t1.`order` desc')
->fetchAll('id');
return empty($stories) ? array() : $this->formatStories($stories, $type);