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/common/view/sortable.html.php b/module/common/view/sortable.html.php index 7c235b3803..440261dfcd 100644 --- a/module/common/view/sortable.html.php +++ b/module/common/view/sortable.html.php @@ -1,12 +1,10 @@ getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>