* Fix build create
This commit is contained in:
@@ -71,15 +71,16 @@ function loadProducts(executionID)
|
||||
|
||||
$('#productBox').append(data);
|
||||
$('#product').chosen();
|
||||
|
||||
$.get(createLink('product', 'ajaxGetProductById', 'produtID=' + $("#product").val()), function(data)
|
||||
{
|
||||
$('#branchBox').closest('tr').find('th').text(data.branchName);
|
||||
}, 'json');
|
||||
|
||||
loadBranches($("#product").val());
|
||||
}
|
||||
});
|
||||
|
||||
$.get(createLink('product', 'ajaxGetProductById', 'produtID=' + $("#product").val()), function(data)
|
||||
{
|
||||
$('#branchBox').closest('tr').find('th').text(data.branchName);
|
||||
}, 'json');
|
||||
|
||||
loadLastBuild();
|
||||
}
|
||||
|
||||
@@ -94,7 +95,7 @@ function loadLastBuild()
|
||||
var isIntegrated = $('input[name=isIntegrated]:checked').val();
|
||||
var projectID = $('#project').val();
|
||||
var executionID = $('#execution').val();
|
||||
if(isIntegrated == 'yes') executionID = 0;
|
||||
if(isIntegrated == 'yes') executionID = 0;
|
||||
$.get(createLink('build', 'ajaxGetLastBuild', 'projectID=' + projectID + '&executionID=' + executionID), function(data)
|
||||
{
|
||||
$('#lastBuildBox').html(data);
|
||||
|
||||
@@ -407,7 +407,7 @@ class buildModel extends model
|
||||
}
|
||||
|
||||
$product = $this->loadModel('product')->getByID($build->product);
|
||||
if($product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch']))
|
||||
if(!empty($product) and $product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch']))
|
||||
{
|
||||
$this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
|
||||
dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch);
|
||||
@@ -456,7 +456,7 @@ class buildModel extends model
|
||||
->get();
|
||||
|
||||
$product = $this->loadModel('product')->getByID($build->product);
|
||||
if($product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch']))
|
||||
if(!empty($product) and $product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch']))
|
||||
{
|
||||
$this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
|
||||
dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch);
|
||||
|
||||
@@ -45,10 +45,15 @@
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class='<?php if((!empty($product) and $product->type == 'normal') or empty($product)) echo 'hidden'?>'>
|
||||
<th class='w-120px'><?php echo $product->type == 'normal' ? '' : $lang->product->branchName[$product->type]?></th>
|
||||
<?php
|
||||
if(empty($product)) $product = new stdclass();
|
||||
$productType = zget($product, 'type', 'normal');
|
||||
$productBranches = zget($product, 'branches', array());
|
||||
?>
|
||||
<th class='w-120px'><?php echo $productType == 'normal' ? '' : $lang->product->branchName[$productType]?></th>
|
||||
<td>
|
||||
<div class='input-group' id='branchBox'>
|
||||
<?php echo html::select('branch[]', $branches, key($product->branches), "class='form-control chosen' multiple required"); ?>
|
||||
<?php echo html::select('branch[]', $branches, key($productBranches), "class='form-control chosen' multiple required"); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -38,6 +38,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class='<?php if((!empty($product) and $product->type == 'normal') or empty($product)) echo 'hidden'?>'>
|
||||
<?php
|
||||
if(empty($product)) $product = new stdclass();
|
||||
$productType = zget($product, 'type', 'normal');
|
||||
$productBranches = zget($product, 'branches', array());
|
||||
?>
|
||||
<th class='w-120px'><?php echo $product->type == 'normal' ? '' : $lang->product->branchName[$product->type]?></th>
|
||||
<td>
|
||||
<div class='input-group' id='branchBox'>
|
||||
|
||||
@@ -204,7 +204,7 @@ class projectrelease extends control
|
||||
$this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->release->edit;
|
||||
$this->view->position[] = $this->lang->release->edit;
|
||||
$this->view->release = $release;
|
||||
$this->view->builds = $builds;
|
||||
$this->view->builds = $builds;a($builds);exit;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed');
|
||||
|
||||
$this->display();
|
||||
|
||||
Reference in New Issue
Block a user