diff --git a/module/bug/js/batchcreate.js b/module/bug/js/batchcreate.js index ca5552b022..091963078f 100644 --- a/module/bug/js/batchcreate.js +++ b/module/bug/js/batchcreate.js @@ -4,8 +4,93 @@ $(function() var $titleCol = $('#batchCreateForm table thead tr th.c-title'); if($titleCol.width() < 150) $titleCol.width(150); + + $('#customField').click(function() + { + hiddenRequireFields(); + }); + + /* Implement a custom form without feeling refresh. */ + $('#formSettingForm .btn-primary').click(function() + { + 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); + $('#formSetting').parent().removeClass('open'); + + if($('#batchCreateForm table thead tr th.c-title').width() < 150) $titleCol.width(150); + + var fieldCount = $('#batchCreateForm .table thead>tr>th:visible').length; + $('.form-actions').attr('colspan', fieldCount); + + if(fieldCount > 10) + { + $('#batchCreateForm > .table-responsive').removeClass('scroll-none'); + $('#batchCreateForm > .table-responsive').css('overflow', 'auto'); + } + else + { + $('#batchCreateForm > .table-responsive').addClass('scroll-none'); + $('#batchCreateForm > .table-responsive').css('overflow', 'visible'); + } + }); + + return false; + }); }) +/** + * 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 $field = $('[name^=' + $(this).val() + ']'); + var required = ',' + requiredFields + ','; + var $fieldBox = $('.' + $(this).val() + 'Box' ); + if(fieldList.indexOf(field) >= 0 || required.indexOf(field) >= 0) + { + $fieldBox.removeClass('hidden'); + $field.removeAttr('disabled'); + } + else if(!$fieldBox.hasClass('hidden')) + { + $fieldBox.addClass('hidden'); + $field.attr('disabled', true); + } + }); +} + +/** + * Hidden require field. + * + * @access public + * @return void + */ +function hiddenRequireFields() +{ + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var required = ',' + requiredFields + ','; + if(required.indexOf(field) >= 0) $(this).closest('div').addClass('hidden'); + }); +} + /** * Set opened builds. * diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php index 91c02ab591..2785a6a1b6 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]") . ""; @@ -203,7 +204,7 @@ js::set('requiredFields', $config->bug->create->requiredFields); - @@ -217,12 +218,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 . "[%s]") . ""; diff --git a/module/common/view/customfield.html.php b/module/common/view/customfield.html.php index a1f24662b6..ef369decb0 100644 --- a/module/common/view/customfield.html.php +++ b/module/common/view/customfield.html.php @@ -16,10 +16,12 @@ #formSettingForm .checkboxes {padding: 10px 3px;} #formSettingForm .checkbox-primary {width: 50%; float: left; margin: 3px 0;} #formSetting .btn {margin-right: 8px;} + [lang^='de'] #formSetting {min-width: 360px;} + [lang^='fr'] #formSetting {min-width: 320px;}
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'>
+
%s' style='overflow:visible'> productBox' style='overflow:visible'> ' style='overflow:visible'> projectBox' style='overflow:visible'> ' style='overflow:visible'> executionBox' style='overflow:visible'>
@@ -238,14 +239,14 @@ js::set('requiredFields', $config->bug->create->requiredFields);
'>'>' style='overflow:visible'> bug->typeList, $type, "class='form-control chosen'");?>' style='overflow:visible'> bug->priList, '', "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, '', "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'>
- + type != 'ops'):?> - + type == 'kanban'):?> @@ -73,12 +76,12 @@ - - - - - - + + + + + + task->getFlowExtendFields(); foreach($extendFields as $extendField) @@ -112,13 +115,13 @@ ?> - - + 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 @@ - - + - - - + + -
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;?>