From 9efdceed6475b75118513d7b640cfdc25c2e6acc Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 10 Apr 2024 17:13:10 +0800 Subject: [PATCH] * Finish task #115034. --- module/execution/js/kanban.ui.js | 2 +- module/execution/ui/kanban.html.php | 2 +- module/story/control.php | 3 ++- module/story/ui/view.html.php | 13 ++++++++++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/module/execution/js/kanban.ui.js b/module/execution/js/kanban.ui.js index 41ff06813f..ed371c9ff1 100644 --- a/module/execution/js/kanban.ui.js +++ b/module/execution/js/kanban.ui.js @@ -690,7 +690,7 @@ window.searchCards = function(value, order) window.changeStoryProduct = function() { const productID = $('#batchCreateStory [name=productName]').val(); - if(productID) $('#batchCreateStoryButton').attr('href', $.createLink('story', 'batchCreate', 'productID=' + productID + '&branch=&moduleID=0&storyID=0&executionID=' + executionID)); + if(productID) $('#batchCreateStoryButton').attr('href', $.createLink('story', 'batchCreate', 'productID=' + productID + '&branch=0&moduleID=0&storyID=0&executionID=' + executionID)); }; window.changeBugProduct = function() diff --git a/module/execution/ui/kanban.html.php b/module/execution/ui/kanban.html.php index d3cae73e10..b5e79a4f60 100644 --- a/module/execution/ui/kanban.html.php +++ b/module/execution/ui/kanban.html.php @@ -354,7 +354,7 @@ modal ( setClass('primary'), setID('batchCreateStoryButton'), - set::url(createLink('story', 'batchCreate', 'productID=' . key($productNames) . '&branch=moduleID=0&storyID=0&executionID=' . $executionID)), + set::url(createLink('story', 'batchCreate', 'productID=' . key($productNames) . '&branch=0&moduleID=0&storyID=0&executionID=' . $executionID)), set('data-toggle', 'modal'), set('data-dismiss', 'modal'), set('data-size', 'lg'), diff --git a/module/story/control.php b/module/story/control.php index 2a8717dea1..61c2cb2c34 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -519,12 +519,14 @@ class story extends control $projectID = $param ? $param : $this->session->project; $this->loadModel('project')->setMenu((int)$projectID); $this->view->projectID = $projectID; + $this->view->project = $this->project->fetchByID($projectID); } elseif($this->app->tab == 'execution') { $executionID = $param ? $param : $this->session->execution; $this->loadModel('execution')->setMenu($executionID); $this->view->executionID = $executionID; + $this->view->execution = $this->execution->fetchByID($executionID); } elseif($this->app->tab == 'qa') { @@ -539,7 +541,6 @@ class story extends control $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id); $this->view->users = $this->user->getPairs('noletter'); $this->view->executions = $this->execution->getPairs(0, 'all', 'nocode'); - $this->view->project = $this->project->fetchByID($param); $this->view->version = $version; $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID); $this->view->builds = $this->loadModel('build')->getStoryBuilds($storyID); diff --git a/module/story/ui/view.html.php b/module/story/ui/view.html.php index a2070b398a..b368f60876 100644 --- a/module/story/ui/view.html.php +++ b/module/story/ui/view.html.php @@ -171,9 +171,10 @@ $versionBtn = count($versions) > 1 ? to::title(dropdown set::items($versions) )) : null; -$hasRepo = $this->loadModel('repo')->getListByProduct($story->product, 'Gitlab,Gitea,Gogs,GitFox', 1); -$actions = $story->deleted ? array() : $this->loadModel('common')->buildOperateMenu($story); -$hasDivider = !empty($actions['mainActions']) && !empty($actions['suffixActions']); +$hasRepo = $this->loadModel('repo')->getListByProduct($story->product, 'Gitlab,Gitea,Gogs,GitFox', 1); +$actions = $story->deleted ? array() : $this->loadModel('common')->buildOperateMenu($story); +$hasDivider = !empty($actions['mainActions']) && !empty($actions['suffixActions']); +$setToggleModal = $isInModal && (($app->tab == 'project' && !empty($project->type) && $project->model == 'kanban') || ($app->tab == 'execution' && !empty($execution->type) && $execution->type == 'kanban')); if(!empty($actions)) $actions = array_merge($actions['mainActions'], array(array('type' => 'divider')), $actions['suffixActions']); foreach($actions as $key => $action) { @@ -197,6 +198,12 @@ foreach($actions as $key => $action) if(isset($itemAction['url'])) $actions[$key]['items'][$itemKey]['url'] = str_replace(array('{id}', '{type}', '{product}', '{branch}', '{module}', '{execution}'), array($story->id, $story->type, $story->product, $story->branch, $story->module, $executionID), $itemAction['url']); } } + + if($setToggleModal && !isset($actions[$key]['data-toggle']) && !isset($actions[$key]['data-load'])) + { + $actions[$key]['data-load'] = 'modal'; + $actions[$key]['data-size'] = 'lg'; + } } detail