diff options
author | xavier.vidal <xavier.vidal@pc-0608-008.oficinas.atrapalo.com> | 2015-09-29 09:46:02 +0200 |
---|---|---|
committer | xavier.vidal <xavier.vidal@pc-0608-008.oficinas.atrapalo.com> | 2015-09-29 09:46:02 +0200 |
commit | 118f265c11701d6e050650bd7eb8dd84508323ab (patch) | |
tree | 7ea6b3bf8d14f46835773a16b910e202ce2fbaaf /app/Controller | |
parent | f6c1984bdd153d55731d18d57d95825c3298415c (diff) | |
parent | 91eeeee6c511246df56b4720f69d450b8787dd03 (diff) |
Merge branch 'master' into project_name_in_task_links
* master:
ajout captures pour les vues
essai intégration image
Append filters instead of replacing value for users and categories dropdowns
Do not show empty swimlanes in public view
Show complexity sum across all swimlanes
Show number of tasks for each column across all swimlanes
Fix regression (css)
Change swimlane layout to save space on the screen
Add the possibility to set/unset max column height (scrolling)
settings chapter
Add getPluginHomepage()
Add page to show the list of plugins
Do not use preventDefault() with .close-popover when there is no popover opened
Show "Open this task" in dropdown menu for closed tasks
Add contributor
Update app.css
Update popover.css
Show assignee on card only when someone is assigned
Diffstat (limited to 'app/Controller')
-rw-r--r-- | app/Controller/Board.php | 6 | ||||
-rw-r--r-- | app/Controller/Config.php | 13 | ||||
-rw-r--r-- | app/Controller/Taskstatus.php | 62 |
3 files changed, 45 insertions, 36 deletions
diff --git a/app/Controller/Board.php b/app/Controller/Board.php index a552b9cf..5851bd26 100644 --- a/app/Controller/Board.php +++ b/app/Controller/Board.php @@ -27,7 +27,7 @@ class Board extends Base } // Display the board with a specific layout - $this->response->html($this->template->layout('board/public_view', array( + $this->response->html($this->template->layout('board/view_public', array( 'project' => $project, 'swimlanes' => $this->board->getBoard($project['id']), 'title' => $project['name'], @@ -49,7 +49,7 @@ class Board extends Base { $params = $this->getProjectFilters('board', 'show'); - $this->response->html($this->template->layout('board/private_view', array( + $this->response->html($this->template->layout('board/view_private', array( 'categories_list' => $this->category->getList($params['project']['id'], false), 'users_list' => $this->projectPermission->getMemberList($params['project']['id'], false), 'swimlanes' => $this->taskFilter->search($params['filters']['search'])->getBoard($params['project']['id']), @@ -136,7 +136,7 @@ class Board extends Base } $values = $this->request->getJson(); - $this->userSession->setFilters($project_id, $values['search']); + $this->userSession->setFilters($project_id, empty($values['search']) ? '' : $values['search']); $this->response->html($this->renderBoard($project_id)); } diff --git a/app/Controller/Config.php b/app/Controller/Config.php index 790bdcd3..1ae390c8 100644 --- a/app/Controller/Config.php +++ b/app/Controller/Config.php @@ -78,6 +78,19 @@ class Config extends Base } /** + * Display the plugin page + * + * @access public + */ + public function plugins() + { + $this->response->html($this->layout('config/plugins', array( + 'plugins' => $this->pluginLoader->plugins, + 'title' => t('Settings').' > '.t('Plugins'), + ))); + } + + /** * Display the application settings page * * @access public diff --git a/app/Controller/Taskstatus.php b/app/Controller/Taskstatus.php index a47d9da3..9260b658 100644 --- a/app/Controller/Taskstatus.php +++ b/app/Controller/Taskstatus.php @@ -18,62 +18,58 @@ class Taskstatus extends Base public function close() { $task = $this->getTask(); + $this->changeStatus($task, 'close', t('Task closed successfully.'), t('Unable to close this task.')); + $this->renderTemplate($task, 'task_status/close'); + } + + /** + * Open a task + * + * @access public + */ + public function open() + { + $task = $this->getTask(); $redirect = $this->request->getStringParam('redirect'); + $this->changeStatus($task, 'open', t('Task opened successfully.'), t('Unable to open this task.')); + $this->renderTemplate($task, 'task_status/open'); + } + + private function changeStatus(array $task, $method, $success_message, $failure_message) + { if ($this->request->getStringParam('confirmation') === 'yes') { $this->checkCSRFParam(); - if ($this->taskStatus->close($task['id'])) { - $this->session->flash(t('Task closed successfully.')); + if ($this->taskStatus->$method($task['id'])) { + $this->session->flash($success_message); } else { - $this->session->flashError(t('Unable to close this task.')); + $this->session->flashError($failure_message); } - if ($redirect === 'board') { + if ($this->request->getStringParam('redirect') === 'board') { $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id']))); } $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); } + } + + private function renderTemplate(array $task, $template) + { + $redirect = $this->request->getStringParam('redirect'); if ($this->request->isAjax()) { - $this->response->html($this->template->render('task_status/close', array( + $this->response->html($this->template->render($template, array( 'task' => $task, 'redirect' => $redirect, ))); } - $this->response->html($this->taskLayout('task_status/close', array( + $this->response->html($this->taskLayout($template, array( 'task' => $task, 'redirect' => $redirect, ))); } - - /** - * Open a task - * - * @access public - */ - public function open() - { - $task = $this->getTask(); - - if ($this->request->getStringParam('confirmation') === 'yes') { - - $this->checkCSRFParam(); - - if ($this->taskStatus->open($task['id'])) { - $this->session->flash(t('Task opened successfully.')); - } else { - $this->session->flashError(t('Unable to open this task.')); - } - - $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id']))); - } - - $this->response->html($this->taskLayout('task_status/open', array( - 'task' => $task, - ))); - } } |