* Fix bug#18983.

This commit is contained in:
xieqiyu
2022-01-26 10:27:50 +08:00
parent 8f843697f2
commit 0b9e65b245
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -1147,7 +1147,7 @@ class kanban extends control
}
else
{
$projects += $this->loadModel('project')->getPairsByProgram();
$projects += $this->loadModel('project')->getPairsByProgram('', 'all', false, 'order_asc', 'kanban');
$builds2Imported = $this->build->getProjectBuilds($selectedProjectID, 'all', 0, 't1.date_desc,t1.id_desc', $pager);
}
+3 -1
View File
@@ -480,10 +480,11 @@ class projectModel extends model
* @param status $status all|wait|doing|suspended|closed|noclosed
* @param bool $isQueryAll
* @param string $orderBy
* @param string $excludedModel
* @access public
* @return object
*/
public function getPairsByProgram($programID = '', $status = 'all', $isQueryAll = false, $orderBy = 'order_asc')
public function getPairsByProgram($programID = '', $status = 'all', $isQueryAll = false, $orderBy = 'order_asc', $excludedModel = '')
{
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProjectPairs();
return $this->dao->select('id, name')->from(TABLE_PROJECT)
@@ -491,6 +492,7 @@ class projectModel extends model
->andWhere('deleted')->eq(0)
->beginIF($programID !== '')->andWhere('parent')->eq($programID)->fi()
->beginIF($status != 'all' && $status != 'noclosed')->andWhere('status')->eq($status)->fi()
->beginIF($excludedModel)->andWhere('model')->ne($excludedModel)->fi()
->beginIF($status == 'noclosed')->andWhere('status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin and !$isQueryAll)->andWhere('id')->in($this->app->user->view->projects)->fi()
->orderBy($orderBy)