* Modify the code logic.
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user