From 554500aa493faa66b43b2ddce72338880a874724 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 4 Jul 2015 11:14:21 -0400 Subject: Refactoring to implement new layout with filters: board/calendar/list views (work in progress) --- app/Controller/Activity.php | 29 +++++ app/Controller/Base.php | 29 +++++ app/Controller/Board.php | 47 +++----- app/Controller/Calendar.php | 23 +--- app/Controller/Listing.php | 37 ++++++ app/Controller/Projectinfo.php | 95 --------------- app/Model/Acl.php | 3 +- app/Model/Board.php | 11 +- app/Model/TaskFilter.php | 17 +++ app/Model/TaskFinder.php | 18 +-- app/Model/TaskPosition.php | 5 + app/Model/UserSession.php | 24 ++++ app/Template/activity/project.php | 40 ++++++ app/Template/analytic/layout.php | 12 +- app/Template/app/calendar.php | 5 +- app/Template/app/overview.php | 2 +- app/Template/board/assignee.php | 21 ---- app/Template/board/category.php | 22 ---- app/Template/board/comments.php | 16 --- app/Template/board/description.php | 5 - app/Template/board/files.php | 31 ----- app/Template/board/filters.php | 43 ------- app/Template/board/index.php | 16 --- app/Template/board/popover_assignee.php | 21 ++++ app/Template/board/popover_category.php | 22 ++++ app/Template/board/private_view.php | 16 +++ app/Template/board/public.php | 11 -- app/Template/board/public_view.php | 11 ++ app/Template/board/show.php | 30 ----- app/Template/board/subtasks.php | 7 -- app/Template/board/swimlane.php | 83 ------------- app/Template/board/table_container.php | 30 +++++ app/Template/board/table_swimlane.php | 83 +++++++++++++ app/Template/board/tasklinks.php | 18 --- app/Template/board/tooltip_comments.php | 16 +++ app/Template/board/tooltip_description.php | 5 + app/Template/board/tooltip_files.php | 31 +++++ app/Template/board/tooltip_subtasks.php | 7 ++ app/Template/board/tooltip_tasklinks.php | 18 +++ app/Template/calendar/show.php | 53 ++------ app/Template/calendar/sidebar.php | 40 ------ app/Template/listing/show.php | 67 ++++++++++ app/Template/project/dropdown.php | 14 +-- app/Template/project/filters.php | 49 ++++++++ app/Template/project/index.php | 2 +- app/Template/project/layout.php | 6 +- app/Template/projectinfo/activity.php | 30 ----- app/Template/projectinfo/search.php | 43 ------- app/Template/projectinfo/tasks.php | 33 ----- app/Template/task/layout.php | 10 +- app/Template/task/new.php | 2 +- app/Template/task/table.php | 56 --------- assets/css/app.css | 41 ++++--- assets/css/print.css | 11 +- assets/css/src/base.css | 19 ++- assets/css/src/board.css | 9 -- assets/css/src/dropdown.css | 6 + assets/css/src/header.css | 6 +- assets/js/app.js | 42 +++---- assets/js/src/analytic.js | 5 +- assets/js/src/base.js | 1 - assets/js/src/board.js | 92 +------------- assets/js/src/calendar.js | 188 +++++++---------------------- assets/js/src/swimlane.js | 2 +- 64 files changed, 746 insertions(+), 1041 deletions(-) create mode 100644 app/Controller/Activity.php create mode 100644 app/Controller/Listing.php delete mode 100644 app/Controller/Projectinfo.php create mode 100644 app/Template/activity/project.php delete mode 100644 app/Template/board/assignee.php delete mode 100644 app/Template/board/category.php delete mode 100644 app/Template/board/comments.php delete mode 100644 app/Template/board/description.php delete mode 100644 app/Template/board/files.php delete mode 100644 app/Template/board/filters.php delete mode 100644 app/Template/board/index.php create mode 100644 app/Template/board/popover_assignee.php create mode 100644 app/Template/board/popover_category.php create mode 100644 app/Template/board/private_view.php delete mode 100644 app/Template/board/public.php create mode 100644 app/Template/board/public_view.php delete mode 100644 app/Template/board/show.php delete mode 100644 app/Template/board/subtasks.php delete mode 100644 app/Template/board/swimlane.php create mode 100644 app/Template/board/table_container.php create mode 100644 app/Template/board/table_swimlane.php delete mode 100644 app/Template/board/tasklinks.php create mode 100644 app/Template/board/tooltip_comments.php create mode 100644 app/Template/board/tooltip_description.php create mode 100644 app/Template/board/tooltip_files.php create mode 100644 app/Template/board/tooltip_subtasks.php create mode 100644 app/Template/board/tooltip_tasklinks.php delete mode 100644 app/Template/calendar/sidebar.php create mode 100644 app/Template/listing/show.php create mode 100644 app/Template/project/filters.php delete mode 100644 app/Template/projectinfo/activity.php delete mode 100644 app/Template/projectinfo/search.php delete mode 100644 app/Template/projectinfo/tasks.php delete mode 100644 app/Template/task/table.php diff --git a/app/Controller/Activity.php b/app/Controller/Activity.php new file mode 100644 index 00000000..2276b3b8 --- /dev/null +++ b/app/Controller/Activity.php @@ -0,0 +1,29 @@ +getProject(); + + $this->response->html($this->template->layout('activity/project', array( + 'board_selector' => $this->projectPermission->getAllowedProjects($this->userSession->getId()), + 'events' => $this->projectActivity->getProject($project['id']), + 'project' => $project, + 'title' => t('%s\'s activity', $project['name']) + ))); + } +} diff --git a/app/Controller/Base.php b/app/Controller/Base.php index b7ee431f..9f5d6dc6 100644 --- a/app/Controller/Base.php +++ b/app/Controller/Base.php @@ -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'], + ); + } } diff --git a/app/Controller/Board.php b/app/Controller/Board.php index 0f38f910..caaa38ef 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', array( + $this->response->html($this->template->layout('board/public_view', array( 'project' => $project, 'swimlanes' => $this->board->getBoard($project['id']), 'title' => $project['name'], @@ -44,28 +44,17 @@ class Board extends Base * Show a board for a given project * * @access public - * @param integer $project_id Default project id */ - public function show($project_id = 0) + public function show() { - $project = $this->getProject($project_id); - $projects = $this->projectPermission->getAllowedProjects($this->userSession->getId()); + $params = $this->getProjectFilters('board', 'show'); - $board_selector = $projects; - unset($board_selector[$project['id']]); - - $this->response->html($this->template->layout('board/index', array( - 'users' => $this->projectPermission->getMemberList($project['id'], true, true), - 'projects' => $projects, - 'project' => $project, - 'swimlanes' => $this->board->getBoard($project['id']), - 'categories_listing' => $this->category->getList($project['id'], true, true), - 'title' => $project['name'], - 'description' => $project['description'], - 'board_selector' => $board_selector, + $this->response->html($this->template->layout('board/private_view', array( + '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)); } /** @@ -100,9 +89,9 @@ class Board extends Base } $this->response->html( - $this->template->render('board/show', array( + $this->template->render('board/table_container', array( 'project' => $this->project->getById($project_id), - 'swimlanes' => $this->board->getBoard($project_id), + 'swimlanes' => $this->taskFilter->search($this->userSession->getFilters($project_id))->getBoard($project_id), 'board_private_refresh_interval' => $this->config->get('board_private_refresh_interval'), 'board_highlight_period' => $this->config->get('board_highlight_period'), )), @@ -133,9 +122,9 @@ class Board extends Base } $this->response->html( - $this->template->render('board/show', array( + $this->template->render('board/table_container', array( 'project' => $this->project->getById($project_id), - 'swimlanes' => $this->board->getBoard($project_id), + 'swimlanes' => $this->taskFilter->search($this->userSession->getFilters($project_id))->getBoard($project_id), 'board_private_refresh_interval' => $this->config->get('board_private_refresh_interval'), 'board_highlight_period' => $this->config->get('board_highlight_period'), )) @@ -150,7 +139,7 @@ class Board extends Base public function tasklinks() { $task = $this->getTask(); - $this->response->html($this->template->render('board/tasklinks', array( + $this->response->html($this->template->render('board/tooltip_tasklinks', array( 'links' => $this->taskLink->getAll($task['id']), 'task' => $task, ))); @@ -164,7 +153,7 @@ class Board extends Base public function subtasks() { $task = $this->getTask(); - $this->response->html($this->template->render('board/subtasks', array( + $this->response->html($this->template->render('board/tooltip_subtasks', array( 'subtasks' => $this->subtask->getAll($task['id']), 'task' => $task, ))); @@ -179,7 +168,7 @@ class Board extends Base { $task = $this->getTask(); - $this->response->html($this->template->render('board/files', array( + $this->response->html($this->template->render('board/tooltip_files', array( 'files' => $this->file->getAllDocuments($task['id']), 'images' => $this->file->getAllImages($task['id']), 'task' => $task, @@ -195,7 +184,7 @@ class Board extends Base { $task = $this->getTask(); - $this->response->html($this->template->render('board/comments', array( + $this->response->html($this->template->render('board/tooltip_comments', array( 'comments' => $this->comment->getAll($task['id']) ))); } @@ -209,7 +198,7 @@ class Board extends Base { $task = $this->getTask(); - $this->response->html($this->template->render('board/description', array( + $this->response->html($this->template->render('board/tooltip_description', array( 'task' => $task ))); } @@ -224,7 +213,7 @@ class Board extends Base $task = $this->getTask(); $project = $this->project->getById($task['project_id']); - $this->response->html($this->template->render('board/assignee', array( + $this->response->html($this->template->render('board/popover_assignee', array( 'values' => $task, 'users_list' => $this->projectPermission->getMemberList($project['id']), 'project' => $project, @@ -262,7 +251,7 @@ class Board extends Base $task = $this->getTask(); $project = $this->project->getById($task['project_id']); - $this->response->html($this->template->render('board/category', array( + $this->response->html($this->template->render('board/popover_category', array( 'values' => $task, 'categories_list' => $this->category->getList($project['id']), 'project' => $project, diff --git a/app/Controller/Calendar.php b/app/Controller/Calendar.php index 41642a59..8a24d705 100644 --- a/app/Controller/Calendar.php +++ b/app/Controller/Calendar.php @@ -20,20 +20,9 @@ class Calendar extends Base */ public function show() { - $project = $this->getProject(); - $this->response->html($this->template->layout('calendar/show', array( 'check_interval' => $this->config->get('board_private_refresh_interval'), - 'users_list' => $this->projectPermission->getMemberList($project['id'], true, true), - 'categories_list' => $this->category->getList($project['id'], true, true), - 'columns_list' => $this->board->getColumnsList($project['id'], true), - 'swimlanes_list' => $this->swimlane->getList($project['id'], true), - 'colors_list' => $this->color->getList(true), - 'status_list' => $this->taskStatus->getList(true), - 'project' => $project, - 'title' => t('Calendar for "%s"', $project['name']), - 'board_selector' => $this->projectPermission->getAllowedProjects($this->userSession->getId()), - ))); + ) + $this->getProjectFilters('calendar', 'show'))); } /** @@ -49,14 +38,8 @@ class Calendar extends Base // Common filter $filter = $this->taskFilter - ->create() - ->filterByProject($project_id) - ->filterByCategory($this->request->getIntegerParam('category_id', -1)) - ->filterByOwner($this->request->getIntegerParam('owner_id', -1)) - ->filterByColumn($this->request->getIntegerParam('column_id', -1)) - ->filterBySwimlane($this->request->getIntegerParam('swimlane_id', -1)) - ->filterByColor($this->request->getStringParam('color_id')) - ->filterByStatus($this->request->getIntegerParam('is_active', -1)); + ->search($this->userSession->getFilters($project_id)) + ->filterByProject($project_id); // Tasks if ($this->config->get('calendar_project_tasks', 'date_started') === 'date_creation') { diff --git a/app/Controller/Listing.php b/app/Controller/Listing.php new file mode 100644 index 00000000..2c197e3e --- /dev/null +++ b/app/Controller/Listing.php @@ -0,0 +1,37 @@ +getProjectFilters('listing', 'show'); + $query = $this->taskFilter->search($params['filters']['search'])->filterByProject($params['project']['id'])->getQuery(); + + $paginator = $this->paginator + ->setUrl('listing', 'show', array('project_id' => $params['project']['id'])) + ->setMax(30) + ->setOrder(TaskModel::TABLE.'.id') + ->setDirection('DESC') + ->setQuery($query) + ->calculate(); + + $this->response->html($this->template->layout('listing/show', $params + array( + 'paginator' => $paginator, + ))); + } +} diff --git a/app/Controller/Projectinfo.php b/app/Controller/Projectinfo.php deleted file mode 100644 index 22b9861c..00000000 --- a/app/Controller/Projectinfo.php +++ /dev/null @@ -1,95 +0,0 @@ -getProject(); - - $this->response->html($this->template->layout('projectinfo/activity', array( - 'board_selector' => $this->projectPermission->getAllowedProjects($this->userSession->getId()), - 'events' => $this->projectActivity->getProject($project['id']), - 'project' => $project, - 'title' => t('%s\'s activity', $project['name']) - ))); - } - - /** - * Task search for a given project - * - * @access public - */ - public function search() - { - $project = $this->getProject(); - $search = $this->request->getStringParam('search'); - $nb_tasks = 0; - - $paginator = $this->paginator - ->setUrl('projectinfo', 'search', array('search' => $search, 'project_id' => $project['id'])) - ->setMax(30) - ->setOrder('tasks.id') - ->setDirection('DESC'); - - if ($search !== '') { - $paginator->setQuery($this->taskFilter->search($search)->filterByProject($project['id'])->getQuery()) - ->calculate(); - - $nb_tasks = $paginator->getTotal(); - } - - $this->response->html($this->template->layout('projectinfo/search', array( - 'board_selector' => $this->projectPermission->getAllowedProjects($this->userSession->getId()), - 'values' => array( - 'search' => $search, - 'controller' => 'projectinfo', - 'action' => 'search', - 'project_id' => $project['id'], - ), - 'paginator' => $paginator, - 'project' => $project, - 'columns' => $this->board->getColumnsList($project['id']), - 'categories' => $this->category->getList($project['id'], false), - 'title' => t('Search in the project "%s"', $project['name']).($nb_tasks > 0 ? ' ('.$nb_tasks.')' : '') - ))); - } - - /** - * List of completed tasks for a given project - * - * @access public - */ - public function tasks() - { - $project = $this->getProject(); - $paginator = $this->paginator - ->setUrl('projectinfo', 'tasks', array('project_id' => $project['id'])) - ->setMax(30) - ->setOrder('tasks.id') - ->setDirection('DESC') - ->setQuery($this->taskFinder->getClosedTaskQuery($project['id'])) - ->calculate(); - - $this->response->html($this->template->layout('projectinfo/tasks', array( - 'board_selector' => $this->projectPermission->getAllowedProjects($this->userSession->getId()), - 'project' => $project, - 'columns' => $this->board->getColumnsList($project['id']), - 'categories' => $this->category->getList($project['id'], false), - 'paginator' => $paginator, - 'title' => t('Completed tasks for "%s"', $project['name']).' ('.$paginator->getTotal().')' - ))); - } -} diff --git a/app/Model/Acl.php b/app/Model/Acl.php index 91ed035b..09638302 100644 --- a/app/Model/Acl.php +++ b/app/Model/Acl.php @@ -37,7 +37,8 @@ class Acl extends Base 'comment' => '*', 'file' => '*', 'project' => array('show'), - 'projectinfo' => array('tasks', 'search', 'activity'), + 'listing' => '*', + 'activity' => '*', 'subtask' => '*', 'task' => '*', 'tasklink' => '*', diff --git a/app/Model/Board.php b/app/Model/Board.php index f6f968f4..bcf77b3e 100644 --- a/app/Model/Board.php +++ b/app/Model/Board.php @@ -237,10 +237,11 @@ class Board extends Base * Get all tasks sorted by columns and swimlanes * * @access public - * @param integer $project_id Project id + * @param integer $project_id + * @param callable $callback * @return array */ - public function getBoard($project_id) + public function getBoard($project_id, $callback = null) { $swimlanes = $this->swimlane->getSwimlanes($project_id); $columns = $this->getColumns($project_id); @@ -253,7 +254,11 @@ class Board extends Base $swimlanes[$i]['nb_tasks'] = 0; for ($j = 0; $j < $nb_columns; $j++) { - $swimlanes[$i]['columns'][$j]['tasks'] = $this->taskFinder->getTasksByColumnAndSwimlane($project_id, $columns[$j]['id'], $swimlanes[$i]['id']); + + $column_id = $columns[$j]['id']; + $swimlane_id = $swimlanes[$i]['id']; + + $swimlanes[$i]['columns'][$j]['tasks'] = $callback === null ? $this->taskFinder->getTasksByColumnAndSwimlane($project_id, $column_id, $swimlane_id) : $callback($project_id, $column_id, $swimlane_id); $swimlanes[$i]['columns'][$j]['nb_tasks'] = count($swimlanes[$i]['columns'][$j]['tasks']); $swimlanes[$i]['columns'][$j]['score'] = $this->getColumnSum($swimlanes[$i]['columns'][$j]['tasks'], 'score'); $swimlanes[$i]['nb_tasks'] += $swimlanes[$i]['columns'][$j]['nb_tasks']; diff --git a/app/Model/TaskFilter.php b/app/Model/TaskFilter.php index 31080cb5..e9d9ccbd 100644 --- a/app/Model/TaskFilter.php +++ b/app/Model/TaskFilter.php @@ -512,6 +512,23 @@ class TaskFilter extends Base return $this->query; } + /** + * Get swimlanes and tasks to display the board + * + * @access public + * @return array + */ + public function getBoard($project_id) + { + $tasks = $this->filterByProject($project_id)->query->asc(Task::TABLE.'.position')->findAll(); + + return $this->board->getBoard($project_id, function ($project_id, $column_id, $swimlane_id) use ($tasks) { + return array_filter($tasks, function(array $task) use ($column_id, $swimlane_id) { + return $task['column_id'] == $column_id && $task['swimlane_id'] == $swimlane_id; + }); + }); + } + /** * Format the results to the ajax autocompletion * diff --git a/app/Model/TaskFinder.php b/app/Model/TaskFinder.php index b91f4bad..2b0453a5 100644 --- a/app/Model/TaskFinder.php +++ b/app/Model/TaskFinder.php @@ -12,20 +12,6 @@ use PDO; */ class TaskFinder extends Base { - /** - * Get query for closed tasks - * - * @access public - * @param integer $project_id Project id - * @return \PicoDb\Table - */ - public function getClosedTaskQuery($project_id) - { - return $this->getExtendedQuery() - ->eq(Task::TABLE.'.project_id', $project_id) - ->eq(Task::TABLE.'.is_active', Task::STATUS_CLOSED); - } - /** * Get query for assigned user tasks * @@ -142,8 +128,8 @@ class TaskFinder extends Base { return $this->db ->table(Task::TABLE) - ->eq('project_id', $project_id) - ->eq('is_active', $status_id) + ->eq(Task::TABLE.'.project_id', $project_id) + ->eq(Task::TABLE.'.is_active', $status_id) ->findAll(); } diff --git a/app/Model/TaskPosition.php b/app/Model/TaskPosition.php index 0c4beb2d..a33a4029 100644 --- a/app/Model/TaskPosition.php +++ b/app/Model/TaskPosition.php @@ -28,6 +28,11 @@ class TaskPosition extends Base { $original_task = $this->taskFinder->getById($task_id); + // Ignore closed tasks + if ($original_task['is_active'] == Task::STATUS_CLOSED) { + return true; + } + $result = $this->calculateAndSave($project_id, $task_id, $column_id, $position, $swimlane_id); if ($result) { diff --git a/app/Model/UserSession.php b/app/Model/UserSession.php index f1f2ffee..6de4a182 100644 --- a/app/Model/UserSession.php +++ b/app/Model/UserSession.php @@ -94,4 +94,28 @@ class UserSession extends Base { return ! empty($this->session['user']); } + + /** + * Get project filters from the session + * + * @access public + * @param integer $project_id + * @return string + */ + public function getFilters($project_id) + { + return ! empty($_SESSION['filters'][$project_id]) ? $_SESSION['filters'][$project_id] : 'status:open'; + } + + /** + * Save project filters in the session + * + * @access public + * @param integer $project_id + * @param string $filters + */ + public function setFilters($project_id, $filters) + { + $_SESSION['filters'][$project_id] = $filters; + } } diff --git a/app/Template/activity/project.php b/app/Template/activity/project.php new file mode 100644 index 00000000..480bbadd --- /dev/null +++ b/app/Template/activity/project.php @@ -0,0 +1,40 @@ +
+ + + render('event/events', array('events' => $events)) ?> +
\ No newline at end of file diff --git a/app/Template/analytic/layout.php b/app/Template/analytic/layout.php index 41c6a2ab..9d6bf77c 100644 --- a/app/Template/analytic/layout.php +++ b/app/Template/analytic/layout.php @@ -12,9 +12,19 @@
  • - + url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
  • +
  • + + url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> +
  • + user->isManager($project['id'])): ?> +
  • + + url->link(t('Project settings'), 'project', 'show', array('project_id' => $project['id'])) ?> +
  • +
  • url->link(t('All projects'), 'project', 'index') ?> diff --git a/app/Template/app/calendar.php b/app/Template/app/calendar.php index 6acee6ec..a154203b 100644 --- a/app/Template/app/calendar.php +++ b/app/Template/app/calendar.php @@ -1,6 +1,5 @@ -
    diff --git a/app/Template/app/overview.php b/app/Template/app/overview.php index a2301cd0..66bcaa63 100644 --- a/app/Template/app/overview.php +++ b/app/Template/app/overview.php @@ -1,7 +1,7 @@
    form->hidden('controller', array('controller' => 'search')) ?> form->hidden('action', array('controller' => 'index')) ?> - form->text('search', array(), array(), array('required', 'placeholder="'.t('Search').'"'), 'form-input-large') ?> + form->text('search', array(), array(), array('placeholder="'.t('Search').'"'), 'form-input-large') ?>
    diff --git a/app/Template/board/assignee.php b/app/Template/board/assignee.php deleted file mode 100644 index 4af19cf7..00000000 --- a/app/Template/board/assignee.php +++ /dev/null @@ -1,21 +0,0 @@ -
    -
    -

    -
    - - form->csrf() ?> - - form->hidden('id', $values) ?> - form->hidden('project_id', $values) ?> - - form->label(t('Assignee'), 'owner_id') ?> - form->select('owner_id', $users_list, $values, array(), array('autofocus')) ?>
    - -
    - - - url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> -
    -
    -
    -
    \ No newline at end of file diff --git a/app/Template/board/category.php b/app/Template/board/category.php deleted file mode 100644 index b38758d3..00000000 --- a/app/Template/board/category.php +++ /dev/null @@ -1,22 +0,0 @@ -
    -
    -

    -
    - - form->csrf() ?> - - form->hidden('id', $values) ?> - form->hidden('project_id', $values) ?> - - form->label(t('Category'), 'category_id') ?> - form->select('category_id', $categories_list, $values) ?>
    - -
    - - - url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> -
    -
    -
    - -
    \ No newline at end of file diff --git a/app/Template/board/comments.php b/app/Template/board/comments.php deleted file mode 100644 index 2e2c0c1e..00000000 --- a/app/Template/board/comments.php +++ /dev/null @@ -1,16 +0,0 @@ -
    - -

    - - e($comment['name'] ?: $comment['username']) ?> @ - - -

    - -
    -
    - text->markdown($comment['comment']) ?> -
    -
    - -
    diff --git a/app/Template/board/description.php b/app/Template/board/description.php deleted file mode 100644 index 7e0e3430..00000000 --- a/app/Template/board/description.php +++ /dev/null @@ -1,5 +0,0 @@ -
    -
    - text->markdown($task['description']) ?> -
    -
    \ No newline at end of file diff --git a/app/Template/board/files.php b/app/Template/board/files.php deleted file mode 100644 index 81136659..00000000 --- a/app/Template/board/files.php +++ /dev/null @@ -1,31 +0,0 @@ -
    - - - - - - - - - - - - - - - - - -
    - - e($file['name']) ?> - - url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> - url->link(t('open'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> -
    - - e($file['name']) ?> - - url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> -
    -
    diff --git a/app/Template/board/filters.php b/app/Template/board/filters.php deleted file mode 100644 index b80234a0..00000000 --- a/app/Template/board/filters.php +++ /dev/null @@ -1,43 +0,0 @@ - \ No newline at end of file diff --git a/app/Template/board/index.php b/app/Template/board/index.php deleted file mode 100644 index 6f6fddbe..00000000 --- a/app/Template/board/index.php +++ /dev/null @@ -1,16 +0,0 @@ -
    - - render('board/filters', array( - 'categories' => $categories_listing, - 'users' => $users, - 'project' => $project, - )) ?> - - render('board/show', array( - 'project' => $project, - 'swimlanes' => $swimlanes, - 'board_private_refresh_interval' => $board_private_refresh_interval, - 'board_highlight_period' => $board_highlight_period, - )) ?> - -
    diff --git a/app/Template/board/popover_assignee.php b/app/Template/board/popover_assignee.php new file mode 100644 index 00000000..4af19cf7 --- /dev/null +++ b/app/Template/board/popover_assignee.php @@ -0,0 +1,21 @@ +
    +
    +

    +
    + + form->csrf() ?> + + form->hidden('id', $values) ?> + form->hidden('project_id', $values) ?> + + form->label(t('Assignee'), 'owner_id') ?> + form->select('owner_id', $users_list, $values, array(), array('autofocus')) ?>
    + +
    + + + url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> +
    +
    +
    +
    \ No newline at end of file diff --git a/app/Template/board/popover_category.php b/app/Template/board/popover_category.php new file mode 100644 index 00000000..b38758d3 --- /dev/null +++ b/app/Template/board/popover_category.php @@ -0,0 +1,22 @@ +
    +
    +

    +
    + + form->csrf() ?> + + form->hidden('id', $values) ?> + form->hidden('project_id', $values) ?> + + form->label(t('Category'), 'category_id') ?> + form->select('category_id', $categories_list, $values) ?>
    + +
    + + + url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> +
    +
    +
    + +
    \ No newline at end of file diff --git a/app/Template/board/private_view.php b/app/Template/board/private_view.php new file mode 100644 index 00000000..5fdaa7fc --- /dev/null +++ b/app/Template/board/private_view.php @@ -0,0 +1,16 @@ +
    + + render('project/filters', array( + 'project' => $project, + 'filters' => $filters, + 'is_board' => true, + )) ?> + + render('board/table_container', array( + 'project' => $project, + 'swimlanes' => $swimlanes, + 'board_private_refresh_interval' => $board_private_refresh_interval, + 'board_highlight_period' => $board_highlight_period, + )) ?> + +
    diff --git a/app/Template/board/public.php b/app/Template/board/public.php deleted file mode 100644 index ad7515db..00000000 --- a/app/Template/board/public.php +++ /dev/null @@ -1,11 +0,0 @@ -
    - - render('board/show', array( - 'project' => $project, - 'swimlanes' => $swimlanes, - 'board_private_refresh_interval' => $board_private_refresh_interval, - 'board_highlight_period' => $board_highlight_period, - 'not_editable' => true, - )) ?> - -
    \ No newline at end of file diff --git a/app/Template/board/public_view.php b/app/Template/board/public_view.php new file mode 100644 index 00000000..aea72031 --- /dev/null +++ b/app/Template/board/public_view.php @@ -0,0 +1,11 @@ +
    + + render('board/table_container', array( + 'project' => $project, + 'swimlanes' => $swimlanes, + 'board_private_refresh_interval' => $board_private_refresh_interval, + 'board_highlight_period' => $board_highlight_period, + 'not_editable' => true, + )) ?> + +
    \ No newline at end of file diff --git a/app/Template/board/show.php b/app/Template/board/show.php deleted file mode 100644 index c0aa5d36..00000000 --- a/app/Template/board/show.php +++ /dev/null @@ -1,30 +0,0 @@ -
    - - - -
    - - - - -

    - - - render('board/swimlane', array( - 'project' => $project, - 'swimlane' => $swimlane, - 'board_highlight_period' => $board_highlight_period, - 'hide_swimlane' => count($swimlanes) === 1, - 'not_editable' => isset($not_editable), - )) ?> - - -
    -
    \ No newline at end of file diff --git a/app/Template/board/subtasks.php b/app/Template/board/subtasks.php deleted file mode 100644 index 950da925..00000000 --- a/app/Template/board/subtasks.php +++ /dev/null @@ -1,7 +0,0 @@ -
    - - subtask->toggleStatus($subtask, 'board') ?> - e(empty($subtask['username']) ? '' : ' ['.$this->user->getFullname($subtask).']') ?> -
    - -
    diff --git a/app/Template/board/swimlane.php b/app/Template/board/swimlane.php deleted file mode 100644 index b86fc446..00000000 --- a/app/Template/board/swimlane.php +++ /dev/null @@ -1,83 +0,0 @@ - - - - 0): ?> - - - - - e($swimlane['name']) ?> - - - - - - - -
    - url->link('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-board-popover', t('Add a new task')) ?> -
    - - - e($column['title']) ?> - - - '> - - - - - - -   - - - - - - (/e($column['task_limit']) ?>) - - - - () - - - - - - - - - - e($swimlane['name']) ?> - - - () - - - - - - - - - - - - - - render($not_editable ? 'board/task_public' : 'board/task_private', array( - 'project' => $project, - 'task' => $task, - 'board_highlight_period' => $board_highlight_period, - 'not_editable' => $not_editable, - )) ?> - - - - \ No newline at end of file diff --git a/app/Template/board/table_container.php b/app/Template/board/table_container.php new file mode 100644 index 00000000..9d3a1134 --- /dev/null +++ b/app/Template/board/table_container.php @@ -0,0 +1,30 @@ +
    + + + +
    + + + + +

    + + + render('board/table_swimlane', array( + 'project' => $project, + 'swimlane' => $swimlane, + 'board_highlight_period' => $board_highlight_period, + 'hide_swimlane' => count($swimlanes) === 1, + 'not_editable' => isset($not_editable), + )) ?> + + +
    +
    \ No newline at end of file diff --git a/app/Template/board/table_swimlane.php b/app/Template/board/table_swimlane.php new file mode 100644 index 00000000..b86fc446 --- /dev/null +++ b/app/Template/board/table_swimlane.php @@ -0,0 +1,83 @@ + + + + 0): ?> + + + + + e($swimlane['name']) ?> + + + + + + + +
    + url->link('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-board-popover', t('Add a new task')) ?> +
    + + + e($column['title']) ?> + + + '> + + + + + + +   + + + + + + (/e($column['task_limit']) ?>) + + + + () + + + + + + + + + + e($swimlane['name']) ?> + + + () + + + + + + + + + + + + + + render($not_editable ? 'board/task_public' : 'board/task_private', array( + 'project' => $project, + 'task' => $task, + 'board_highlight_period' => $board_highlight_period, + 'not_editable' => $not_editable, + )) ?> + + + + \ No newline at end of file diff --git a/app/Template/board/tasklinks.php b/app/Template/board/tasklinks.php deleted file mode 100644 index 25aa91aa..00000000 --- a/app/Template/board/tasklinks.php +++ /dev/null @@ -1,18 +0,0 @@ - \ No newline at end of file diff --git a/app/Template/board/tooltip_comments.php b/app/Template/board/tooltip_comments.php new file mode 100644 index 00000000..2e2c0c1e --- /dev/null +++ b/app/Template/board/tooltip_comments.php @@ -0,0 +1,16 @@ +
    + +

    + + e($comment['name'] ?: $comment['username']) ?> @ + + +

    + +
    +
    + text->markdown($comment['comment']) ?> +
    +
    + +
    diff --git a/app/Template/board/tooltip_description.php b/app/Template/board/tooltip_description.php new file mode 100644 index 00000000..7e0e3430 --- /dev/null +++ b/app/Template/board/tooltip_description.php @@ -0,0 +1,5 @@ +
    +
    + text->markdown($task['description']) ?> +
    +
    \ No newline at end of file diff --git a/app/Template/board/tooltip_files.php b/app/Template/board/tooltip_files.php new file mode 100644 index 00000000..81136659 --- /dev/null +++ b/app/Template/board/tooltip_files.php @@ -0,0 +1,31 @@ +
    + + + + + + + + + + + + + + + + + +
    + + e($file['name']) ?> + + url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + url->link(t('open'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> +
    + + e($file['name']) ?> + + url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> +
    +
    diff --git a/app/Template/board/tooltip_subtasks.php b/app/Template/board/tooltip_subtasks.php new file mode 100644 index 00000000..950da925 --- /dev/null +++ b/app/Template/board/tooltip_subtasks.php @@ -0,0 +1,7 @@ +
    + + subtask->toggleStatus($subtask, 'board') ?> + e(empty($subtask['username']) ? '' : ' ['.$this->user->getFullname($subtask).']') ?> +
    + +
    diff --git a/app/Template/board/tooltip_tasklinks.php b/app/Template/board/tooltip_tasklinks.php new file mode 100644 index 00000000..25aa91aa --- /dev/null +++ b/app/Template/board/tooltip_tasklinks.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/app/Template/calendar/show.php b/app/Template/calendar/show.php index cf2a20ec..0406414c 100644 --- a/app/Template/calendar/show.php +++ b/app/Template/calendar/show.php @@ -1,46 +1,13 @@
    - - +
    +
    \ No newline at end of file diff --git a/app/Template/calendar/sidebar.php b/app/Template/calendar/sidebar.php deleted file mode 100644 index 6c4fb5b0..00000000 --- a/app/Template/calendar/sidebar.php +++ /dev/null @@ -1,40 +0,0 @@ - diff --git a/app/Template/listing/show.php b/app/Template/listing/show.php new file mode 100644 index 00000000..06940678 --- /dev/null +++ b/app/Template/listing/show.php @@ -0,0 +1,67 @@ +
    + render('project/filters', array( + 'project' => $project, + 'filters' => $filters, + )) ?> + + isEmpty()): ?> +

    + isEmpty()): ?> + + + + + + + + + + + + + getCollection() as $task): ?> + + + + + + + + + + + + +
    order(t('Id'), 'tasks.id') ?>order(t('Column'), 'tasks.column_id') ?>order(t('Category'), 'tasks.category_id') ?>order(t('Title'), 'tasks.title') ?>order(t('Assignee'), 'users.username') ?>order(t('Due date'), 'tasks.date_due') ?>order(t('Date created'), 'tasks.date_creation') ?>order(t('Date completed'), 'tasks.date_completed') ?>order(t('Status'), 'tasks.is_active') ?>
    + url->link('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + + e($task['column_name']) ?> + + e($task['category_name']) ?> + + url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + + + e($task['assignee_name'] ?: $task['assignee_username']) ?> + + + + + + + + + + + + + + + + + +
    + + + +
    \ No newline at end of file diff --git a/app/Template/project/dropdown.php b/app/Template/project/dropdown.php index 2e2650a7..aa4322e6 100644 --- a/app/Template/project/dropdown.php +++ b/app/Template/project/dropdown.php @@ -1,18 +1,6 @@ -
  • - - url->link(t('Search'), 'projectinfo', 'search', array('project_id' => $project['id'])) ?> -
  • -
  • - - url->link(t('Completed tasks'), 'projectinfo', 'tasks', array('project_id' => $project['id'])) ?> -
  • - url->link(t('Activity'), 'projectinfo', 'activity', array('project_id' => $project['id'])) ?> -
  • -
  • - - url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> + url->link(t('Activity'), 'activity', 'project', array('project_id' => $project['id'])) ?>
  • diff --git a/app/Template/project/filters.php b/app/Template/project/filters.php new file mode 100644 index 00000000..402807d7 --- /dev/null +++ b/app/Template/project/filters.php @@ -0,0 +1,49 @@ + \ No newline at end of file diff --git a/app/Template/project/index.php b/app/Template/project/index.php index 1080968e..7a03ec16 100644 --- a/app/Template/project/index.php +++ b/app/Template/project/index.php @@ -35,7 +35,7 @@ e($project['identifier']) ?> - url->link('', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?>  + url->link('', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?>  diff --git a/app/Template/project/layout.php b/app/Template/project/layout.php index 7bb3d478..8ba92ef9 100644 --- a/app/Template/project/layout.php +++ b/app/Template/project/layout.php @@ -12,9 +12,13 @@
  • - + url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
  • +
  • + + url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?> +
  • url->link(t('All projects'), 'project', 'index') ?> diff --git a/app/Template/projectinfo/activity.php b/app/Template/projectinfo/activity.php deleted file mode 100644 index d458ea3d..00000000 --- a/app/Template/projectinfo/activity.php +++ /dev/null @@ -1,30 +0,0 @@ -
    - - - render('event/events', array('events' => $events)) ?> -
    \ No newline at end of file diff --git a/app/Template/projectinfo/search.php b/app/Template/projectinfo/search.php deleted file mode 100644 index 4b7c8f70..00000000 --- a/app/Template/projectinfo/search.php +++ /dev/null @@ -1,43 +0,0 @@ -
    - - -
    - form->hidden('controller', $values) ?> - form->hidden('action', $values) ?> - form->hidden('project_id', $values) ?> - form->text('search', $values, array(), array('autofocus', 'required', 'placeholder="'.t('Search').'"'), 'form-input-large') ?> - -
    - - isEmpty()): ?> -

    - isEmpty()): ?> - render('task/table', array( - 'paginator' => $paginator, - 'categories' => $categories, - 'columns' => $columns, - )) ?> - - -
    \ No newline at end of file diff --git a/app/Template/projectinfo/tasks.php b/app/Template/projectinfo/tasks.php deleted file mode 100644 index 41884783..00000000 --- a/app/Template/projectinfo/tasks.php +++ /dev/null @@ -1,33 +0,0 @@ -
    - - isEmpty()): ?> -

    - - render('task/table', array( - 'paginator' => $paginator, - 'categories' => $categories, - 'columns' => $columns, - )) ?> - -
    \ No newline at end of file diff --git a/app/Template/task/layout.php b/app/Template/task/layout.php index 5a14fb39..ddce4bce 100644 --- a/app/Template/task/layout.php +++ b/app/Template/task/layout.php @@ -2,19 +2,19 @@