* task 2011

This commit is contained in:
chujilu
2014-08-14 14:22:39 +08:00
parent 0a4698989d
commit 16d3078300
5 changed files with 31 additions and 2 deletions
+2
View File
@@ -730,6 +730,7 @@ class bug extends control
$bug = $this->bug->getById($bugID);
$productID = $bug->product;
$bugs = $this->bug->getProductBugPairs($productID);
$this->bug->setMenu($this->products, $productID);
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->resolve;
@@ -737,6 +738,7 @@ class bug extends control
$this->view->position[] = $this->lang->bug->resolve;
$this->view->bug = $bug;
$this->view->bugs = $bugs;
$this->view->users = $this->user->getPairs('nodeleted', $bug->openedBy);
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID);
$this->view->actions = $this->action->getList('bug', $bugID);
+22
View File
@@ -709,6 +709,28 @@ class bugModel extends model
return $bugs;
}
/**
* get Product Bug Pairs
*
* @param int $productID
* @access public
* @return void
*/
public function getProductBugPairs($productID)
{
$bugs = array('' => '');
$data = $this->dao->select('id, title')->from(TABLE_BUG)
->where('product')->eq((int)$productID)
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->fetchAll();
foreach($data as $bug)
{
$bugs[$bug->id] = $bug->id . ':' . $bug->title;
}
return $bugs;
}
/**
* Get bugs according to buildID and productID.
*
+1 -1
View File
@@ -29,7 +29,7 @@
</tr>
<tr id='duplicateBugBox' class='hide'>
<th><?php echo $lang->bug->duplicateBug;?></th>
<td><?php echo html::input('duplicateBug', '', "class='form-control'");?></td>
<td><?php echo html::select('duplicateBug', $bugs, '', "class='form-control chosen' ");?></td>
</tr>
<tr>
<th><?php echo $lang->bug->resolvedBuild;?></th>
+2
View File
@@ -621,6 +621,7 @@ class story extends control
/* Get story and product. */
$story = $this->story->getById($storyID);
$product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fields('name, id')->fetch();
$stories = $this->story->getProductStoryPairs($product->id);
/* Set menu. */
$this->product->setMenu($this->product->getPairs(), $product->id);
@@ -635,6 +636,7 @@ class story extends control
$this->view->product = $product;
$this->view->story = $story;
$this->view->stories = $stories;
$this->view->actions = $this->action->getList('story', $storyID);
$this->view->users = $this->loadModel('user')->getPairs();
$this->display();
+4 -1
View File
@@ -27,7 +27,10 @@
</tr>
<tr id='duplicateStoryBox' style='display:none'>
<th><?php echo $lang->story->duplicateStory;?></th>
<td><?php echo html::input('duplicateStory', '', 'class=form-control');?></td><td></td>
<td>
<?php echo html::select('duplicateStory', $stories, '', "class='form-control chosen' ");?>
</td>
<td></td>
</tr>
<tr id='childStoriesBox' style='display:none'>
<th><?php echo $lang->story->childStories;?></th>