From 1bad9447016ecb9b86b73bae744d1cf78dd053d8 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 1 Apr 2021 13:25:05 +0800 Subject: [PATCH] * merge from 12.x. --- module/task/js/create.js | 30 ++++++++++++++++++++++++++++++ module/task/view/create.html.php | 21 +++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/module/task/js/create.js b/module/task/js/create.js index 3eaad47266..505d281817 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -35,6 +35,13 @@ function loadExecutionMembers(executionID) $(this).find('#team').replaceWith(data); $(this).find('#assignedTo').attr('id', 'team').attr('name', 'team[]').chosen(); }); + + $('#testStoryBox table tbody tr').each(function(i) + { + $td = $(this).find('#testAssignedTo').closest('td'); + $td.html(data); + $td.find('#assignedTo').val('').attr('id', 'testAssignedTo').attr('name', 'testAssignedTo[]').chosen(); + }); }); } @@ -53,6 +60,29 @@ function loadExecutionStories(executionID) $('#story').next('.picker').remove(); $('#story').replaceWith(data); $('#story').addClass('filled').chosen(); + + if($('#testStoryBox table tbody tr').length == 0) + { + var trHtml = $('#testStoryTemplate tr').prop("outerHTML"); + $('#testStoryBox table tbody').append(trHtml); + + $td = $('#testStoryBox table tbody tr:first').find('#testStory').closest('td'); + $td.html(data); + $td.find('#story').val($td.find('#story option').eq(i).val()).attr('id', 'testStory').attr('name', 'testStory[]').addClass('filled').chosen(); + + $td = $('#testStoryBox table tbody tr:first').find('#testPri_chosen').closest('td'); + $td.find('#testPri_chosen').remove(); + $td.find('#testPri').chosen(); + } + else + { + $('#testStoryBox table tbody tr').each(function(i) + { + $td = $(this).find('#testStory').closest('td'); + $td.html(data); + $td.find('#story').val($td.find('#story option').eq(i).val()).attr('id', 'testStory').attr('name', 'testStory[]').addClass('filled').chosen(); + }); + } }); } diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index 4786cb8a30..508f3f7087 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -293,6 +293,27 @@ + + + + + + + + + + isINT) and class_exists('common')) ? common::convert2Pinyin($stories) : array());?>