* Fix build creation interface issues.

This commit is contained in:
tianshujie98
2021-03-18 20:20:11 +08:00
parent 06fdc39972
commit e009d87903
9 changed files with 32 additions and 11 deletions
+3 -1
View File
@@ -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');
+10
View File
@@ -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();
}
+1 -1
View File
@@ -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 = " <span style='color:red'>Dieses {$lang->executionCommon} ist nicht mit einem {$lang->productCommon} verknüpft, daher kann das Build nicht erstellt werden. Bitte erst <a href='%s'> {$lang->productCommon} verknüpfen.</a></span>";
$lang->build->noProduct = " <span id='noProduct' style='color:red'>Dieses {$lang->executionCommon} ist nicht mit einem {$lang->productCommon} verknüpft, daher kann das Build nicht erstellt werden. Bitte erst <a href='%s' data-app='%s'> {$lang->productCommon} verknüpfen.</a></span>";
$lang->build->noBuild = 'Keine Builds. ';
$lang->build->notice = new stdclass();
+1 -1
View File
@@ -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 = " <span style='color:red'>This {$lang->executionCommon} is not linked to {$lang->productCommon}, so the Build cannot be created. Please first <a href='%s'> link {$lang->productCommon}</a></span>";
$lang->build->noProduct = " <span id='noProduct' style='color:red'>This {$lang->executionCommon} is not linked to {$lang->productCommon}, so the Build cannot be created. Please first <a href='%s' data-app='%s'> link {$lang->productCommon}</a></span>";
$lang->build->noBuild = 'No builds yet.';
$lang->build->notice = new stdclass();
+1 -1
View File
@@ -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 = " <span style='color:red'>Ce {$lang->executionCommon} n'est pas associé à un {$lang->productCommon}, le Build ne peut pas être créé. Commencez par <a href='%s'>rattacher le projet à un {$lang->productCommon}</a></span>";
$lang->build->noProduct = " <span id='noProduct' style='color:red'>Ce {$lang->executionCommon} n'est pas associé à un {$lang->productCommon}, le Build ne peut pas être créé. Commencez par <a href='%s' data-app='%s'>rattacher le projet à un {$lang->productCommon}</a></span>";
$lang->build->noBuild = 'Aucun builds.';
$lang->build->notice = new stdclass();
+1 -1
View File
@@ -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 = " <span style='color:red'>{$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 <a href='%s'> {$lang->productCommon} trước</a></span>";
$lang->build->noProduct = " <span id='noProduct' style='color:red'>{$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 <a href='%s' data-app='%s'> {$lang->productCommon} trước</a></span>";
$lang->build->noBuild = 'Không có bản dựng nào';
$lang->build->notice = new stdclass();
+1 -1
View File
@@ -45,7 +45,7 @@ $lang->build->unlinkBug = '移除Bug';
$lang->build->stories = "完成的{$lang->SRCommon}";
$lang->build->bugs = '解决的Bug';
$lang->build->generatedBugs = '产生的Bug';
$lang->build->noProduct = " <span style='color:red'>该{$lang->executionCommon}没有关联{$lang->productCommon},无法创建版本,请先<a href='%s'>关联{$lang->productCommon}</a></span>";
$lang->build->noProduct = " <span id='noProduct' style='color:red'>该{$lang->executionCommon}没有关联{$lang->productCommon},无法创建版本,请先<a href='%s' data-app='%s'>关联{$lang->productCommon}</a></span>";
$lang->build->noBuild = '暂时没有版本。';
$lang->build->notice = new stdclass();
+7 -2
View File
@@ -19,7 +19,7 @@
</div>
<form class='load-indicator main-form form-ajax' id='dataform' method='post' enctype='multipart/form-data'>
<table class='table table-form'>
<?php if(!empty($executions)):?>
<?php if($projectID != 0):?>
<tr>
<th><?php echo $lang->executionCommon;?></th>
<td><?php echo html::select('execution', $executions, $executionID, "onchange='loadProducts(this.value);' class='form-control chosen' required");?></td>
@@ -42,8 +42,13 @@
</td>
<td></td>
<?php else:?>
<td class='text-muted' colspan='2'><?php printf($lang->build->noProduct, $this->createLink('execution', 'manageproducts', "executionID=$executionID&from=buildCreate"));?></td>
<td>
<div class='input-group'>
<?php printf($lang->build->noProduct, $this->createLink('execution', 'manageproducts', "executionID=$executionID&from=buildCreate"), $openApp);?>
</div>
</td>
<?php endif;?>
<td></td>
</tr>
<tr>
<th><?php echo $lang->build->name;?></th>
+7 -3
View File
@@ -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"));
}
/**