diff --git a/module/bug/control.php b/module/bug/control.php index f627ec747c..d141e48530 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -395,14 +395,26 @@ class bug extends control } /* Set custom. */ - foreach(explode(',', $this->config->bug->list->customBatchCreateFields) as $field) $customFields[$field] = $this->lang->bug->$field; + $product = $this->product->getById($productID); + foreach(explode(',', $this->config->bug->list->customBatchCreateFields) as $field) + { + if($product->type != 'normal') $customFields[$product->type] = $this->lang->product->branchName[$product->type]; + $customFields[$field] = $this->lang->bug->$field; + } + $showFields = $this->config->bug->custom->batchCreateFields; + if($product->type == 'normal') + { + $showFields = str_replace(array(0 => ",branch,", 1 => ",platform,"), '', ",$showFields,"); + $showFields = trim($showFields, ','); + } $this->view->customFields = $customFields; - $this->view->showFields = $this->config->bug->custom->batchCreateFields; + $this->view->showFields = $showFields; $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->batchCreate; $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]); $this->view->position[] = $this->lang->bug->batchCreate; + $this->view->product = $product; $this->view->productID = $productID; $this->view->stories = $stories; $this->view->builds = $builds; diff --git a/module/bug/model.php b/module/bug/model.php index 5c00b9575b..9aac978430 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -87,7 +87,7 @@ class bugModel extends model $data = fixer::input('post')->get(); $batchNum = count(reset($data)); - $result = $this->loadModel('common')->removeDuplicate('bug', $data, "product={$productID} and branch={$branch}"); + $result = $this->loadModel('common')->removeDuplicate('bug', $data, "product={$productID}"); $data = $result['data']; for($i = 0; $i < $batchNum; $i++) @@ -132,7 +132,7 @@ class bugModel extends model $bug->openedBy = $this->app->user->account; $bug->openedDate = $now; $bug->product = $productID; - $bug->branch = $branch; + $bug->branch = $data->branches[$i]; $bug->module = $data->modules[$i]; $bug->project = $data->projects[$i]; $bug->openedBuild = implode(',', $data->openedBuilds[$i]); diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php index e3083c0e16..95841f6b1b 100644 --- a/module/bug/view/batchcreate.html.php +++ b/module/bug/view/batchcreate.html.php @@ -38,6 +38,7 @@ foreach(explode(',', $showFields) as $field) idAB;?> + '> product->branch;?> '> bug->module;?> '>bug->project;?> bug->openedBuild;?> @@ -78,6 +79,7 @@ foreach(explode(',', $showFields) as $field) ?> + '> ' style='overflow:visible'> ' style='overflow:visible'> @@ -110,6 +112,7 @@ foreach(explode(',', $showFields) as $field) ?> + '> ' style='overflow:visible'> ' style='overflow:visible'> @@ -138,6 +141,7 @@ foreach(explode(',', $showFields) as $field) %s + '> ' style='overflow:visible'> ' style='overflow:visible'> diff --git a/module/testcase/control.php b/module/testcase/control.php index 8e5c9142bf..46561de566 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -380,14 +380,26 @@ class testcase extends control $moduleOptionMenu['ditto'] = $this->lang->testcase->ditto; /* Set custom. */ - foreach(explode(',', $this->config->testcase->customBatchCreateFields) as $field) $customFields[$field] = $this->lang->testcase->$field; + $product = $this->product->getById($productID); + foreach(explode(',', $this->config->testcase->customBatchCreateFields) as $field) + { + if($product->type != 'normal') $customFields[$product->type] = $this->lang->product->branchName[$product->type]; + $customFields[$field] = $this->lang->testcase->$field; + } + $showFields = $this->config->testcase->custom->batchCreateFields; + if($product->type == 'normal') + { + str_replace(array(0 => ",branch,", 1 => ",platform,"), '', $showFields); + trim($showFields, ','); + } $this->view->customFields = $customFields; - $this->view->showFields = $this->config->testcase->custom->batchCreateFields; + $this->view->showFields = $showFields; $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->batchCreate; $this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]); $this->view->position[] = $this->lang->testcase->common; $this->view->position[] = $this->lang->testcase->batchCreate; + $this->view->product = $product; $this->view->productID = $productID; $this->view->story = $story; $this->view->storyList = $storyList; diff --git a/module/testcase/model.php b/module/testcase/model.php index e4150faf7f..ce63c620db 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -93,7 +93,7 @@ class testcaseModel extends model $cases = fixer::input('post')->get(); $batchNum = count(reset($cases)); - $result = $this->loadModel('common')->removeDuplicate('case', $cases, "product={$productID} and branch={$branch}"); + $result = $this->loadModel('common')->removeDuplicate('case', $cases, "product={$productID}"); $cases = $result['data']; for($i = 0; $i < $batchNum; $i++) @@ -125,7 +125,7 @@ class testcaseModel extends model { $data[$i] = new stdclass(); $data[$i]->product = $productID; - $data[$i]->branch = $branch; + $data[$i]->branch = $cases->branch[$i]; $data[$i]->module = $cases->module[$i]; $data[$i]->type = $cases->type[$i]; $data[$i]->pri = $cases->pri[$i]; diff --git a/module/testcase/view/batchcreate.html.php b/module/testcase/view/batchcreate.html.php index a976be483b..2b2519dce1 100644 --- a/module/testcase/view/batchcreate.html.php +++ b/module/testcase/view/batchcreate.html.php @@ -43,6 +43,7 @@ foreach(explode(',', $showFields) as $field) idAB;?> + '>product->branch;?> '>testcase->module;?> '> testcase->story;?> testcase->title;?> @@ -65,6 +66,7 @@ foreach(explode(',', $showFields) as $field) ?> + '> ' style='overflow:visible'> ' style='overflow:visible'> id : '', 'class="form-control chosen"');?> @@ -89,6 +91,7 @@ foreach(explode(',', $showFields) as $field) %s + '> ' style='overflow:visible'> ' style='overflow:visible'>