diff --git a/module/product/js/create.js b/module/product/js/create.js index 9c79b3cd40..3c83f0867d 100644 --- a/module/product/js/create.js +++ b/module/product/js/create.js @@ -1,6 +1,6 @@ $(function() { - if(programID) $('#line_chosen').addClass('hidden'); + if(programID || systemMode) $('#line_chosen').addClass('hidden'); $('#lineName').css('border-left-color', ''); }) /** diff --git a/module/story/model.php b/module/story/model.php index da911b2a70..0875f2a6f5 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2706,12 +2706,11 @@ class storyModel extends model ->where('t1.project')->eq((int)$executionID) ->andWhere('t2.deleted')->eq(0) ->beginIF($productID)->andWhere('t2.product')->eq((int)$productID)->fi() - ->beginIF($branch != 'all')->andWhere('t2.branch')->eq($branch)->fi() + ->beginIF($branch !== 'all')->andWhere('t2.branch')->eq($branch)->fi() ->beginIF($moduleIdList)->andWhere('t2.module')->in($moduleIdList)->fi() ->beginIF($status == 'unclosed')->andWhere('t2.status')->ne('closed')->fi() ->orderBy('t1.`order` desc') ->fetchAll(); - return empty($stories) ? array() : $this->formatStories($stories, $type); } diff --git a/module/task/control.php b/module/task/control.php index 52adac1132..24a1e4dca6 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -312,10 +312,18 @@ class task extends control $this->view->customFields = $customFields; $this->view->showFields = $this->config->task->custom->batchCreateFields; + $story = $this->story->getByID($storyID); + if($story and empty($moduleID)) + { + $moduleID = $story->module; + $stories = $this->story->getExecutionStoryPairs($executionID, 0, 'all', $moduleID, 'short'); + } + else + { + $stories = $this->story->getExecutionStoryPairs($executionID, 0, 'all', 0, 'short'); + } - $stories = $this->story->getExecutionStoryPairs($executionID, 0, 0, 0, 'short'); - $members = $this->loadModel('user')->getTeamMemberPairs($executionID, 'execution', 'nodeleted'); - + $members = $this->loadModel('user')->getTeamMemberPairs($executionID, 'execution', 'nodeleted'); $showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : ''; $modules = $this->loadModel('tree')->getTaskOptionMenu($executionID, 0, 0, $showAllModule ? 'allModule' : ''); @@ -333,7 +341,7 @@ class task extends control $this->view->modules = $modules; $this->view->parent = $taskID; $this->view->storyID = $storyID; - $this->view->story = $this->story->getByID($storyID); + $this->view->story = $story; $this->view->storyTasks = $this->task->getStoryTaskCounts(array_keys($stories), $executionID); $this->view->members = $members; $this->view->moduleID = $moduleID; diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index 2b11382752..1c4416ea19 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -38,7 +38,7 @@ function toggleCheck(obj) /* Get select of stories.*/ function setStories(moduleID, executionID, num) { - link = createLink('story', 'ajaxGetExecutionStories', 'executionID=' + executionID + '&productID=0&branch=0&moduleID=' + moduleID + '&storyID=0&num=' + num + '&type=short'); + link = createLink('story', 'ajaxGetExecutionStories', 'executionID=' + executionID + '&productID=0&branch=all&moduleID=' + moduleID + '&storyID=0&num=' + num + '&type=short'); $.get(link, function(stories) { var storyID = $('#story' + num).val(); diff --git a/module/task/js/create.js b/module/task/js/create.js index d72685e7bc..691e4817e5 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -273,7 +273,7 @@ function loadModuleRelated() /* Get select of stories.*/ function setStories(moduleID, executionID) { - link = createLink('story', 'ajaxGetExecutionStories', 'executionID=' + executionID + '&productID=0&branch=0&moduleID=' + moduleID); + link = createLink('story', 'ajaxGetExecutionStories', 'executionID=' + executionID + '&productID=0&branch=all&moduleID=' + moduleID); $.get(link, function(stories) { var storyID = $('#story').val(); diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index 905c159823..723c676fff 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -91,18 +91,17 @@ $currentStory = $storyID; $type = ''; $member = ''; - $module = $story ? $story->module : $moduleID; } else { - $currentStory = $type = $member = $module = 'ditto'; + $currentStory = $type = $member = $moduleID = 'ditto'; } ?>