* Fix bug#23116.

This commit is contained in:
xieqiyu
2022-06-06 16:52:30 +08:00
parent 415c8be249
commit 36e609f808
2 changed files with 5 additions and 2 deletions

View File

@@ -896,7 +896,8 @@ class block extends control
$count = isset($this->params->count) ? (int)$this->params->count : 15;
/* Get projects. */
$projects = $this->loadModel('project')->getOverviewList('byStatus', $status, 'id_desc', $count);
$excludedModel = $this->config->edition == 'max' ? '' : 'waterfall';
$projects = $this->loadModel('project')->getOverviewList('byStatus', $status, 'id_desc', $count, $excludedModel);
if(empty($projects))
{
$this->view->projects = $projects;

View File

@@ -273,16 +273,18 @@ class projectModel extends model
* @param string|int $param
* @param string $orderBy
* @param int $limit
* @param string $excludedModel
* @access public
* @return array
*/
public function getOverviewList($queryType = 'byStatus', $param = 'all', $orderBy = 'id_desc', $limit = 15)
public function getOverviewList($queryType = 'byStatus', $param = 'all', $orderBy = 'id_desc', $limit = 15, $excludedModel = '')
{
$queryType = strtolower($queryType);
$projects = $this->dao->select('*')->from(TABLE_PROJECT)
->where('type')->eq('project')
->andWhere('vision')->eq($this->config->vision)
->andWhere('deleted')->eq(0)
->beginIF($excludedModel)->andWhere('model')->ne($excludedModel)->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->beginIF($queryType == 'bystatus' and $param == 'undone')->andWhere('status')->notIN('done,closed')->fi()
->beginIF($queryType == 'bystatus' and $param != 'all' and $param != 'undone')->andWhere('status')->eq($param)->fi()