diff --git a/module/project/control.php b/module/project/control.php index e99b77f51e..70e32f3d43 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -298,19 +298,18 @@ class project extends control $this->session->set('projectList', $this->app->getURI(true), 'project'); $projectType = $this->cookie->projectType ? $this->cookie->projectType : 'bylist'; + $browseType = strtolower($browseType); /* Load pager. */ $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); $queryID = ($browseType == 'bysearch') ? (int)$param : 0; - $programTitle = $this->loadModel('setting')->getItem('owner=' . $this->app->user->account . '&module=project&key=programTitle'); - $projectStats = $this->loadModel('program')->getProjectStats($programID, $browseType, $queryID, $orderBy, $pager, $programTitle); - $actionURL = $this->createLink('project', 'browse', "&programID=$programID&browseType=bySearch&queryID=myQueryID"); $this->project->buildSearchFrom($queryID, $actionURL); - $projectQuery = $this->session->projectQuery; - if($browseType == 'bySearch') $projectStats = $this->project->getBySearch($projectQuery); + + $programTitle = $this->loadModel('setting')->getItem('owner=' . $this->app->user->account . '&module=project&key=programTitle'); + $projectStats = $this->loadModel('program')->getProjectStats($programID, $browseType, $queryID, $orderBy, $pager, $programTitle); $this->view->title = $this->lang->project->browse; $this->view->position[] = $this->lang->project->browse; diff --git a/module/project/model.php b/module/project/model.php index 6fb550b086..3f49490c59 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -629,23 +629,6 @@ class projectModel extends model ->fetchGroup('productID', 'branchID'); } - /* - * Get projects by search conditions. - * - * @param string $projectQuery - * @return array - * */ - public function getBySearch($projectQuery) - { - $projects = $this->dao->select('*')->from(TABLE_PROJECT) - ->where($projectQuery) - ->andWhere('type')->eq('project') - ->fetchAll('id'); - if(empty($projects)) $projects = 'noProject'; - $projects = $this->loadModel('program')->getProjectStats(0, 'undone', 0, 'id_desc', null, 0, 0, false, $projects); - return $projects; - } - /* * Build search form * diff --git a/module/project/view/browsebylist.html.php b/module/project/view/browsebylist.html.php index 43c4ac1c82..5c1b0926a7 100644 --- a/module/project/view/browsebylist.html.php +++ b/module/project/view/browsebylist.html.php @@ -68,13 +68,13 @@
-
+

project->empty;?> - ' . $lang->project->create, '', 'class="btn btn-info" data-toggle="modal"');?> + ' . $lang->project->create, '', 'class="btn btn-info" data-toggle="modal"');?> ' . $lang->execution->create, '', 'class="btn btn-info"');?>