diff --git a/module/bug/js/common.js b/module/bug/js/common.js
index 92ff94764e..a3699ef386 100644
--- a/module/bug/js/common.js
+++ b/module/bug/js/common.js
@@ -209,7 +209,8 @@ function loadProductModules(productID)
{
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
- link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true');
+ if(typeof(moduleID) == 'undefined') moduleID = 0;
+ link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=¤tModuleID=' + moduleID);
$('#moduleIdBox').load(link, function()
{
$(this).find('select').chosen()
diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php
index 7dba03779c..a742898300 100644
--- a/module/bug/view/create.html.php
+++ b/module/bug/view/create.html.php
@@ -25,6 +25,7 @@ js::set('stepsNotEmpty', $lang->bug->stepsNotEmpty);
js::set('isStepsTemplate', $isStepsTemplate);
js::set('oldProjectID', $projectID);
js::set('blockID', $blockID);
+js::set('moduleID', $moduleID);
?>
diff --git a/module/todo/css/batchcreate.css b/module/todo/css/batchcreate.css
index 222fe0e42e..19576bc2ab 100755
--- a/module/todo/css/batchcreate.css
+++ b/module/todo/css/batchcreate.css
@@ -16,3 +16,7 @@ html[lang="en"] .main-header > .input-group {width: 250px;}
#formSettingBtn {position: absolute; top: 14px; right: 20px; z-index: 1000;}
#formSettingBtn .dropdown {margin-right: 0px;}
+#formSettingBtn #formSetting {padding: 10px 12px;}
+#formSettingBtn .checkboxes {padding: 10px 3px;}
+#formSettingBtn .checkbox-primary {width: 50%; float: left; margin: 3px 0;}
+#formSetting .btn {margin-right: 8px;}
diff --git a/module/tree/control.php b/module/tree/control.php
index d1d3686718..eaf069b278 100644
--- a/module/tree/control.php
+++ b/module/tree/control.php
@@ -419,10 +419,12 @@ class tree extends control
* @param string $returnType
* @param string $fieldID
* @param bool $needManage
+ * @param string $extra
+ * @param int $currentModuleID
* @access public
* @return string the html select string.
*/
- public function ajaxGetOptionMenu($rootID, $viewType = 'story', $branch = 0, $rootModuleID = 0, $returnType = 'html', $fieldID = '', $needManage = false, $extra = '')
+ public function ajaxGetOptionMenu($rootID, $viewType = 'story', $branch = 0, $rootModuleID = 0, $returnType = 'html', $fieldID = '', $needManage = false, $extra = '', $currentModuleID = 0)
{
if($viewType == 'task')
{
@@ -448,7 +450,7 @@ class tree extends control
$changeFunc = '';
if($viewType == 'task' or $viewType == 'bug' or $viewType == 'case') $changeFunc = "onchange='loadModuleRelated()'";
$field = $fieldID ? "modules[$fieldID]" : 'module';
- $output = html::select("$field", $optionMenu, '', "class='form-control' $changeFunc");
+ $output = html::select("$field", $optionMenu, $currentModuleID, "class='form-control' $changeFunc");
if(count($optionMenu) == 1 and $needManage)
{
$output .= "";
diff --git a/test/init.php b/test/init.php
index 7fbea75295..93c3aa8626 100644
--- a/test/init.php
+++ b/test/init.php
@@ -29,6 +29,13 @@ $tester = $app->loadCommon();
$config->zendataRoot = dirname(__FILE__) . DS . 'zendata';
$config->zdPath = "/usr/local/zd/zd";
+/**
+ * Save variable to $_result.
+ *
+ * @param mix $result
+ * @access public
+ * @return bool true
+ */
function run($result)
{
global $_result;
@@ -36,6 +43,14 @@ function run($result)
return true;
}
+/**
+ * Print expect data.
+ *
+ * @param int $key
+ * @param string $delimiter
+ * @access public
+ * @return void
+ */
function expect($key, $delimiter = ',')
{
global $_result;
@@ -66,6 +81,15 @@ function expect($key, $delimiter = ',')
echo "\n";
}
+/**
+ * Import data create by zendata to one table.
+ *
+ * @param string $table
+ * @param string $yaml
+ * @param int $count
+ * @access public
+ * @return void
+ */
function zdImport($table, $yaml, $count = 10)
{
chdir(dirname(__FILE__));