diff --git a/module/bug/model.php b/module/bug/model.php index c16d4a39a7..73461ea179 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -680,7 +680,7 @@ class bugModel extends model { $bugs = $this->dao->select('*')->from(TABLE_BUG) ->where('deleted')->eq(0) - ->andWhere("$type")->eq($account) + ->beginIF($type != 'all')->andWhere("$type")->eq($account)->fi() ->orderBy($orderBy) ->beginIF($limit > 0)->limit($limit)->fi() ->page($pager) diff --git a/module/story/model.php b/module/story/model.php index 1a3116f463..de81c6f6fc 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1217,10 +1217,12 @@ class storyModel extends model ->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id') ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') ->where('t1.deleted')->eq(0) + ->beginIF($type != 'all') ->beginIF($type == 'assignedTo')->andWhere('assignedTo')->eq($account)->fi() ->beginIF($type == 'openedBy')->andWhere('openedBy')->eq($account)->fi() ->beginIF($type == 'reviewedBy')->andWhere('reviewedBy')->like('%' . $account . '%')->fi() ->beginIF($type == 'closedBy')->andWhere('closedBy')->eq($account)->fi() + ->fi() ->orderBy($orderBy) ->page($pager) ->fetchAll(); diff --git a/module/task/model.php b/module/task/model.php index 2878c3afa6..71ee1d6fbb 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -853,7 +853,7 @@ class taskModel extends model ->leftjoin(TABLE_STORY)->alias('t3') ->on('t1.story = t3.id') ->where('t1.deleted')->eq(0) - ->andWhere("t1.$type")->eq($account) + ->beginIF($type != 'all')->andWhere("t1.$type")->eq($account)->fi() ->orderBy($orderBy) ->beginIF($limit > 0)->limit($limit)->fi() ->page($pager)