From 554500aa493faa66b43b2ddce72338880a874724 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 4 Jul 2015 11:14:21 -0400 Subject: [PATCH] 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 +++ .../activity.php => activity/project.php} | 12 +- app/Template/analytic/layout.php | 12 +- app/Template/app/calendar.php | 5 +- app/Template/app/overview.php | 2 +- app/Template/board/filters.php | 43 ---- .../{assignee.php => popover_assignee.php} | 0 .../{category.php => popover_category.php} | 0 .../board/{index.php => private_view.php} | 8 +- .../board/{public.php => public_view.php} | 2 +- .../board/{show.php => table_container.php} | 2 +- .../{swimlane.php => table_swimlane.php} | 0 .../{comments.php => tooltip_comments.php} | 0 ...escription.php => tooltip_description.php} | 0 .../board/{files.php => tooltip_files.php} | 0 .../{subtasks.php => tooltip_subtasks.php} | 0 .../{tasklinks.php => tooltip_tasklinks.php} | 0 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/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 +- 52 files changed, 463 insertions(+), 758 deletions(-) create mode 100644 app/Controller/Activity.php create mode 100644 app/Controller/Listing.php delete mode 100644 app/Controller/Projectinfo.php rename app/Template/{projectinfo/activity.php => activity/project.php} (69%) delete mode 100644 app/Template/board/filters.php rename app/Template/board/{assignee.php => popover_assignee.php} (100%) rename app/Template/board/{category.php => popover_category.php} (100%) rename app/Template/board/{index.php => private_view.php} (65%) rename app/Template/board/{public.php => public_view.php} (83%) rename app/Template/board/{show.php => table_container.php} (95%) rename app/Template/board/{swimlane.php => table_swimlane.php} (100%) rename app/Template/board/{comments.php => tooltip_comments.php} (100%) rename app/Template/board/{description.php => tooltip_description.php} (100%) rename app/Template/board/{files.php => tooltip_files.php} (100%) rename app/Template/board/{subtasks.php => tooltip_subtasks.php} (100%) rename app/Template/board/{tasklinks.php => tooltip_tasklinks.php} (100%) 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/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 000000000..2276b3b88 --- /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 b7ee431ff..9f5d6dc62 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 0f38f910d..caaa38efa 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 41642a59b..8a24d705d 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 000000000..2c197e3ed --- /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 22b9861c8..000000000 --- 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 91ed035b9..09638302a 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 f6f968f49..bcf77b3ef 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 31080cb53..e9d9ccbd2 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 b91f4bade..2b0453a5a 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 0c4beb2d9..a33a40297 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 f1f2ffee6..6de4a1824 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/projectinfo/activity.php b/app/Template/activity/project.php similarity index 69% rename from app/Template/projectinfo/activity.php rename to app/Template/activity/project.php index d458ea3da..480bbadd6 100644 --- a/app/Template/projectinfo/activity.php +++ b/app/Template/activity/project.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/analytic/layout.php b/app/Template/analytic/layout.php index 41c6a2ab9..9d6bf77c4 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 6acee6ec2..a154203b7 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 a2301cd0d..66bcaa633 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/filters.php b/app/Template/board/filters.php deleted file mode 100644 index b80234a0a..000000000 --- a/app/Template/board/filters.php +++ /dev/null @@ -1,43 +0,0 @@ - \ No newline at end of file diff --git a/app/Template/board/assignee.php b/app/Template/board/popover_assignee.php similarity index 100% rename from app/Template/board/assignee.php rename to app/Template/board/popover_assignee.php diff --git a/app/Template/board/category.php b/app/Template/board/popover_category.php similarity index 100% rename from app/Template/board/category.php rename to app/Template/board/popover_category.php diff --git a/app/Template/board/index.php b/app/Template/board/private_view.php similarity index 65% rename from app/Template/board/index.php rename to app/Template/board/private_view.php index 6f6fddbe7..5fdaa7fcd 100644 --- a/app/Template/board/index.php +++ b/app/Template/board/private_view.php @@ -1,12 +1,12 @@
    - render('board/filters', array( - 'categories' => $categories_listing, - 'users' => $users, + render('project/filters', array( 'project' => $project, + 'filters' => $filters, + 'is_board' => true, )) ?> - render('board/show', array( + render('board/table_container', array( 'project' => $project, 'swimlanes' => $swimlanes, 'board_private_refresh_interval' => $board_private_refresh_interval, diff --git a/app/Template/board/public.php b/app/Template/board/public_view.php similarity index 83% rename from app/Template/board/public.php rename to app/Template/board/public_view.php index ad7515dbf..aea72031d 100644 --- a/app/Template/board/public.php +++ b/app/Template/board/public_view.php @@ -1,6 +1,6 @@
    - render('board/show', array( + render('board/table_container', array( 'project' => $project, 'swimlanes' => $swimlanes, 'board_private_refresh_interval' => $board_private_refresh_interval, diff --git a/app/Template/board/show.php b/app/Template/board/table_container.php similarity index 95% rename from app/Template/board/show.php rename to app/Template/board/table_container.php index c0aa5d368..9d3a11344 100644 --- a/app/Template/board/show.php +++ b/app/Template/board/table_container.php @@ -17,7 +17,7 @@

    - render('board/swimlane', array( + render('board/table_swimlane', array( 'project' => $project, 'swimlane' => $swimlane, 'board_highlight_period' => $board_highlight_period, diff --git a/app/Template/board/swimlane.php b/app/Template/board/table_swimlane.php similarity index 100% rename from app/Template/board/swimlane.php rename to app/Template/board/table_swimlane.php diff --git a/app/Template/board/comments.php b/app/Template/board/tooltip_comments.php similarity index 100% rename from app/Template/board/comments.php rename to app/Template/board/tooltip_comments.php diff --git a/app/Template/board/description.php b/app/Template/board/tooltip_description.php similarity index 100% rename from app/Template/board/description.php rename to app/Template/board/tooltip_description.php diff --git a/app/Template/board/files.php b/app/Template/board/tooltip_files.php similarity index 100% rename from app/Template/board/files.php rename to app/Template/board/tooltip_files.php diff --git a/app/Template/board/subtasks.php b/app/Template/board/tooltip_subtasks.php similarity index 100% rename from app/Template/board/subtasks.php rename to app/Template/board/tooltip_subtasks.php diff --git a/app/Template/board/tasklinks.php b/app/Template/board/tooltip_tasklinks.php similarity index 100% rename from app/Template/board/tasklinks.php rename to app/Template/board/tooltip_tasklinks.php diff --git a/app/Template/calendar/show.php b/app/Template/calendar/show.php index cf2a20ec9..0406414c8 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 6c4fb5b0d..000000000 --- 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 000000000..069406787 --- /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 2e2650a76..aa4322e69 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 000000000..402807d78 --- /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 1080968e7..7a03ec16b 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 7bb3d4785..8ba92ef96 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/search.php b/app/Template/projectinfo/search.php deleted file mode 100644 index 4b7c8f70d..000000000 --- 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 418847839..000000000 --- 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 5a14fb39d..ddce4bce6 100644 --- a/app/Template/task/layout.php +++ b/app/Template/task/layout.php @@ -2,19 +2,19 @@