From 78c4965710cf079e65fa73d3d8d01e004fe316cc Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 21 Feb 2024 15:32:20 +0800 Subject: [PATCH] * Fix bug #45001. --- module/execution/js/kanban.ui.js | 5 ++-- module/execution/ui/kanban.html.php | 38 +++++++++++++++++------------ 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/module/execution/js/kanban.ui.js b/module/execution/js/kanban.ui.js index 49aa850685..7c1b7bccee 100644 --- a/module/execution/js/kanban.ui.js +++ b/module/execution/js/kanban.ui.js @@ -699,7 +699,7 @@ window.changeBugProduct = function() if(productID) $('#batchCreateBugButton').attr('href', $.createLink('bug', 'batchCreate', 'productID=' + productID + '&branch=&executionID=' + executionID)); }; -window.linkPlanStory = function() +$(document).off('click', '#linkStoryByPlan button[type="submit"]').on('click', '#linkStoryByPlan button[type="submit"]', function() { const planID = $('[name=plan]').val(); if(planID) @@ -707,4 +707,5 @@ window.linkPlanStory = function() var param = "¶m=executionID=" + executionID + ",browseType=" + browseType + ",orderBy=id_asc,groupBy=" + groupBy; $.ajaxSubmit({url: $.createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=taskKanban&extra=' + param)}); } -}; + return false; +}) diff --git a/module/execution/ui/kanban.html.php b/module/execution/ui/kanban.html.php index 7f09c7634f..6db17baca0 100644 --- a/module/execution/ui/kanban.html.php +++ b/module/execution/ui/kanban.html.php @@ -286,29 +286,37 @@ div ) ); +$linkStoryByPlanTips = $lang->execution->linkNormalStoryByPlanTips; +$linkStoryByPlanTips = $execution->multiple ? $linkStoryByPlanTips : str_replace($lang->execution->common, $lang->projectCommon, $linkStoryByPlanTips); + modal ( setID('linkStoryByPlan'), setData('size', '500px'), - to::header + setID('linkStoryByPlan'), + set::modalProps(array('title' => $lang->execution->linkStoryByPlan)), + div ( - h4($lang->execution->linkStoryByPlan), - "({$lang->execution->linkStoryByPlanTips})" + setClass('flex-auto'), + icon('info-sign', setClass('warning-pale rounded-full mr-1')), + $linkStoryByPlanTips ), - inputGroup + form ( - setClass('mt-1'), - picker + setClass('text-center', 'py-4'), + set::actions(array('submit')), + set::submitBtnText($lang->execution->linkStory), + formGroup ( - set::width(300), - setID('plan'), - set::name('plan'), - set::items($allPlans) - ), - span - ( - setClass('input-group-btn ml-2'), - btn(setClass('primary'), setID('toStoryButton'), set::onclick('linkPlanStory()'), $lang->execution->linkStory) + set::label($lang->execution->selectStoryPlan), + set::required(true), + setClass('text-left'), + picker + ( + set::name('plan'), + set::required(true), + set::items($allPlans) + ) ) ) );