From 3dfd3ecfcaad368f23ca2274c7a6e5d0e382311b Mon Sep 17 00:00:00 2001 From: liuhong Date: Tue, 30 Aug 2022 04:08:38 +0000 Subject: [PATCH] *Finish task #66217,66218,66210 Fix bug 26687,26632,26622,26619. --- module/task/css/create.css | 2 +- module/task/js/create.js | 39 ++++++++++++++++++++++++++++++++ module/task/view/create.html.php | 13 +++++++---- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/module/task/css/create.css b/module/task/css/create.css index b92727e405..1f85350b44 100644 --- a/module/task/css/create.css +++ b/module/task/css/create.css @@ -12,7 +12,7 @@ #testStoryBox table tr td .chosen-container .chosen-single {border: 0px;} #testStoryBox table tr td .chosen-compact.chosen-container-single .chosen-single>.chosen-search {top: 0; right: 0; left: 0;} #testStoryBox table tr td input {border: 0px;} -#testStoryBox table tr td .input-group .input-group-addon {border-left: 1px solid #dcdcdc; border-right: 1px solid #dcdcdc;} +#testStoryBox table tr td .input-group .input-group-addon {border-left: 1px solid #dcdcdc; border-right: 1px solid #dcdcdc; width: 20px !important;} #testStoryBox table button.btn {border: 0px;} .chosen-results > li.has-test, diff --git a/module/task/js/create.js b/module/task/js/create.js index 3dca30890a..2c79cfa866 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -364,8 +364,10 @@ function toggleSelectTestStory() } } +var index = 0; function addItem(obj) { + index ++; var $tr = $(obj).closest('tr'); $tr.after($tr.clone()); var $nextTr = $tr.next(); @@ -377,11 +379,31 @@ function addItem(obj) $nextTr.find('#testAssignedTo').closest('td').find('.chosen-container').remove(); $nextTr.find('#testAssignedTo').closest('td').find('select').chosen(); $nextTr.find('.form-date').val('').datepicker(); + $nextTr.find('.startInput').attr('id', 'testEstStarted\[' + index + '\]'); + $nextTr.find('.deadlineInput').attr('id', 'testDeadline\[' + index + '\]'); + + if($nextTr.find('.deadlineBox').length == 0) + $nextTr.find('.deadlineInput').after('同上'); + if($nextTr.find('.estStartedBox').length == 0) + $nextTr.find('.startInput').after('同上'); + + if($nextTr.find('.deadlineBox').is(':hidden')) + { + $nextTr.find('.deadlineBox').show(); + $nextTr.find(".deadlineBox input[type='checkBox']").attr('checked', true); + } + if($nextTr.find('.estStartedBox').is(':hidden')) + { + $nextTr.find('.estStartedBox').show(); + $nextTr.find(".estStartedBox input[type='checkBox']").attr('checked', true); + } } function removeItem(obj) { if($(obj).closest('table').find('tbody tr').size() > 1) $(obj).closest('tr').remove(); + $('.resarch').find('tr:first').find('.estStartedBox').remove(); + $('.resarch').find('tr:first').find('.deadlineBox').remove(); } function markTestStory() @@ -629,3 +651,20 @@ $('#modalTeam .btn').click(function() $(window).unload(function(){ if(blockID) window.parent.refreshBlock($('#block' + blockID)); }); + +function hiddenDitto(obj) +{ + var $this = $(obj); + var date = $this.val(); + var $ditto = $this.closest('div').find("input[type='checkBox']"); + if(date == '') + { + $ditto.attr('checked', true); + $ditto.closest('.input-group-addon').show(); + } + else + { + $ditto.removeAttr('checked'); + $ditto.closest('.input-group-addon').hide(); + } +} diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index 68d2055eeb..c158c55de9 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -123,13 +123,14 @@ foreach(explode(',', $config->task->create->requiredFields) as $field) task->storyAB;?> task->pri;?> - task->datePlan;?> + task->estStarted;?> + task->deadline;?> task->assignedTo;?> task->estimate;?> actions;?> - + $storyTitle):?> 0) $members['ditto'] = $lang->task->ditto;?> @@ -139,12 +140,14 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)
estStarted, "class='form-control form-date' placeholder='{$lang->task->estStarted}'"); + echo html::input("testEstStarted[$i]", $task->estStarted, "class='startInput form-control form-date' data-inputID='$i' onchange='hiddenDitto(this)' placeholder='{$lang->task->estStarted}'"); if($i != 0) echo " 0 ? "checked" : '') . " /> {$lang->task->ditto}"; ?> - ~ +
+ +
deadline, "class='form-control form-date' placeholder='{$lang->task->deadline}'"); + echo html::input("testDeadline[$i]", $task->deadline, "class='deadlineInput form-control form-date' data-inputID='$i' onchange='hiddenDitto(this)' placeholder='{$lang->task->deadline}'"); if($i != 0) echo " 0 ? "checked" : '') . " /> {$lang->task->ditto}"; ?>