From 7c1c14cf64b59f211b9d505112797cb855e5b604 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 18 Jan 2015 17:59:41 -0500 Subject: Pagination refactoring --- app/Template/app/dashboard.php | 6 +++--- app/Template/app/projects.php | 11 ++++++----- app/Template/app/subtasks.php | 14 +++++++------- app/Template/app/tasks.php | 14 +++++++------- app/Template/project/search.php | 7 +++---- app/Template/project/tasks.php | 5 ++--- app/Template/task/table.php | 22 +++++++++++----------- app/Template/user/index.php | 22 +++++++++++----------- 8 files changed, 50 insertions(+), 51 deletions(-) (limited to 'app/Template') diff --git a/app/Template/app/dashboard.php b/app/Template/app/dashboard.php index 81305ed8..592621a6 100644 --- a/app/Template/app/dashboard.php +++ b/app/Template/app/dashboard.php @@ -14,9 +14,9 @@
- render('app/projects', array('projects' => $projects, 'pagination' => $project_pagination)) ?> - render('app/tasks', array('tasks' => $tasks, 'pagination' => $task_pagination)) ?> - render('app/subtasks', array('subtasks' => $subtasks, 'pagination' => $subtask_pagination)) ?> + render('app/projects', array('paginator' => $project_paginator)) ?> + render('app/tasks', array('paginator' => $task_paginator)) ?> + render('app/subtasks', array('paginator' => $subtask_paginator)) ?>

diff --git a/app/Template/app/projects.php b/app/Template/app/projects.php index 724a6a5d..4740c4b8 100644 --- a/app/Template/app/projects.php +++ b/app/Template/app/projects.php @@ -1,14 +1,14 @@

- +isEmpty()): ?>

- - + + - + getCollection() as $project): ?> @@ -30,5 +31,5 @@
order('Id', 'id', $pagination) ?>order(t('Project'), 'name', $pagination) ?>order('Id', 'id') ?>order(t('Project'), 'name') ?>
a('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?> @@ -17,6 +17,7 @@ isManager($project['id'])): ?> a('', 'project', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Settings')) ?>  + a('', 'calendar', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Calendar')) ?>  a($this->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?>
- paginate($pagination) ?> + \ No newline at end of file diff --git a/app/Template/app/subtasks.php b/app/Template/app/subtasks.php index 2ad343e5..75320027 100644 --- a/app/Template/app/subtasks.php +++ b/app/Template/app/subtasks.php @@ -1,15 +1,15 @@

- +isEmpty()): ?>

- - - - + + + + - + getCollection() as $subtask): ?>
order('Id', 'tasks.id', $pagination) ?>order(t('Project'), 'project_name', $pagination) ?>order(t('Status'), 'status', $pagination) ?>order(t('Subtask'), 'title', $pagination) ?>order('Id', 'tasks.id') ?>order(t('Project'), 'project_name') ?>order(t('Status'), 'status') ?>order(t('Subtask'), 'title') ?>
a('#'.$subtask['task_id'], 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?> @@ -27,5 +27,5 @@
- paginate($pagination) ?> + \ No newline at end of file diff --git a/app/Template/app/tasks.php b/app/Template/app/tasks.php index dc485d7b..37843af5 100644 --- a/app/Template/app/tasks.php +++ b/app/Template/app/tasks.php @@ -1,15 +1,15 @@

- +isEmpty()): ?>

- - - - + + + + - + getCollection() as $task): ?>
order('Id', 'tasks.id', $pagination) ?>order(t('Project'), 'project_name', $pagination) ?>order(t('Task'), 'title', $pagination) ?>order(t('Due date'), 'date_due', $pagination) ?>order('Id', 'tasks.id') ?>order(t('Project'), 'project_name') ?>order(t('Task'), 'title') ?>order(t('Due date'), 'date_due') ?>
a('#'.$task['id'], 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> @@ -27,5 +27,5 @@
- paginate($pagination) ?> + \ No newline at end of file diff --git a/app/Template/project/search.php b/app/Template/project/search.php index 695940ac..47ba0f77 100644 --- a/app/Template/project/search.php +++ b/app/Template/project/search.php @@ -28,14 +28,13 @@ - + isEmpty()): ?>

- + isEmpty()): ?> render('task/table', array( - 'tasks' => $tasks, + 'paginator' => $paginator, 'categories' => $categories, 'columns' => $columns, - 'pagination' => $pagination, )) ?> diff --git a/app/Template/project/tasks.php b/app/Template/project/tasks.php index c52abde4..b22746f9 100644 --- a/app/Template/project/tasks.php +++ b/app/Template/project/tasks.php @@ -20,14 +20,13 @@
- + isEmpty()): ?>

render('task/table', array( - 'tasks' => $tasks, + 'paginator' => $paginator, 'categories' => $categories, 'columns' => $columns, - 'pagination' => $pagination, )) ?>
diff --git a/app/Template/task/table.php b/app/Template/task/table.php index e8ca7c51..4ccf83b9 100644 --- a/app/Template/task/table.php +++ b/app/Template/task/table.php @@ -1,16 +1,16 @@ - - - - - - - - - + + + + + + + + + - + getCollection() as $task): ?>
order(t('Id'), 'tasks.id', $pagination) ?>order(t('Column'), 'tasks.column_id', $pagination) ?>order(t('Category'), 'tasks.category_id', $pagination) ?>order(t('Title'), 'tasks.title', $pagination) ?>order(t('Assignee'), 'users.username', $pagination) ?>order(t('Due date'), 'tasks.date_due', $pagination) ?>order(t('Date created'), 'tasks.date_creation', $pagination) ?>order(t('Date completed'), 'tasks.date_completed', $pagination) ?>order(t('Status'), 'tasks.is_active', $pagination) ?>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') ?>
a('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> @@ -53,4 +53,4 @@
-paginate($pagination) ?> + diff --git a/app/Template/user/index.php b/app/Template/user/index.php index e4729501..41e205ba 100644 --- a/app/Template/user/index.php +++ b/app/Template/user/index.php @@ -7,22 +7,22 @@
- + isEmpty()): ?>

- - - - - - - + + + + + + + - + - + getCollection() as $user): ?>
order(t('Id'), 'id', $pagination) ?>order(t('Username'), 'username', $pagination) ?>order(t('Name'), 'name', $pagination) ?>order(t('Email'), 'email', $pagination) ?>order(t('Administrator'), 'is_admin', $pagination) ?>order(t('Default project'), 'default_project_id', $pagination) ?>order(t('Notifications'), 'notifications_enabled', $pagination) ?>order(t('Id'), 'id') ?>order(t('Username'), 'username') ?>order(t('Name'), 'name') ?>order(t('Email'), 'email') ?>order(t('Administrator'), 'is_admin') ?>order(t('Default project'), 'default_project_id') ?>order(t('Notifications'), 'notifications_enabled') ?> order(t('Account type'), 'is_ldap_user', $pagination) ?>order(t('Account type'), 'is_ldap_user') ?>
a('#'.$user['id'], 'user', 'show', array('user_id' => $user['id'])) ?> @@ -66,7 +66,7 @@
- paginate($pagination) ?> +
-- cgit v1.2.3