diff --git a/api/v1/entries/story.php b/api/v1/entries/story.php index 10580c0f8a..a3ee64e3db 100644 --- a/api/v1/entries/story.php +++ b/api/v1/entries/story.php @@ -53,22 +53,41 @@ class storyEntry extends Entry } $story->moduleTitle = $moduleTitle; + $users = $this->loadModel('user')->getList(); + + $simplifyUsers = array(); + foreach($users as $user) + { + $simplifyUser = new stdclass(); + $simplifyUser->id = $user->id; + $simplifyUser->account = $user->account; + $simplifyUser->realname = $user->realname; + $simplifyUser->avatar = $user->avatar; + $simplifyUsers[$user->account] = $simplifyUser; + } + $storyTasks = array(); foreach($story->tasks as $executionTasks) { foreach($executionTasks as $task) { if(!isset($data->data->executions->{$task->execution})) continue; - $storyTasks[] = $this->filterFields($task, 'id,name,type'); + $assignedTo = new stdClass(); + $assignedTo->account = $simplifyUsers[$task->assignedTo]->account; + $assignedTo->realname = $simplifyUsers[$task->assignedTo]->realname; + $assignedTo->avatar = $simplifyUsers[$task->assignedTo]->avatar; + + $task->assign = $assignedTo; + $storyTasks[] = $this->filterFields($task, 'id,name,type,status,assignedTo'); } } $story->tasks = $storyTasks; $story->bugs = array(); - foreach($data->data->bugs as $bug) $story->bugs[] = $this->filterFields($bug, 'id,title'); + foreach($data->data->bugs as $bug) $story->bugs[] = $this->filterFields($bug, 'id,title,status,pri,severity'); $story->cases = array(); - foreach($data->data->cases as $case) $story->cases[] = $this->filterFields($case, 'id,title'); + foreach($data->data->cases as $case) $story->cases[] = $this->filterFields($case, 'id,title,pri,status'); $story->requirements = array(); foreach($data->data->relations as $relation) $story->requirements[] = $this->filterFields($relation, 'id,title'); diff --git a/module/story/control.php b/module/story/control.php index 41f93c25b2..6b31283fc2 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1122,7 +1122,7 @@ class story extends control $story->files = $this->loadModel('file')->getByObject($story->type, $storyID); $product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id, type, status')->fetch(); $plan = $this->dao->findById($story->plan)->from(TABLE_PRODUCTPLAN)->fetch('title'); - $bugs = $this->dao->select('id,title')->from(TABLE_BUG)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll(); + $bugs = $this->dao->select('id,title,status,pri,severity')->from(TABLE_BUG)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll(); $fromBug = $this->dao->select('id,title')->from(TABLE_BUG)->where('toStory')->eq($storyID)->fetch(); $cases = $this->dao->select('id,title')->from(TABLE_CASE)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll(); $linkedMRs = $this->loadModel('mr')->getLinkedMRPairs($storyID, 'story');