diff --git a/module/program/control.php b/module/program/control.php index 12f307744c..602770d402 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -63,7 +63,7 @@ class program extends control /* Get top programs and projects. */ $topObjects = $this->program->getList($status == 'unclosed' ? 'doing,suspended,wait' : $status, $orderBy, $pager, 'top'); if(!$topObjects) $topObjects = array(0); - $programs = $this->program->getList($status == 'closed' ? 'closed' : 'all', $orderBy, NULL, 'child', array_keys($topObjects)); + $programs = $this->program->getList($status, $orderBy, NULL, 'child', array_keys($topObjects)); /* Get summary. */ $topCount = $indCount = 0; diff --git a/module/program/model.php b/module/program/model.php index 7756cf24a9..759e6c8bd8 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -191,7 +191,8 @@ class programModel extends model ->where('type')->in('program,project') ->andWhere('deleted')->eq(0) ->andWhere('vision')->eq($this->config->vision) - ->beginIF($status != 'all')->andWhere('status')->in($status)->fi() + ->beginIF($status != 'all' and $status != 'unclosed')->andWhere('status')->in($status)->fi() + ->beginIF($status == 'unclosed')->andWhere('status')->ne('closed')->fi() ->beginIF($this->app->rawMethod == 'browse' and $type === 'top')->andWhere('parent')->eq(0)->fi() ->beginIF($this->app->rawMethod == 'browse' and ($type === 'child' or !$this->app->user->admin))->andWhere('id')->in($objectIdList)->fi() ->beginIF(!$this->app->user->admin and $this->app->rawMethod != 'browse')->andWhere('id')->in($userViewIdList)->fi()