diff --git a/module/bug/js/common.js b/module/bug/js/common.js
index 26026e6df3..6d7d53a597 100644
--- a/module/bug/js/common.js
+++ b/module/bug/js/common.js
@@ -807,3 +807,22 @@ function setBranchRelated(branchID, productID, num)
});
}
}
+$(document).ready(function()
+{
+ $('#customField').click(function()
+ {
+ $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function()
+ {
+ var field = ',' + $(this).val() + ',';
+ var required = ',' + requiredFields + ',';
+ if(required.indexOf(field) >= 0) $(this).attr('disabled', 'disabled');
+ });
+ });
+
+ $('#formSettingForm .btn-primary').click(function()
+ {
+ $('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled');
+ });
+
+
+});
diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php
index f0f4267291..eca365b83c 100755
--- a/module/bug/view/batchcreate.html.php
+++ b/module/bug/view/batchcreate.html.php
@@ -10,7 +10,10 @@
* @link http://www.zentao.net
*/
?>
-
+bug->create->requiredFields);
+?>
@@ -69,7 +72,7 @@
| '>bug->keywords;?> |
bug->getFlowExtendFields();
- foreach($extendFields as $extendField)
+ foreach($extendFields as $extendField)
{
$required = strpos(",$extendField->rules,", ',1,') !== false ? 'required' : '';
echo "{$extendField->name} | ";
@@ -129,9 +132,9 @@
' style='overflow:visible'> bug->osList, $os, "class='form-control chosen'");?> |
' style='overflow:visible'> bug->browserList, $browser, "class='form-control chosen'");?> |
'> |
- loadModel('flow');
- foreach($extendFields as $extendField)
+ foreach($extendFields as $extendField)
{
$object = new stdclass();
$object->{$extendField->field} = $extendField->default;
@@ -184,9 +187,9 @@
' style='overflow:visible'> bug->osList, $os, "class='form-control chosen'");?> |
' style='overflow:visible'> bug->browserList, $browser, "class='form-control chosen'");?> |
'> |
- loadModel('flow');
- foreach($extendFields as $extendField)
+ foreach($extendFields as $extendField)
{
$object = new stdclass();
$object->{$extendField->field} = $extendField->default;
@@ -238,9 +241,9 @@
' style='overflow:visible'> bug->osList, $os, "class='form-control chosen'");?> |
' style='overflow:visible'> bug->browserList, $browser, "class='form-control chosen'");?> |
'> |
- loadModel('flow');
- foreach($extendFields as $extendField)
+ foreach($extendFields as $extendField)
{
$object = new stdclass();
$object->{$extendField->field} = $extendField->default;
diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php
index e27cd36740..50ee11aa13 100644
--- a/module/bug/view/create.html.php
+++ b/module/bug/view/create.html.php
@@ -27,6 +27,7 @@ js::set('oldProjectID', $projectID);
js::set('blockID', $blockID);
js::set('moduleID', $moduleID);
js::set('tab', $this->app->tab);
+js::set('requiredFields', $config->bug->create->requiredFields);
if($this->app->tab == 'execution') js::set('objectID', $executionID);
if($this->app->tab == 'project') js::set('objectID', $projectID);
?>
diff --git a/module/custom/config.php b/module/custom/config.php
index c95872d315..448a48e6eb 100644
--- a/module/custom/config.php
+++ b/module/custom/config.php
@@ -53,7 +53,7 @@ $config->custom->fieldList['task']['edit'] = 'module,pri,estimate,estS
$config->custom->fieldList['task']['finish'] = 'comment';
$config->custom->fieldList['task']['activate'] = 'assignedTo,comment';
$config->custom->fieldList['build'] = 'scmPath,filePath,desc';
-$config->custom->fieldList['bug']['create'] = 'module,project,deadline,type,os,browser,severity,pri,steps,keywords';
+$config->custom->fieldList['bug']['create'] = 'module,project,execution,deadline,type,os,browser,severity,pri,steps,keywords';
$config->custom->fieldList['bug']['edit'] = 'plan,project,assignedTo,deadline,type,os,browser,severity,pri,steps,keywords';
$config->custom->fieldList['bug']['resolve'] = 'resolvedBuild,resolvedDate,assignedTo,comment';
$config->custom->fieldList['testcase']['create'] = 'stage,story,pri,precondition,keywords,module';