From c96f215ad52d84fcf0475b9948354585504b117b Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 15 Apr 2022 08:08:48 +0800 Subject: [PATCH] * Fix bug #1780. --- module/task/js/batchcreate.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index 9ea82592a5..5efe039eaa 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -70,6 +70,22 @@ function setStories(moduleID, executionID, num) function copyStoryTitle(num) { var storyTitle = $('#story' + num).find('option:selected').text(); + var storyValue = $('#story' + num).find('option:selected').val(); + + if(storyValue === 'ditto') + { + for(var i = num; i <= num && i >= 1; i--) + { + var selectedValue = $('select[id="story' + i +'"]').val(); + var selectedTitle = $('select[id="story' + i +'"]').find('option:selected').text(); + if(selectedValue !== 'ditto') + { + storyTitle = selectedTitle; + break; + } + } + } + startPosition = storyTitle.indexOf(':') + 1; endPosition = storyTitle.lastIndexOf('['); storyTitle = storyTitle.substr(startPosition, endPosition - startPosition);