Refactoring to implement new layout with filters: board/calendar/list views (work in progress)

This commit is contained in:
Frederic Guillot
2015-07-04 11:14:21 -04:00
parent a327f790ee
commit 554500aa49
52 changed files with 463 additions and 758 deletions

View File

@@ -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'],
);
}
}