Unification of project header

This commit is contained in:
Frederic Guillot
2016-03-25 17:41:41 -04:00
parent 13d5bd8e48
commit 354e37971d
37 changed files with 194 additions and 343 deletions

View File

@@ -287,60 +287,4 @@ abstract class Base extends \Kanboard\Core\Base
return $subtask;
}
/**
* Common method to get project filters
*
* @access protected
* @param string $controller
* @param string $action
* @return array
*/
protected function getProjectFilters($controller, $action)
{
$project = $this->getProject();
$search = $this->request->getStringParam('search', $this->userSession->getFilters($project['id']));
$board_selector = $this->projectUserRole->getActiveProjectsByUser($this->userSession->getId());
unset($board_selector[$project['id']]);
$filters = array(
'controller' => $controller,
'action' => $action,
'project_id' => $project['id'],
'search' => urldecode($search),
);
$this->userSession->setFilters($project['id'], $filters['search']);
return array(
'project' => $project,
'board_selector' => $board_selector,
'filters' => $filters,
'title' => $project['name'],
'description' => $this->getProjectDescription($project),
);
}
/**
* Get project description
*
* @access protected
* @param array &$project
* @return string
*/
protected function getProjectDescription(array &$project)
{
if ($project['owner_id'] > 0) {
$description = t('Project owner: ').'**'.$this->helper->text->e($project['owner_name'] ?: $project['owner_username']).'**'.PHP_EOL.PHP_EOL;
if (! empty($project['description'])) {
$description .= '***'.PHP_EOL.PHP_EOL;
$description .= $project['description'];
}
} else {
$description = $project['description'];
}
return $description;
}
}