Unification of project header
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user