diff --git a/module/program/model.php b/module/program/model.php index 13bf06b7cf..6748fbe90b 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -168,10 +168,8 @@ class programModel extends model ->andWhere('vision')->eq($this->config->vision) ->beginIF($status != 'all')->andWhere('status')->eq($status)->fi() ->beginIF(!$this->cookie->showClosed)->andWhere('status')->ne('closed')->fi() - ->beginIF($this->app->rawMethod == 'browse') - ->beginIF($type === 'top')->andWhere('parent')->eq(0)->fi() - ->beginIF($type === 'child' or !$this->app->user->admin)->andWhere('id')->in($objectIdList)->fi() - ->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() ->orderBy($orderBy) ->page($pager)