diff --git a/module/build/js/create.js b/module/build/js/create.js index 35625a6d40..836a71ed59 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -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); diff --git a/module/build/model.php b/module/build/model.php index ad3e227710..ee1f92c4f8 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -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); diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 5911c0b5f7..0309bcc865 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -45,10 +45,15 @@ '> - type == 'normal' ? '' : $lang->product->branchName[$product->type]?> + + product->branchName[$productType]?>
- branches), "class='form-control chosen' multiple required"); ?> +
diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index 5faea8efd7..45df680489 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -38,6 +38,11 @@ '> + type == 'normal' ? '' : $lang->product->branchName[$product->type]?>
diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index f3f4b04e82..70c455e1bc 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -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();