From 05081f19baa80dc8e2ee7b70fcc9061c22392b5a Mon Sep 17 00:00:00 2001 From: chujilu Date: Wed, 13 Aug 2014 21:49:39 +0800 Subject: [PATCH] * add postponed bug when task import bug --- module/bug/model.php | 23 +++++++++++++++++++++++ module/project/control.php | 2 +- module/story/view/view.html.php | 4 ++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 4ff8d00aac..187ce13b82 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -238,6 +238,29 @@ class bugModel extends model ->fetchAll(); } + /** + * get Active And Postponed Bugs + * + * @param int $products + * @param int $projectID + * @param int $pager + * @access public + * @return void + */ + public function getActiveAndPostponedBugs($products, $projectID, $pager = null) + { + return $this->dao->select('*')->from(TABLE_BUG) + ->where("((status = 'resolved' AND resolution = 'postponed') OR (status = 'active'))") + ->andWhere('toTask')->eq(0) + ->andWhere('toStory')->eq(0) + ->beginIF(!empty($products))->andWhere('product')->in($products)->fi() + ->beginIF(empty($products))->andWhere('project')->eq($projectID)->fi() + ->andWhere('deleted')->eq(0) + ->orderBy('id desc') + ->page($pager) + ->fetchAll(); + } + /** * Update a bug. * diff --git a/module/project/control.php b/module/project/control.php index 406ccc92e7..b11c3c9b5f 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -417,7 +417,7 @@ class project extends control $bugs = array(); if($browseType != "bysearch") { - $bugs = $this->bug->getActiveBugs(array_keys($products), $projectID, $pager); + $bugs = $this->bug->getActiveAndPostponedBugs(array_keys($products), $projectID, $pager); } else { diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 64d43f600c..3777518e18 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -175,11 +175,11 @@ echo html::a($this->createLink('project', 'browse', "projectID=$task->project"), $projectName, '', "class='text-muted'") . ''; } } - if(count($story->tasks, COUNT_NORMAL) == 0) + if(count($story->tasks) == 0) { foreach($story->projects as $project) { - echo "
  • " .html::a($this->createLink('project', 'story', "projectID=$project->project"), $project->name, '', "class='text-muted'") . '
  • '; + echo "
  • " . $project->name . '
  • '; } } ?>