From 2af6c7df8b507edae56fe61ede72dcf75dffeb70 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 7 Apr 2022 14:38:41 +0800 Subject: [PATCH 1/3] * Fix bug #20977. --- module/execution/js/kanban.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 0526035b56..72bc424540 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); From 14fd19d50b90248c810c15f7c32741534c836220 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 7 Apr 2022 16:58:07 +0800 Subject: [PATCH 2/3] * Fix bug #18781. --- module/execution/control.php | 39 ++++++++++++----------- module/execution/js/kanban.js | 6 ++++ module/execution/js/taskkanban.js | 6 ++++ module/execution/lang/en.php | 1 + module/execution/lang/zh-cn.php | 1 + module/execution/view/kanban.html.php | 1 + module/execution/view/taskkanban.html.php | 1 + module/story/model.php | 1 + 8 files changed, 37 insertions(+), 19 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 74e9c7da44..38302fe4e0 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2035,7 +2035,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); @@ -2103,6 +2104,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(); } @@ -2128,9 +2130,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. */ @@ -2175,23 +2177,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 72bc424540..8dc45a2856 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -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 e935521952..24982bc528 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2889,6 +2889,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); From 209f8c9655f3c4e59ce566152f5eee51e9380cca Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 7 Apr 2022 17:06:42 +0800 Subject: [PATCH 3/3] * Add comment. --- module/story/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/model.php b/module/story/model.php index 24982bc528..16bc27bdb4 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2872,7 +2872,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 */