* Modify the code logic.

This commit is contained in:
tianshujie
2022-01-11 10:03:22 +08:00
parent 353d85ed86
commit fc081f1d21
2 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ class kanban extends control
$this->view->title = $this->lang->kanbanspace->common;
$this->view->spaceList = $this->kanban->getSpaceList($browseType, $pager);
$this->view->allSpace = $this->kanban->getSpaceList('noclosed');
$this->view->allSpace = $this->kanban->getCanViewObjects('kanbanspace', 'noclosed');
$this->view->browseType = $browseType;
$this->view->pager = $pager;
$this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted');
+7 -3
View File
@@ -970,10 +970,14 @@ class kanbanModel extends model
* @access public
* @return array
*/
public function getCanViewObjects($objectType = 'kanban')
public function getCanViewObjects($objectType = 'kanban', $param = '')
{
$table = $this->config->objectTables[$objectType];
$objects = $this->dao->select('*')->from($table)->fetchAll('id');
$table = $this->config->objectTables[$objectType];
$objects = $this->dao->select('*')->from($table)
->where('deleted')->eq(0)
->beginIF(strpos($param, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
->fetchAll('id');
$spaceList = $objectType == 'kanban' ? $this->dao->select('id,owner,team,whitelist')->from(TABLE_KANBANSPACE)->fetchAll('id') : array();
if($this->app->user->admin) return array_keys($objects);