diff --git a/module/program/control.php b/module/program/control.php index 9c5db15563..9a5da66301 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -75,7 +75,6 @@ class program extends control /* Build the search form. */ $actionURL = $this->createLink('program', 'browse', "status=bySearch&orderBy={$orderBy}&recTotal={$recTotal}&recPerPage={$recPerPage}&pageID={$pageID}¶m=myQueryID"); - $this->config->program->search['onMenuBar'] = 'yes'; $this->config->program->search['actionURL'] = $actionURL; $this->loadModel('search')->setSearchParams($this->config->program->search); diff --git a/module/program/model.php b/module/program/model.php index aea5bdab40..8978cae49f 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -196,22 +196,12 @@ class programModel extends model $programs = $this->dao->select('*')->from(TABLE_PROGRAM) ->where('deleted')->eq(0) ->andWhere('vision')->eq($this->config->vision) - ->andWhere('((type')->eq('program') + ->andWhere('type')->eq('program') ->beginIF(!$this->app->user->admin and $this->app->rawMethod != 'browse')->andWhere('id')->in($this->app->user->view->programs)->fi() - ->markRight(1) - ->orWhere('(type')->eq('project') - ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() - ->markRight(2) ->beginIF(!$this->cookie->showClosed)->andWhere('status')->ne('closed')->fi() ->beginIF($query)->andWhere($query)->fi() ->orderBy($orderBy) ->fetchAll('id'); - - /* Do not display project separately. */ - foreach($programs as $id => $program) - { - if($program->type == 'project' and !isset($programs[$program->parent])) unset($programs[$id]); - } return $programs; } @@ -759,6 +749,8 @@ class programModel extends model ->add('id', $programID) ->setDefault('team', $this->post->name) ->setDefault('end', '') + ->setDefault('lastEditedBy', $this->app->user->account) + ->setDefault('lastEditedDate', helper::now()) ->setIF($this->post->begin == '0000-00-00', 'begin', '') ->setIF($this->post->end == '0000-00-00', 'end', '') ->setIF($this->post->delta == 999, 'end', LONG_TIME)