diff --git a/module/todo/control.php b/module/todo/control.php index 98c7810db0..75209bcf1c 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -187,10 +187,16 @@ class todo extends control $user = $this->loadModel('user')->getById($userID, 'id'); $account = $user->account; - $bugs = $this->bug->getUserBugPairs($account); - $tasks = $this->task->getUserTaskPairs($account, $status); - $storys = $this->loadModel('story')->getUserStoryPairs($account); - $allTodos = $this->todo->getList($type, $account, $status); + $bugs = $this->bug->getUserBugPairs($account); + $tasks = $this->task->getUserTaskPairs($account, $status); + $storys = $this->loadModel('story')->getUserStoryPairs($account); + $issues = $this->loadModel('issue')->getUserIssuePairs($account); + $risks = $this->loadModel('risk')->getUserRiskPairs($account); + $testtasks = $this->loadModel('testtask')->getUserTestTaskPairs($account); + + $reviews = array(); + if(isset($this->config->qcVersion)) $reviews = $this->loadModel('review')->getUserReviewPairs($account); + $allTodos = $this->todo->getList($type, $account, $status); if($this->post->todoIDList) $todoIDList = $this->post->todoIDList; /* Initialize todos whose need to edited. */ @@ -203,9 +209,13 @@ class todo extends control } foreach($editedTodos as $todo) { - if($todo->type == 'story') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_STORY)->fetch('title'); - if($todo->type == 'task') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TASK)->fetch('name'); - if($todo->type == 'bug') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_BUG)->fetch('title'); + if($todo->type == 'story') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_STORY)->fetch('title'); + if($todo->type == 'task') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TASK)->fetch('name'); + if($todo->type == 'bug') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_BUG)->fetch('title'); + if($todo->type == 'issue') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_ISSUE)->fetch('title'); + if($todo->type == 'risk') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_RISK)->fetch('name'); + if($todo->type == 'review') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_REVIEW)->fetch('title'); + if($todo->type == 'testtask') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TESTTASK)->fetch('name'); $todo->begin = $todo->begin ? str_replace(':', '', $todo->begin) : '2400'; $todo->end = $todo->end ? str_replace(':', '', $todo->end) : '2400'; } @@ -231,6 +241,10 @@ class todo extends control $this->view->bugs = $bugs; $this->view->tasks = $tasks; $this->view->storys = $storys; + $this->view->issues = $issues; + $this->view->risks = $risks; + $this->view->reviews = $reviews; + $this->view->testtasks = $testtasks; $this->view->editedTodos = $editedTodos; $this->view->times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta); $this->view->time = date::now(); diff --git a/module/todo/view/batchedit.html.php b/module/todo/view/batchedit.html.php index 0053fe745e..3c1a61ba59 100644 --- a/module/todo/view/batchedit.html.php +++ b/module/todo/view/batchedit.html.php @@ -85,19 +85,19 @@ } elseif($todo->type == 'issue') { - echo html::select("issues[$todo->id]", $storys, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("issues[$todo->id]", $issues, $todo->idvalue, 'class="form-control chosen"'); } elseif($todo->type == 'risk') { - echo html::select("risks[$todo->id]", $storys, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("risks[$todo->id]", $risks, $todo->idvalue, 'class="form-control chosen"'); } elseif($todo->type == 'review') { - echo html::select("reviews[$todo->id]", $storys, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("reviews[$todo->id]", $reviews, $todo->idvalue, 'class="form-control chosen"'); } elseif($todo->type == 'testtask') { - echo html::select("testtasks[$todo->id]", $storys, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("testtasks[$todo->id]", $testtasks, $todo->idvalue, 'class="form-control chosen"'); } ?>