From fa78b0914fb54af632b361e9ca379ab17db13c4f Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Mon, 30 Jan 2023 10:03:31 +0800 Subject: [PATCH 1/2] * Fix bug#31461. --- module/bug/js/common.js | 9 ++++++++- module/projectrelease/control.php | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index cb51d5fc15..05a7ea7c13 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -866,9 +866,16 @@ function notice() var html = ''; if($('#execution').length == 0 || $('#execution').val() == 0) { - var branch = $('#branch').val(); + var branch = $('#branch').val(); + var projectID = $('#project').val(); + console.log(projectID); + 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"))); } From 9bada2157b1e3131451d44a0a88b07984b02245e Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Mon, 30 Jan 2023 10:04:52 +0800 Subject: [PATCH 2/2] * Delete unused code. --- module/bug/js/common.js | 1 - 1 file changed, 1 deletion(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 05a7ea7c13..a6bb07c705 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -868,7 +868,6 @@ function notice() { var branch = $('#branch').val(); var projectID = $('#project').val(); - console.log(projectID); if(typeof(branch) == 'undefined') branch = 0; if(typeof(projectID) == 'undefined') projectID = 0;