From 621e382cb6d2712d2340ebd0221aaa07a7f8a09e Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 28 Jun 2022 15:35:49 +0800 Subject: [PATCH 01/12] * Finish task #58554. --- module/custom/control.php | 4 +- module/task/js/batchcreate.js | 25 ++++++++ module/task/js/common.js | 60 +++++++++++++++++++ module/task/js/create.js | 28 +++++++++ module/task/view/batchcreate.html.php | 85 ++++++++++++++------------- module/task/view/create.html.php | 60 ++++++++----------- 6 files changed, 186 insertions(+), 76 deletions(-) diff --git a/module/custom/control.php b/module/custom/control.php index 88af46aca5..64f9469391 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -675,14 +675,16 @@ class custom extends control $account = $this->app->user->account; if($this->server->request_method == 'POST') { - $fields = $this->post->fields; + $fields = $this->post->fields; if(is_array($fields)) $fields = join(',', $fields); $this->loadModel('setting')->setItem("$account.$module.$section.$key", $fields); + if(in_array($module, array('task', 'bug', 'testcase', 'story')) and $section == 'custom' and in_array($key, array('createFields', 'batchCreateFields'))) return; } else { $this->loadModel('setting')->deleteItems("owner=$account&module=$module§ion=$section&key=$key"); } + return print(js::reload('parent')); } diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index b98330264c..9d68a3483c 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -5,6 +5,31 @@ $(function() if($('th.c-name').width() < 200) $('th.c-name').width(200); if(taskConsumed > 0) bootbox.alert(addChildTask); $('#customField').on('click', function(){$('#tableBody .chosen-with-drop').removeClass('chosen-with-drop chosen-container-active')}); + + $('#customField').click(function() + { + disabledRequireFields(); + }); + + $('#formSettingForm .btn-primary').click(function() + { + $('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled'); + var fields = ''; + $('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function() + { + fields += ',' + $(this).val(); + }); + + var link = createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=batchCreateFields'); + $.post(link, {'fields' : fields}, function() + { + checkedShowFields(fields); + disabledRequireFields(); + $('#formSetting').parent().removeClass('open'); + }); + + return false; + }); }); $(document).on('change', "[name^='estStarted'], [name^='deadline']", function() diff --git a/module/task/js/common.js b/module/task/js/common.js index cad7f13d6f..8556c357e9 100644 --- a/module/task/js/common.js +++ b/module/task/js/common.js @@ -20,3 +20,63 @@ function setStoryModule() } } +/** + * Checked show fields. + * + * @param string fields + * @access public + * @return void + */ +function checkedShowFields(fields) +{ + var fieldList = ',' + fields + ','; + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var $fieldBox = $('.' + $(this).val() + 'Box' ); + if(fieldList.indexOf(field) >= 0) + { + + $(this).attr('checked', true); + $fieldBox.removeClass('hidden'); + } + else + { + if(!$fieldBox.hasClass('hidden')) $fieldBox.addClass('hidden'); + } + }); + + if(config.currentMethod == 'create'); + { + if(fieldList.indexOf(',estStarted,') >= 0 && fieldList.indexOf(',deadline,') >= 0) + { + $('.borderBox').removeClass('hidden'); + } + else if(fieldList.indexOf(',estStarted,') >= 0 || fieldList.indexOf(',deadline,') >= 0) + { + $('.datePlanBox').removeClass('hidden'); + if(!$('.borderBox').hasClass('hidden')) $('.borderBox').addClass('hidden'); + } + else + { + if(!$('.borderBox').hasClass('hidden')) $('.borderBox').addClass('hidden'); + if(!$('.datePlanBox').hasClass('hidden')) $('.datePlanBox').addClass('hidden'); + } + } +} + +/** + * Disabled require field. + * + * @access public + * @return void + */ +function disabledRequireFields() +{ + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var required = ',' + requiredFields + ','; + if(required.indexOf(field) >= 0) $(this).attr('disabled', 'disabled'); + }); +} diff --git a/module/task/js/create.js b/module/task/js/create.js index 3c3c133f7b..c187786901 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -1,3 +1,31 @@ +$(function() +{ + $('#customField').click(function() + { + disabledRequireFields(); + }); + + $('#formSettingForm .btn-primary').click(function() + { + $('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled'); + var fields = ''; + $('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function() + { + fields += ',' + $(this).val(); + }); + + var link = createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=createFields'); + $.post(link, {'fields' : fields}, function() + { + checkedShowFields(fields); + disabledRequireFields(); + $('#formSetting').parent().removeClass('open'); + }); + + return false; + }); +}) + /** * Load module, stories and members. * diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index 363d589017..26c152c7b4 100755 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -15,6 +15,26 @@ task->addChildTask);?> +task->create->requiredFields);?> +task->create->requiredFields) as $field) +{ + if($field) + { + $requiredFields[$field] = ''; + if(strpos(",{$config->task->customBatchCreateFields},", ",{$field},") !== false) $visibleFields[$field] = ''; + } +} +$colspan = count($visibleFields) + 3; +?> +

@@ -40,32 +60,15 @@

- task->create->requiredFields) as $field) - { - if($field) - { - $requiredFields[$field] = ''; - if(strpos(",{$config->task->customBatchCreateFields},", ",{$field},") !== false) $visibleFields[$field] = ''; - } - } - $colspan = count($visibleFields) + 3; - ?>
- + type != 'ops'):?> - + type == 'kanban'):?> @@ -73,12 +76,12 @@ - - - - - - + + + + + + task->getFlowExtendFields(); foreach($extendFields as $extendField) @@ -113,12 +116,12 @@ - type != 'ops'):?> - - - - + + - - - + + loadModel('flow'); foreach($extendFields as $extendField) echo "control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->flow->getFieldControl($extendField, '', $extendField->field . "[$i]") . ""; @@ -189,11 +192,11 @@ - - - - - + + - - + + loadModel('flow'); foreach($extendFields as $extendField) echo "control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->flow->getFieldControl($extendField, '', $extendField->field . "[%s]") . ""; diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index e9a1510f9a..0f6c3bf5a1 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -17,9 +17,17 @@ task->error->teamMember);?> vision);?> +task->create->requiredFields);?> +task->create->requiredFields) as $field) +{ + if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field; +} +?> +
@@ -29,12 +37,6 @@
- task->create->requiredFields) as $field) - { - if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field; - } - ?>
idAB;?>'>task->module?> moduleBox'>task->module?> '>task->story;?> storyBox'>task->story;?> task->name;?> kanbancard->lane;?> typeAB;?>'>task->assignedTo;?>'>task->estimateAB;?>'>task->estStarted;?>'>task->deadline;?>'>task->desc;?>'>task->pri;?> assignedToBox'>task->assignedTo;?> estimateBox'>task->estimateAB;?> estStartedBox'>task->estStarted;?> deadlineBox'>task->deadline;?> descBox'>task->desc;?> priBox'>task->pri;?>
style='overflow:visible'> + style='overflow: visible'> +
@@ -146,9 +149,9 @@
task->typeList, $type, 'class=form-control');?> style='overflow:visible'>>> +
> +
>>task->priList, $pri, 'class=form-control');?>task->priList, $pri, 'class=form-control');?>
%s style='overflow:visible'> + id, \"%s\")'")?> style='overflow: visible'> +
@@ -216,9 +219,9 @@
task->typeList, $type, 'class="form-control"');?> style='overflow:visible'>>> +
> +
{$lang->task->ditto}"; ?>
-
>>task->priList, $pri, 'class=form-control');?>task->priList, $pri, 'class=form-control');?>
type != 'kanban' or $this->config->vision == 'lite'):?> @@ -97,8 +99,8 @@ printExtendFields('', 'table', 'columns=3');?> - lifetime != 'ops'):?> - + lifetime != 'ops') ? '' : 'hidden'?> + - type != 'ops'):?> @@ -174,8 +175,8 @@ task->copyStoryTitle;?> - - task->pri;?> + + task->pri;?>task->priList as $priKey => $priValue) @@ -195,9 +196,9 @@ } ?> - pri, "class='form-control'");?> + pri, "class='form-control $hiddenPri'");?> -
+
@@ -206,15 +207,13 @@
- - -
+ +
task->estimateAB;?>
-
@@ -231,29 +230,23 @@ - - + - - - + + - From 6fb8d56c65ad7b781c6df233d21f7c08e01bf2f1 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 28 Jun 2022 17:09:04 +0800 Subject: [PATCH 02/12] * Finish task #58556. --- module/custom/control.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/custom/control.php b/module/custom/control.php index 64f9469391..7c7216bbf2 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -678,7 +678,8 @@ class custom extends control $fields = $this->post->fields; if(is_array($fields)) $fields = join(',', $fields); $this->loadModel('setting')->setItem("$account.$module.$section.$key", $fields); - if(in_array($module, array('task', 'bug', 'testcase', 'story')) and $section == 'custom' and in_array($key, array('createFields', 'batchCreateFields'))) return; + if(in_array($module, array('task', 'testcase', 'story')) and $section == 'custom' and in_array($key, array('createFields', 'batchCreateFields'))) return; + if($module == 'bug' and $section == 'custom' and $key == 'batchCreateFields') return; } else { From b0df9d23de401d64bab13011458acb6fe5db47f4 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 28 Jun 2022 17:50:37 +0800 Subject: [PATCH 03/12] * Finish task #58557. --- module/testcase/js/common.js | 43 ++++++++++++++++++++++++++++ module/testcase/js/create.js | 25 ++++++++++++++++ module/testcase/view/create.html.php | 29 ++++++++++--------- 3 files changed, 83 insertions(+), 14 deletions(-) diff --git a/module/testcase/js/common.js b/module/testcase/js/common.js index d68f4b183f..3c27543f27 100644 --- a/module/testcase/js/common.js +++ b/module/testcase/js/common.js @@ -426,3 +426,46 @@ function setModules(branchID, productID, num) $('#plan' + (num + 1)).trigger("chosen:updated"); } } + +/** + * Checked show fields. + * + * @param string fields + * @access public + * @return void + */ +function checkedShowFields(fields) +{ + var fieldList = ',' + fields + ','; + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var $fieldBox = $('.' + $(this).val() + 'Box' ); + if(fieldList.indexOf(field) >= 0) + { + + $(this).attr('checked', true); + $fieldBox.removeClass('hidden'); + } + else + { + if(!$fieldBox.hasClass('hidden')) $fieldBox.addClass('hidden'); + } + }); +} + +/** + * Disabled require field. + * + * @access public + * @return void + */ +function disabledRequireFields() +{ + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var required = ',' + requiredFields + ','; + if(required.indexOf(field) >= 0) $(this).attr('disabled', 'disabled'); + }); +} diff --git a/module/testcase/js/create.js b/module/testcase/js/create.js index 5a525a8ba6..336e316691 100644 --- a/module/testcase/js/create.js +++ b/module/testcase/js/create.js @@ -156,4 +156,29 @@ $(function() }); $('#subNavbar li[data-id="testcase"]').addClass('active'); + + $('#customField').click(function() + { + disabledRequireFields(); + }); + + $('#formSettingForm .btn-primary').click(function() + { + $('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled'); + var fields = ''; + $('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function() + { + fields += ',' + $(this).val(); + }); + + var link = createLink('custom', 'ajaxSaveCustomFields', 'module=testcase§ion=custom&key=createFields'); + $.post(link, {'fields' : fields}, function() + { + checkedShowFields(fields); + disabledRequireFields(); + $('#formSetting').parent().removeClass('open'); + }); + + return false; + }); }); diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 54433855c8..62cd0d9170 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -21,6 +21,15 @@ app->tab);?> app->tab == 'execution') js::set('objectID', $executionID);?> app->tab == 'project') js::set('objectID', $projectID);?> +testcase->create->requiredFields);?> +testcase->custom->createFields) as $field) +{ + if(empty($field)) continue; + $fieldName = 'show' . ucfirst($field); + ${$fieldName} = strpos(",$showFields,", $field) !== false ? " {$field}Box" : "{$field}Box hidden"; +} +?>
@@ -67,17 +76,14 @@
testcase->typeList['unit']);?> - - - - - + -
task->story;?> task->noticeLinkStory, html::a($this->createLink('execution', 'linkStory', "executionID=$execution->id"), $lang->execution->linkStory, '', 'class="text-primary"'), html::a("javascript:loadStories($execution->id)", $lang->refresh, '', 'class="text-primary"'));?> @@ -110,7 +112,6 @@
task->datePlan;?>
- - estStarted, "class='form-control form-date' placeholder='{$lang->task->estStarted}'");?> - - - ~ - - - deadline, "class='form-control form-date' placeholder='{$lang->task->deadline}'");?> - + estStarted, "class='form-control form-date $hiddenEstStarted estStartedBox' placeholder='{$lang->task->estStarted}'");?> + + ~ + deadline, "class='form-control form-date $hiddenDeadline deadlineBox' placeholder='{$lang->task->deadline}'");?>
story->mailto;?>
@@ -262,7 +255,6 @@
task->afterSubmit;?>testcase->type;?> testcase->typeList, $type, "class='form-control chosen'");?> +
testcase->stage?> testcase->stageList, $stage, "class='form-control chosen' multiple='multiple'");?>
testcase->lblStory;?>
@@ -93,7 +99,6 @@
testcase->title;?> @@ -108,8 +113,7 @@ - - testcase->pri;?> + testcase->pri;?> testcase->priList as $priKey => $priValue) @@ -129,10 +133,10 @@ } ?> - + -
+
@@ -141,7 +145,6 @@
- testcase->forceNotReview()):?> testcase->forceNotReview, '', "id='forceNotReview0'");?> @@ -220,12 +223,10 @@
- - + testcase->keywords;?> - testcase->status;?> From 12fd7102a1318694f65dcd4611502489f75c80f5 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 28 Jun 2022 17:55:19 +0800 Subject: [PATCH 04/12] * Finish task #58556. --- module/bug/js/batchcreate.js | 89 +++++++++++++++++++++++ module/bug/view/batchcreate.html.php | 101 ++++++++++++++------------- 2 files changed, 140 insertions(+), 50 deletions(-) diff --git a/module/bug/js/batchcreate.js b/module/bug/js/batchcreate.js index ca5552b022..3f496d94de 100644 --- a/module/bug/js/batchcreate.js +++ b/module/bug/js/batchcreate.js @@ -4,8 +4,97 @@ $(function() var $titleCol = $('#batchCreateForm table thead tr th.c-title'); if($titleCol.width() < 150) $titleCol.width(150); + + $('#customField').click(function() + { + disabledRequireFields(); + }); + + $('#formSettingForm .btn-primary').click(function() + { + $('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled'); + var fields = ''; + $('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function() + { + fields += ',' + $(this).val(); + }); + + var link = createLink('custom', 'ajaxSaveCustomFields', 'module=bug§ion=custom&key=batchCreateFields'); + $.post(link, {'fields' : fields}, function() + { + checkedShowFields(fields); + disabledRequireFields(); + var $titleCol = $('#batchCreateForm table thead tr th.c-title'); + if($titleCol.width() < 150) $titleCol.width(150); + $('#formSetting').parent().removeClass('open'); + }); + + return false; + }); }) +/** + * Checked show fields. + * + * @param string fields + * @access public + * @return void + */ +function checkedShowFields(fields) +{ + var fieldList = ',' + fields + ','; + var checkedCount = $('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').length; + if(checkedCount > 5) + { + $('.table-responsive').removeClass('scroll-none'); + $('.table-responsive').css('overflow', 'auto'); + } + else + { + $('.table-responsive').addClass('scroll-none'); + $('.table-responsive').css('overflow', 'visible'); + } + + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var required = ',' + requiredFields + ','; + var $fieldBox = $('.' + $(this).val() + 'Box' ); + if(fieldList.indexOf(field) >= 0 || required.indexOf(field) >= 0) + { + + if(fieldList.indexOf(field) >= 0) $(this).attr('checked', true); + $fieldBox.removeClass('hidden'); + } + else + { + if(!$fieldBox.hasClass('hidden')) $fieldBox.addClass('hidden'); + } + + var fieldCount = $('#batchCreateForm .table thead>tr>th:visible').length; + if(fieldCount < 4) + { + $('#batchCreateForm table thead tr th.c-title').css('width', 'auto'); + } + }); +} + +/** + * Disabled require field. + * + * @access public + * @return void + */ +function disabledRequireFields() +{ + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var required = ',' + requiredFields + ','; + if(required.indexOf(field) >= 0) $(this).attr('disabled', 'disabled'); + }); +} + /** * Set opened builds. * diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php index 91c02ab591..41770dfd40 100755 --- a/module/bug/view/batchcreate.html.php +++ b/module/bug/view/batchcreate.html.php @@ -14,6 +14,24 @@ include '../../common/view/header.html.php'; js::set('requiredFields', $config->bug->create->requiredFields); ?> +bug->create->requiredFields) as $field) +{ + if($field) + { + $requiredFields[$field] = ''; + if(strpos(",{$config->bug->list->customBatchCreateFields},", ",{$field},") !== false) $visibleFields[$field] = ''; + } +} +?> +

@@ -30,49 +48,32 @@ js::set('requiredFields', $config->bug->create->requiredFields);

- - bug->create->requiredFields) as $field) - { - if($field) - { - $requiredFields[$field] = ''; - if(strpos(",{$config->bug->list->customBatchCreateFields},", ",{$field},") !== false) $visibleFields[$field] = ''; - } - } - ?>
- + systemMode == 'new'):?> - + - + - - - - - - - - + + + + + + + + bug->getFlowExtendFields(); foreach($extendFields as $extendField) @@ -107,12 +108,12 @@ js::set('requiredFields', $config->bug->create->requiredFields); ?> - + systemMode == 'new'):?> - + - + - - - - - - - - + + + + + + + + loadModel('flow'); foreach($extendFields as $extendField) echo "control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->flow->getFieldControl($extendField, '', $extendField->field . "[$i]") . ""; @@ -161,12 +162,12 @@ js::set('requiredFields', $config->bug->create->requiredFields); ?> - + systemMode == 'new'):?> - + - + - - - - - - - - + + + + + + + + loadModel('flow'); foreach($extendFields as $extendField) echo "control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->flow->getFieldControl($extendField, '', $extendField->field . "[$i]") . ""; From be78c78c4b9b0bdbf94baa3b958b09f650fab113 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 28 Jun 2022 18:08:59 +0800 Subject: [PATCH 05/12] * Restore code. --- module/testcase/view/create.html.php | 29 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 62cd0d9170..54433855c8 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -21,15 +21,6 @@ app->tab);?> app->tab == 'execution') js::set('objectID', $executionID);?> app->tab == 'project') js::set('objectID', $projectID);?> -testcase->create->requiredFields);?> -testcase->custom->createFields) as $field) -{ - if(empty($field)) continue; - $fieldName = 'show' . ucfirst($field); - ${$fieldName} = strpos(",$showFields,", $field) !== false ? " {$field}Box" : "{$field}Box hidden"; -} -?>
@@ -76,14 +67,17 @@ foreach(explode(',', $config->testcase->custom->createFields) as $field)
testcase->typeList['unit']);?> - + - + + +
idAB;?>'> product->branch;?> branchBox'> product->branch;?> '> bug->module;?> '>model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->project;?> projectBox'>model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->project;?> '>model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution;?> executionBox'>model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution;?> bug->openedBuild;?> bug->title;?> kanbancard->region;?> kanbancard->lane;?> '>bug->deadline;?>'>bug->steps;?>'>typeAB;?>'>bug->pri;?>'>bug->severity;?>'>bug->os;?>'>bug->browser;?>'>bug->keywords;?> deadlineBox'>bug->deadline;?> stepsBox'>bug->steps;?> typeBox'>typeAB;?> priBox'>bug->pri;?> severityBox'>bug->severity;?> osBox'>bug->os;?> browserBox'>bug->browser;?> keywordsBox'>bug->keywords;?>
' style='overflow:visible'> branchBox' style='overflow:visible'> ' style='overflow:visible'> projectBox' style='overflow:visible'> ' style='overflow:visible'> executionBox' style='overflow:visible'>
@@ -132,14 +133,14 @@ js::set('requiredFields', $config->bug->create->requiredFields);
'>'>' style='overflow:visible'> bug->typeList, $type, "class='form-control chosen'");?>' style='overflow:visible'> bug->priList, $pri, "class='form-control'");?>' style='overflow:visible'>bug->severityList, '3', "class='form-control'");?>' style='overflow:visible'> bug->osList, $os, "class='form-control chosen'");?>' style='overflow:visible'> bug->browserList, $browser, "class='form-control chosen'");?>'> deadlineBox'> stepsBox'> typeBox' style='overflow:visible'> bug->typeList, $type, "class='form-control chosen'");?> priBox' style='overflow:visible'> bug->priList, $pri, "class='form-control'");?> severityBox' style='overflow:visible'>bug->severityList, '3', "class='form-control'");?> osBox' style='overflow:visible'> bug->osList, $os, "class='form-control chosen'");?> browserBox' style='overflow:visible'> bug->browserList, $browser, "class='form-control chosen'");?> keywordsBox'>
' style='overflow:visible'> branchBox' style='overflow:visible'> ' style='overflow:visible'> projectBox' style='overflow:visible'> ' style='overflow:visible'> executionBox' style='overflow:visible'>
@@ -186,14 +187,14 @@ js::set('requiredFields', $config->bug->create->requiredFields);
'>'>' style='overflow:visible'> bug->typeList, $type, "class='form-control chosen'");?>' style='overflow:visible'> bug->priList, $pri, "class='form-control'");?>' style='overflow:visible'>bug->severityList, '3', "class='form-control'");?>' style='overflow:visible'> bug->osList, $os, "class='form-control chosen'");?>' style='overflow:visible'> bug->browserList, $browser, "class='form-control chosen'");?>'> deadlineBox'> stepsBox'> typeBox' style='overflow:visible'> bug->typeList, $type, "class='form-control chosen'");?> priBox' style='overflow:visible'> bug->priList, $pri, "class='form-control'");?> severityBox' style='overflow:visible'>bug->severityList, '3', "class='form-control'");?> osBox' style='overflow:visible'> bug->osList, $os, "class='form-control chosen'");?> browserBox' style='overflow:visible'> bug->browserList, $browser, "class='form-control chosen'");?> keywordsBox'> testcase->type;?> testcase->typeList, $type, "class='form-control chosen'");?> + +
testcase->stage?> testcase->stageList, $stage, "class='form-control chosen' multiple='multiple'");?>
testcase->lblStory;?>
@@ -99,6 +93,7 @@ foreach(explode(',', $config->testcase->custom->createFields) as $field)
testcase->title;?> @@ -113,7 +108,8 @@ foreach(explode(',', $config->testcase->custom->createFields) as $field) - testcase->pri;?> + + testcase->pri;?> testcase->priList as $priKey => $priValue) @@ -133,10 +129,10 @@ foreach(explode(',', $config->testcase->custom->createFields) as $field) } ?> - + -
+
@@ -145,6 +141,7 @@ foreach(explode(',', $config->testcase->custom->createFields) as $field)
+ testcase->forceNotReview()):?> testcase->forceNotReview, '', "id='forceNotReview0'");?> @@ -223,10 +220,12 @@ foreach(explode(',', $config->testcase->custom->createFields) as $field)
- + + testcase->keywords;?> + testcase->status;?> From ee701c75c9de06237cdfb9db86327967febf09f2 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 4 Jul 2022 13:20:09 +0800 Subject: [PATCH 06/12] * Finish task #58554. --- module/task/css/batchcreate.css | 2 +- module/task/js/batchcreate.js | 12 ++++++++---- module/task/js/common.js | 15 ++++++++------- module/task/js/create.js | 4 +--- module/task/view/batchcreate.html.php | 2 +- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/module/task/css/batchcreate.css b/module/task/css/batchcreate.css index 0469aab8d1..43d589faab 100644 --- a/module/task/css/batchcreate.css +++ b/module/task/css/batchcreate.css @@ -12,7 +12,7 @@ select[id^="story"] + .picker-single {width: 130px; max-width: 130px;} #zeroTaskStory {margin: 0 0 0 20px; height: 32px; padding: 5px 5px 5px 5px; border-radius: 3px; border: 2px solid transparent;} #zeroTaskStory > label:before {top: 7px; left: 5px;} -#zeroTaskStory > label:after {top: 5px; left: 5px;} +#zeroTaskStory > label:after {top: 7px; left: 5px;} #zeroTaskStory.checked {border-color: #00a9fc; background: #E9F2FB;} .chosen-results > li.has-task, diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index 9d68a3483c..12bc4b399f 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -2,18 +2,18 @@ $(function() { removeDitto(); - if($('th.c-name').width() < 200) $('th.c-name').width(200); + if($('th.c-name').width() < 165) $('th.c-name').width(165); if(taskConsumed > 0) bootbox.alert(addChildTask); $('#customField').on('click', function(){$('#tableBody .chosen-with-drop').removeClass('chosen-with-drop chosen-container-active')}); $('#customField').click(function() { - disabledRequireFields(); + hiddenRequireFields(); }); + /* Implement a custom form without feeling refresh. */ $('#formSettingForm .btn-primary').click(function() { - $('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled'); var fields = ''; $('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function() { @@ -24,8 +24,12 @@ $(function() $.post(link, {'fields' : fields}, function() { checkedShowFields(fields); - disabledRequireFields(); $('#formSetting').parent().removeClass('open'); + + var fieldCount = $('#batchCreateForm .table thead>tr>th:visible').length; + $('.form-actions').attr('colspan', fieldCount); + + if($('th.c-name').width() < 165) $('th.c-name').width(165); }); return false; diff --git a/module/task/js/common.js b/module/task/js/common.js index 8556c357e9..8e21cea27c 100644 --- a/module/task/js/common.js +++ b/module/task/js/common.js @@ -33,16 +33,17 @@ function checkedShowFields(fields) $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() { var field = ',' + $(this).val() + ','; + var $field = $('#' + $(this).val()); var $fieldBox = $('.' + $(this).val() + 'Box' ); if(fieldList.indexOf(field) >= 0) { - - $(this).attr('checked', true); $fieldBox.removeClass('hidden'); + $field.removeAttr('disabled'); } - else + else if(!$fieldBox.hasClass('hidden')) { - if(!$fieldBox.hasClass('hidden')) $fieldBox.addClass('hidden'); + $fieldBox.addClass('hidden'); + $field.attr('disabled', true); } }); @@ -66,17 +67,17 @@ function checkedShowFields(fields) } /** - * Disabled require field. + * Hidden require field. * * @access public * @return void */ -function disabledRequireFields() +function hiddenRequireFields() { $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() { var field = ',' + $(this).val() + ','; var required = ',' + requiredFields + ','; - if(required.indexOf(field) >= 0) $(this).attr('disabled', 'disabled'); + if(required.indexOf(field) >= 0) $(this).closest('div').addClass('hidden'); }); } diff --git a/module/task/js/create.js b/module/task/js/create.js index c187786901..d656899e8f 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -2,12 +2,11 @@ $(function() { $('#customField').click(function() { - disabledRequireFields(); + hiddenRequireFields(); }); $('#formSettingForm .btn-primary').click(function() { - $('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled'); var fields = ''; $('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function() { @@ -18,7 +17,6 @@ $(function() $.post(link, {'fields' : fields}, function() { checkedShowFields(fields); - disabledRequireFields(); $('#formSetting').parent().removeClass('open'); }); diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index 26c152c7b4..7430395279 100755 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -115,7 +115,7 @@ $colspan = count($visibleFields) + 3; ?> - + From fedefaf02bb125b2fad1ea4975d31915f81e5976 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 4 Jul 2022 13:20:33 +0800 Subject: [PATCH 07/12] * Finish task #58554. --- module/common/view/customfield.html.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/module/common/view/customfield.html.php b/module/common/view/customfield.html.php index a1f24662b6..4af7a48a4f 100644 --- a/module/common/view/customfield.html.php +++ b/module/common/view/customfield.html.php @@ -17,9 +17,17 @@ #formSettingForm .checkbox-primary {width: 50%; float: left; margin: 3px 0;} #formSetting .btn {margin-right: 8px;} + rawModule; + $method = $app->rawMethod; + ?>