diff --git a/module/bug/js/common.js b/module/bug/js/common.js
index cb51d5fc15..a6bb07c705 100644
--- a/module/bug/js/common.js
+++ b/module/bug/js/common.js
@@ -866,9 +866,15 @@ function notice()
var html = '';
if($('#execution').length == 0 || $('#execution').val() == 0)
{
- var branch = $('#branch').val();
+ var branch = $('#branch').val();
+ var projectID = $('#project').val();
+
if(typeof(branch) == 'undefined') branch = 0;
+ if(typeof(projectID) == 'undefined') projectID = 0;
+
var link = createLink('release', 'create', 'productID=' + $('#product').val() + '&branch=' + branch);
+ if(projectID > 0) link = createLink('projectrelease', 'create', 'projectID=' + projectID);
+
if(config.onlybody != 'yes') link += link.indexOf('?') >= 0 ? '&onlybody=yes' : '?onlybody=yes';
html += '' + createRelease + ' ';
html += '' + refresh + '';
diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php
index a5caeecf1f..ab9fc56834 100644
--- a/module/projectrelease/control.php
+++ b/module/projectrelease/control.php
@@ -137,6 +137,8 @@ class projectrelease extends control
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $releaseID));
+ if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true));
+
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID")));
}