* Finish task #115034.

This commit is contained in:
liumengyi
2024-04-10 17:13:10 +08:00
parent 6a42efefb9
commit 9efdceed64
4 changed files with 14 additions and 6 deletions
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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'),
+2 -1
View File
@@ -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);
+10 -3
View File
@@ -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