diff --git a/module/bug/model.php b/module/bug/model.php index 3ad8b68178..1c04b2e271 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1380,13 +1380,14 @@ class bugModel extends model public function getUserBugs($account, $type = 'assignedTo', $orderBy = 'id_desc', $limit = 0, $pager = null, $projectID = 0) { if(!$this->loadModel('common')->checkField(TABLE_BUG, $type)) return array(); - $bugs = $this->dao->select('*')->from(TABLE_BUG) - ->where('deleted')->eq(0) - ->beginIF($projectID)->andWhere('PRJ')->eq($projectID)->fi() - ->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('status')->ne('closed')->fi() - ->beginIF($type != 'all')->andWhere("`$type`")->eq($account)->fi() - ->beginIF($this->app->rawMethod == 'contribute')->andWhere("status")->in('resolved,closed')->fi() - ->beginIF($this->app->rawMethod == 'work')->andWhere("status")->eq('active')->fi() + $bugs = $this->dao->select('t1.*,t2.name as productName')->from(TABLE_BUG)->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') + ->where('t1.deleted')->eq(0) + ->beginIF($projectID)->andWhere('t1.PRJ')->eq($projectID)->fi() + ->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi() + ->beginIF($type != 'all')->andWhere("t1.`$type`")->eq($account)->fi() + ->beginIF($this->app->rawMethod == 'contribute')->andWhere("t1.status")->in('resolved,closed')->fi() + ->beginIF($this->app->rawMethod == 'work')->andWhere("t1.status")->eq('active')->fi() ->orderBy($orderBy) ->beginIF($limit > 0)->limit($limit)->fi() ->page($pager) diff --git a/module/my/view/bug.html.php b/module/my/view/bug.html.php index 500941b405..d9008934e0 100644 --- a/module/my/view/bug.html.php +++ b/module/my/view/bug.html.php @@ -16,7 +16,7 @@