From 6c2132567bd5beb19ee2fbbcb7d87b421a490c77 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Fri, 16 Apr 2021 02:39:21 +0000 Subject: [PATCH] * Finish task#37522 --- module/bug/js/common.js | 7 ++++--- module/product/model.php | 4 ++-- module/story/view/create.html.php | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index c8067a6ce1..7a98073c2f 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -228,6 +228,7 @@ function loadProductStories(productID) { branch = $('#branch').val(); if(typeof(branch) == 'undefined') branch = 0; + if(typeof(oldStoryID) == 'undefined') oldStoryID = 0; link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleId=0&storyID=' + oldStoryID); $('#storyIdBox').load(link, function(){$('#story').chosen();}); } @@ -243,7 +244,8 @@ function loadProductProjects(productID) { if(systemMode == 'classic') { - loadProductExecutions(productID); + var projectID = $('#execution').find("option:selected").val(); + loadProductExecutions(productID, projectID); return true; } @@ -269,8 +271,6 @@ function loadProductProjects(productID) */ function loadProductExecutions(productID, projectID = 0) { - if(!projectID && systemMode != 'classic') projectID = $('#project').find("option:selected").val(); - if(!projectID && systemMode != 'classic') productID = 0; required = $('#execution_chosen').hasClass('required'); branch = $('#branch').val(); if(typeof(branch) == 'undefined') branch = 0; @@ -390,6 +390,7 @@ function loadExecutionStories(executionID) { branch = $('#branch').val(); if(typeof(branch) == 'undefined') branch = 0; + if(typeof(oldStoryID) == 'undefined') oldStoryID = 0; link = createLink('story', 'ajaxGetExecutionStories', 'executionID=' + executionID + '&productID=' + $('#product').val() + '&branch=' + branch + '&moduleID=0&storyID=' + oldStoryID); $('#storyIdBox').load(link, function(){$('#story').chosen();}); } diff --git a/module/product/model.php b/module/product/model.php index 4b4b8f44ad..43fe6c4e1f 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -821,8 +821,8 @@ class productModel extends model ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.product')->eq($productID) ->andWhere('t2.type')->eq('project') - ->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi() + ->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi() ->andWhere('t2.deleted')->eq('0') ->fetchPairs(); } @@ -961,7 +961,7 @@ class productModel extends model public function getExecutionPairsByProduct($productID, $branch = 0, $orderBy = 'id_asc', $projectID = 0) { if(empty($productID)) return array(); - if(empty($projectID)) return $this->getAllExecutionPairsByProduct($productID, $branch); + if(empty($projectID) or $this->config->systemMode == 'classic') return $this->getAllExecutionPairsByProduct($productID, $branch); $project = $this->loadModel('project')->getByID($projectID); $orderBy = $project->model == 'waterfall' ? 'begin_asc,id_asc' : 'begin_desc,id_desc'; diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 9d5f0cbf3f..f7aeab84ea 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -257,7 +257,6 @@ - story->module);?>