summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/Base.php25
-rw-r--r--app/Controller/Board.php1
-rw-r--r--app/Controller/Project.php3
-rw-r--r--app/Controller/Projectuser.php13
4 files changed, 39 insertions, 3 deletions
diff --git a/app/Controller/Base.php b/app/Controller/Base.php
index 66a9e84f..efeab31e 100644
--- a/app/Controller/Base.php
+++ b/app/Controller/Base.php
@@ -248,7 +248,7 @@ abstract class Base extends \Kanboard\Core\Base
protected function getProject($project_id = 0)
{
$project_id = $this->request->getIntegerParam('project_id', $project_id);
- $project = $this->project->getById($project_id);
+ $project = $this->project->getByIdWithOwner($project_id);
if (empty($project)) {
$this->flash->failure(t('Project not found.'));
@@ -308,6 +308,29 @@ abstract class Base extends \Kanboard\Core\Base
'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->template->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;
+ }
}
diff --git a/app/Controller/Board.php b/app/Controller/Board.php
index 06736cce..f64de69a 100644
--- a/app/Controller/Board.php
+++ b/app/Controller/Board.php
@@ -54,7 +54,6 @@ class Board extends Base
'users_list' => $this->projectUserRole->getAssignableUsersList($params['project']['id'], false),
'custom_filters_list' => $this->customFilter->getAll($params['project']['id'], $this->userSession->getId()),
'swimlanes' => $this->taskFilter->search($params['filters']['search'])->getBoard($params['project']['id']),
- 'description' => $params['project']['description'],
'board_private_refresh_interval' => $this->config->get('board_private_refresh_interval'),
'board_highlight_period' => $this->config->get('board_highlight_period'),
) + $params));
diff --git a/app/Controller/Project.php b/app/Controller/Project.php
index 27c827d1..836bfb45 100644
--- a/app/Controller/Project.php
+++ b/app/Controller/Project.php
@@ -29,7 +29,7 @@ class Project extends Base
->setUrl('project', 'index')
->setMax(20)
->setOrder('name')
- ->setQuery($this->project->getQueryProjectDetails($project_ids))
+ ->setQuery($this->project->getQueryColumnStats($project_ids))
->calculate();
$this->response->html($this->template->layout('project/index', array(
@@ -145,6 +145,7 @@ class Project extends Base
'values' => empty($values) ? $project : $values,
'errors' => $errors,
'project' => $project,
+ 'owners' => $this->projectUserRole->getAssignableUsersList($project['id'], true),
'title' => t('Edit project')
)));
}
diff --git a/app/Controller/Projectuser.php b/app/Controller/Projectuser.php
index 806ede77..78b93ab6 100644
--- a/app/Controller/Projectuser.php
+++ b/app/Controller/Projectuser.php
@@ -131,4 +131,17 @@ class Projectuser extends Base
{
$this->tasks(TaskModel::STATUS_CLOSED, 'closed', t('Closed tasks'), 'Closed tasks assigned to "%s"');
}
+
+ /**
+ * Users tooltip
+ */
+ public function users()
+ {
+ $project = $this->getProject();
+
+ return $this->response->html($this->template->render('project_user/tooltip_users', array(
+ 'users' => $this->projectUserRole->getAllUsersGroupedByRole($project['id']),
+ 'roles' => $this->role->getProjectRoles(),
+ )));
+ }
}