diff --git a/module/build/control.php b/module/build/control.php index fc9361acd6..b9d08080ca 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -73,7 +73,9 @@ class build extends control $this->view->branches = (isset($productGroups[$productID]) and $productGroups[$productID]->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($productID); $this->view->executionID = $executionID; $this->view->products = $products; - $this->view->executions = isset($executions) ? $executions : array(); + $this->view->projectID = $projectID; + $this->view->executions = $executions; + $this->view->openApp = $this->app->openApp; $this->view->lastBuild = $this->build->getLast($executionID); $this->view->productGroups = $productGroups; $this->view->users = $this->user->getPairs('nodeleted|noclosed'); diff --git a/module/build/js/create.js b/module/build/js/create.js index 88b5082cb7..be0424982b 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -19,10 +19,20 @@ function loadProducts(executionID) $('#product_chosen').remove(); $('#branch').remove(); $('#branch_chosen').remove(); + $('#noProduct').remove(); $.get(createLink('product', 'ajaxGetProducts', 'executionID=' + executionID), function(data) { if(data) { + if(data.indexOf("required") != -1) + { + $('.input-group').addClass('required'); + } + else + { + $('.input-group').removeClass('required'); + } + $('.input-group').append(data); $('#product').chosen(); } diff --git a/module/build/lang/de.php b/module/build/lang/de.php index aa5bd24bea..b0b86e3e36 100644 --- a/module/build/lang/de.php +++ b/module/build/lang/de.php @@ -45,7 +45,7 @@ $lang->build->unlinkBug = 'Bug Verknüpgung aufheben'; $lang->build->stories = "Abgeschlossene {$lang->SRCommon}"; $lang->build->bugs = 'Gelöster Bug'; $lang->build->generatedBugs = 'Left Bug'; -$lang->build->noProduct = " Dieses {$lang->executionCommon} ist nicht mit einem {$lang->productCommon} verknüpft, daher kann das Build nicht erstellt werden. Bitte erst {$lang->productCommon} verknüpfen."; +$lang->build->noProduct = " Dieses {$lang->executionCommon} ist nicht mit einem {$lang->productCommon} verknüpft, daher kann das Build nicht erstellt werden. Bitte erst {$lang->productCommon} verknüpfen."; $lang->build->noBuild = 'Keine Builds. '; $lang->build->notice = new stdclass(); diff --git a/module/build/lang/en.php b/module/build/lang/en.php index 7fb98b5162..d8212d1511 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -45,7 +45,7 @@ $lang->build->unlinkBug = 'Unlink Bug'; $lang->build->stories = "Finished {$lang->SRCommon}"; $lang->build->bugs = 'Resolved Bugs'; $lang->build->generatedBugs = 'Reported Bugs'; -$lang->build->noProduct = " This {$lang->executionCommon} is not linked to {$lang->productCommon}, so the Build cannot be created. Please first link {$lang->productCommon}"; +$lang->build->noProduct = " This {$lang->executionCommon} is not linked to {$lang->productCommon}, so the Build cannot be created. Please first link {$lang->productCommon}"; $lang->build->noBuild = 'No builds yet.'; $lang->build->notice = new stdclass(); diff --git a/module/build/lang/fr.php b/module/build/lang/fr.php index 79936e924d..c1ae861a86 100644 --- a/module/build/lang/fr.php +++ b/module/build/lang/fr.php @@ -45,7 +45,7 @@ $lang->build->unlinkBug = 'Retirer Bug'; $lang->build->stories = 'Stories terminées'; $lang->build->bugs = 'Bugs Résolus'; $lang->build->generatedBugs = 'Bugs signalés'; -$lang->build->noProduct = " Ce {$lang->executionCommon} n'est pas associé à un {$lang->productCommon}, le Build ne peut pas être créé. Commencez par rattacher le projet à un {$lang->productCommon}"; +$lang->build->noProduct = " Ce {$lang->executionCommon} n'est pas associé à un {$lang->productCommon}, le Build ne peut pas être créé. Commencez par rattacher le projet à un {$lang->productCommon}"; $lang->build->noBuild = 'Aucun builds.'; $lang->build->notice = new stdclass(); diff --git a/module/build/lang/vi.php b/module/build/lang/vi.php index 1328c257ce..db54213729 100644 --- a/module/build/lang/vi.php +++ b/module/build/lang/vi.php @@ -45,7 +45,7 @@ $lang->build->unlinkBug = 'Hủy liên kết Bug'; $lang->build->stories = "{$lang->SRCommon} đã kết thúc"; $lang->build->bugs = 'Bugs đã giải quyết'; $lang->build->generatedBugs = 'Bugs đã báo cáo'; -$lang->build->noProduct = " {$lang->executionCommon} này chưa liên kết tới {$lang->productCommon}, bởi vậy Bản dựng này không thể tạo. Vui lòng liên kết {$lang->productCommon} trước"; +$lang->build->noProduct = " {$lang->executionCommon} này chưa liên kết tới {$lang->productCommon}, bởi vậy Bản dựng này không thể tạo. Vui lòng liên kết {$lang->productCommon} trước"; $lang->build->noBuild = 'Không có bản dựng nào'; $lang->build->notice = new stdclass(); diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index a30e340da5..d62cd8e7dc 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -45,7 +45,7 @@ $lang->build->unlinkBug = '移除Bug'; $lang->build->stories = "完成的{$lang->SRCommon}"; $lang->build->bugs = '解决的Bug'; $lang->build->generatedBugs = '产生的Bug'; -$lang->build->noProduct = " 该{$lang->executionCommon}没有关联{$lang->productCommon},无法创建版本,请先关联{$lang->productCommon}"; +$lang->build->noProduct = " 该{$lang->executionCommon}没有关联{$lang->productCommon},无法创建版本,请先关联{$lang->productCommon}"; $lang->build->noBuild = '暂时没有版本。'; $lang->build->notice = new stdclass(); diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index cac65c62b6..40bc75208c 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -19,7 +19,7 @@
- + @@ -42,8 +42,13 @@ - + + diff --git a/module/product/control.php b/module/product/control.php index b9787e2bd2..1bef8db7f9 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -814,10 +814,14 @@ class product extends control */ public function ajaxGetProducts($executionID) { - $products = array('' => ''); - $products += $this->product->getProductPairsByProject($executionID); + $this->loadModel('build'); + $products = $this->product->getProductPairsByProject($executionID); + if(empty($products)) + { + die(printf($this->lang->build->noProduct, $this->createLink('execution', 'manageproducts', "executionID=$executionID&from=buildCreate"), 'project')); + } - die(html::select('product', $products, '', "class='form-control' onchange='loadBranches(this.value)'")); + die(html::select('product', $products, empty($product) ? '' : $product->id, "onchange='loadBranches(this.value);' class='form-control chosen' required")); } /**
executionCommon;?> build->noProduct, $this->createLink('execution', 'manageproducts', "executionID=$executionID&from=buildCreate"));?> +
+ build->noProduct, $this->createLink('execution', 'manageproducts', "executionID=$executionID&from=buildCreate"), $openApp);?> +
+
build->name;?>