diff --git a/framework/control.class.php b/framework/control.class.php index 88ae4d1f43..eec2546cbb 100644 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -37,7 +37,7 @@ class control extends baseControl if(!isset($this->config->bizVersion)) return false; /* Code for task #9224. Set requiredFields for workflow. */ - if($this->dbh and $this->moduleName != 'upgrade' and $this->moduleName != 'install') + if($this->dbh and $this->moduleName != 'upgrade' and $this->moduleName != 'install' and !defined('IN_INSTALL') and !defined('IN_UPGRADE')) { $this->checkRequireFlowField(); diff --git a/module/repo/model.php b/module/repo/model.php index 4f4546460b..33d8938ab7 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -1374,6 +1374,23 @@ class repoModel extends model $action->action = $scm == 'svn' ? 'svncommited' : 'gitcommited'; $changes = $this->createActionChanges($log, $repoRoot, $scm); + if($objects['stories']) + { + $productsAndProjects = $this->getTaskProductsAndProjects($objects['stories']); + foreach($objects['stories'] as $storyID) + { + $storyID = (int)$storyID; + if(!isset($productsAndProjects[$storyID])) continue; + + $action->objectType = 'story'; + $action->objectID = $storyID; + $action->product = $productsAndProjects[$storyID]['product']; + $action->project = $productsAndProjects[$storyID]['project']; + + $this->saveRecord($action, $changes); + } + } + if($objects['tasks']) { $productsAndProjects = $this->getTaskProductsAndProjects($objects['tasks']); diff --git a/module/task/model.php b/module/task/model.php index 616078dd71..043b2fc7b3 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -117,19 +117,21 @@ class taskModel extends model { if($storyID) $testStoryIdList[$storyID] = $storyID; } - $testStories = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($testStoryIdList)->fetchPairs('id', 'title'); + $testStories = $this->dao->select('id,title,version')->from(TABLE_STORY)->where('id')->in($testStoryIdList)->fetchAll('id'); foreach($this->post->testStory as $i => $storyID) { if(!isset($testStories[$storyID])) continue; - $task->parent = $taskID; - $task->story = $storyID; - $task->name = $this->lang->task->lblTestStory . " #{$storyID} " . zget($testStories, $storyID); - $task->pri = $this->post->testPri[$i]; - $task->estStarted = $this->post->testEstStarted[$i]; - $task->deadline = $this->post->testDeadline[$i]; - $task->assignedTo = $this->post->testAssignedTo[$i]; - $task->estimate = $this->post->testEstimate[$i]; + $task->parent = $taskID; + $task->story = $storyID; + $task->storyVersion = $testStories[$storyID]->version; + $task->name = $this->lang->task->lblTestStory . " #{$storyID} " . $testStories[$storyID]->title; + $task->pri = $this->post->testPri[$i]; + $task->estStarted = $this->post->testEstStarted[$i]; + $task->deadline = $this->post->testDeadline[$i]; + $task->assignedTo = $this->post->testAssignedTo[$i]; + $task->estimate = $this->post->testEstimate[$i]; + $task->left = $this->post->testEstimate[$i]; $this->dao->insert(TABLE_TASK)->data($task)->exec(); $childTaskID = $this->dao->lastInsertID();