Refactoring to implement new layout with filters: board/calendar/list views (work in progress)
This commit is contained in:
@@ -327,4 +327,33 @@ abstract class Base extends \Core\Base
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Common method to get project filters
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
protected function getProjectFilters($controller, $action)
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$search = $this->request->getStringParam('search', $this->userSession->getFilters($project['id']));
|
||||
$board_selector = $this->projectPermission->getAllowedProjects($this->userSession->getId());
|
||||
unset($board_selector[$project['id']]);
|
||||
|
||||
$filters = array(
|
||||
'controller' => $controller,
|
||||
'action' => $action,
|
||||
'project_id' => $project['id'],
|
||||
'search' => $search,
|
||||
);
|
||||
|
||||
$this->userSession->setFilters($project['id'], $search);
|
||||
|
||||
return array(
|
||||
'project' => $project,
|
||||
'board_selector' => $board_selector,
|
||||
'filters' => $filters,
|
||||
'title' => $project['name'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user