From 61e63ef9e012d494864d4a0f0341a8aa2b49c5d6 Mon Sep 17 00:00:00 2001 From: Tomas Dittmann Date: Sat, 5 Feb 2022 05:59:33 +0100 Subject: [PATCH] Remove `project_id` from task URLs --- app/Controller/CommentController.php | 15 +++----- app/Controller/CommentMailController.php | 6 +-- .../ExternalTaskCreationController.php | 2 +- app/Controller/SubtaskController.php | 10 ++--- app/Controller/SubtaskConverterController.php | 5 +-- .../SubtaskRestrictionController.php | 2 +- app/Controller/TaskDuplicationController.php | 6 +-- app/Controller/TaskExternalLinkController.php | 6 +-- app/Controller/TaskFileController.php | 6 +-- app/Controller/TaskInternalLinkController.php | 6 +-- app/Controller/TaskMailController.php | 6 +-- app/Controller/TaskModificationController.php | 6 +-- app/Controller/TaskMovePositionController.php | 2 +- app/Controller/TaskRecurrenceController.php | 2 +- app/Controller/TaskStatusController.php | 2 +- app/Controller/TaskViewController.php | 2 +- .../SubtaskTimeTrackingCalendarFormatter.php | 2 +- app/Formatter/TaskApiFormatter.php | 2 +- app/Formatter/TaskICalFormatter.php | 2 +- app/Helper/SubtaskHelper.php | 4 +- app/ServiceProvider/RouteProvider.php | 10 ++--- app/Template/analytic/time_comparison.php | 4 +- app/Template/board/task_avatar.php | 2 +- app/Template/board/task_footer.php | 18 ++++----- app/Template/board/task_private.php | 10 ++--- app/Template/board/tooltip_files.php | 8 ++-- app/Template/comment/create.php | 4 +- app/Template/comment/edit.php | 2 +- app/Template/comment/remove.php | 2 +- app/Template/comment/show.php | 6 +-- app/Template/comment_list/create.php | 2 +- app/Template/comment_list/show.php | 4 +- app/Template/comment_mail/create.php | 2 +- app/Template/event/comment_create.php | 2 +- app/Template/event/comment_delete.php | 2 +- app/Template/event/comment_update.php | 2 +- app/Template/event/subtask_create.php | 2 +- app/Template/event/subtask_delete.php | 2 +- app/Template/event/subtask_update.php | 2 +- app/Template/event/task_assignee_change.php | 4 +- app/Template/event/task_close.php | 2 +- app/Template/event/task_create.php | 2 +- app/Template/event/task_file_create.php | 2 +- app/Template/event/task_file_destroy.php | 2 +- .../task_internal_link_create_update.php | 2 +- .../event/task_internal_link_delete.php | 2 +- app/Template/event/task_move_column.php | 2 +- app/Template/event/task_move_position.php | 2 +- app/Template/event/task_move_swimlane.php | 4 +- app/Template/event/task_open.php | 2 +- app/Template/event/task_update.php | 2 +- app/Template/notification/footer.php | 2 +- app/Template/notification/task_overdue.php | 2 +- app/Template/project_user_overview/tasks.php | 4 +- app/Template/subtask/create.php | 4 +- app/Template/subtask/edit.php | 2 +- app/Template/subtask/menu.php | 6 +-- app/Template/subtask/remove.php | 2 +- app/Template/subtask/table.php | 2 +- app/Template/subtask_converter/show.php | 2 +- app/Template/subtask_restriction/show.php | 2 +- app/Template/task/details.php | 6 +-- app/Template/task/dropdown.php | 28 +++++++------- app/Template/task/layout.php | 8 ++-- app/Template/task/sidebar.php | 38 +++++++++---------- app/Template/task_comments/create.php | 2 +- app/Template/task_comments/show.php | 4 +- app/Template/task_duplication/copy.php | 6 +-- app/Template/task_duplication/duplicate.php | 2 +- app/Template/task_duplication/move.php | 6 +-- app/Template/task_external_link/create.php | 2 +- app/Template/task_external_link/edit.php | 2 +- app/Template/task_external_link/find.php | 2 +- app/Template/task_external_link/remove.php | 2 +- app/Template/task_external_link/table.php | 4 +- app/Template/task_file/create.php | 2 +- app/Template/task_file/files.php | 8 ++-- app/Template/task_file/images.php | 12 +++--- app/Template/task_file/remove.php | 2 +- app/Template/task_file/screenshot.php | 2 +- app/Template/task_internal_link/create.php | 2 +- app/Template/task_internal_link/edit.php | 2 +- app/Template/task_internal_link/remove.php | 2 +- app/Template/task_internal_link/table.php | 4 +- app/Template/task_list/task_avatars.php | 2 +- app/Template/task_list/task_details.php | 2 +- app/Template/task_list/task_icons.php | 16 ++++---- app/Template/task_list/task_title.php | 2 +- app/Template/task_mail/create.php | 2 +- app/Template/task_modification/show.php | 2 +- app/Template/task_move_position/show.php | 2 +- app/Template/task_recurrence/edit.php | 2 +- app/Template/task_recurrence/info.php | 4 +- app/Template/task_status/close.php | 2 +- app/Template/task_status/open.php | 2 +- app/Template/task_suppression/remove.php | 2 +- app/Template/user_view/timesheet.php | 4 +- 97 files changed, 209 insertions(+), 219 deletions(-) diff --git a/app/Controller/CommentController.php b/app/Controller/CommentController.php index 8360c641c..8557b36a6 100644 --- a/app/Controller/CommentController.php +++ b/app/Controller/CommentController.php @@ -24,15 +24,12 @@ class CommentController extends BaseController */ public function create(array $values = array(), array $errors = array()) { - $project = $this->getProject(); $task = $this->getTask(); - $values['project_id'] = $task['project_id']; $this->response->html($this->helper->layout->task('comment/create', array( 'values' => $values, 'errors' => $errors, - 'task' => $task, - 'project' => $project, + 'task' => $task ))); } @@ -57,7 +54,7 @@ class CommentController extends BaseController $this->flash->failure(t('Unable to create your comment.')); } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), 'comments'), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id']), 'comments'), true); } else { $this->create($values, $errors); } @@ -81,8 +78,6 @@ class CommentController extends BaseController $values = $comment; } - $values['project_id'] = $task['project_id']; - $this->response->html($this->template->render('comment/edit', array( 'values' => $values, 'errors' => $errors, @@ -115,7 +110,7 @@ class CommentController extends BaseController $this->flash->failure(t('Unable to update your comment.')); } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])), true); return; } @@ -156,7 +151,7 @@ class CommentController extends BaseController $this->flash->failure(t('Unable to remove this comment.')); } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), 'comments'), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id']), 'comments'), true); } /** @@ -173,7 +168,7 @@ class CommentController extends BaseController $this->response->redirect($this->helper->url->to( 'TaskViewController', 'show', - array('task_id' => $task['id'], 'project_id' => $task['project_id']), + array('task_id' => $task['id']), 'comments' )); } diff --git a/app/Controller/CommentMailController.php b/app/Controller/CommentMailController.php index 920f786a5..575b8509f 100644 --- a/app/Controller/CommentMailController.php +++ b/app/Controller/CommentMailController.php @@ -12,15 +12,13 @@ class CommentMailController extends BaseController { public function create(array $values = array(), array $errors = array()) { - $project = $this->getProject(); $task = $this->getTask(); $this->response->html($this->helper->layout->task('comment_mail/create', array( 'values' => $values, 'errors' => $errors, 'task' => $task, - 'project' => $project, - 'members' => $this->projectPermissionModel->getMembersWithEmail($project['id']), + 'members' => $this->projectPermissionModel->getMembersWithEmail($task['project_id']), ))); } @@ -43,7 +41,7 @@ class CommentMailController extends BaseController $this->flash->failure(t('Unable to create your comment.')); } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), 'comments'), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id']), 'comments'), true); } else { $this->create($values, $errors); } diff --git a/app/Controller/ExternalTaskCreationController.php b/app/Controller/ExternalTaskCreationController.php index 0d87c0b68..6ad515d20 100644 --- a/app/Controller/ExternalTaskCreationController.php +++ b/app/Controller/ExternalTaskCreationController.php @@ -91,7 +91,7 @@ class ExternalTaskCreationController extends BaseController } else { $taskId = $this->taskCreationModel->create($values); $this->flash->success(t('Task created successfully.')); - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $project['id'], 'task_id' => $taskId)), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $taskId)), true); } } } diff --git a/app/Controller/SubtaskController.php b/app/Controller/SubtaskController.php index d5db9b2ef..8144d18f9 100644 --- a/app/Controller/SubtaskController.php +++ b/app/Controller/SubtaskController.php @@ -37,7 +37,7 @@ class SubtaskController extends BaseController 'task' => $task, ))); } - + /** * Prepare form values * @@ -86,7 +86,7 @@ class SubtaskController extends BaseController if (! $this->subtaskModel->create($subtaskValues)) { $this->flash->failure(t('Unable to create your sub-task.')); - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id']), 'subtasks'), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id']), 'subtasks'), true); return false; } @@ -110,7 +110,7 @@ class SubtaskController extends BaseController } } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id']), 'subtasks'), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id']), 'subtasks'), true); } /** @@ -160,7 +160,7 @@ class SubtaskController extends BaseController $this->flash->failure(t('Unable to update your sub-task.')); } - return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])), true); + return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])), true); } return $this->edit($values, $errors); @@ -199,7 +199,7 @@ class SubtaskController extends BaseController $this->flash->failure(t('Unable to remove this sub-task.')); } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])), true); } /** diff --git a/app/Controller/SubtaskConverterController.php b/app/Controller/SubtaskConverterController.php index dafbb7e00..5be032ea6 100644 --- a/app/Controller/SubtaskConverterController.php +++ b/app/Controller/SubtaskConverterController.php @@ -23,11 +23,10 @@ class SubtaskConverterController extends BaseController public function save() { - $project = $this->getProject(); $task = $this->getTask(); $subtask = $this->getSubtask($task); - $task_id = $this->subtaskTaskConversionModel->convertToTask($project['id'], $subtask['id']); + $task_id = $this->subtaskTaskConversionModel->convertToTask($task['project_id'], $subtask['id']); if ($task_id !== false) { $this->flash->success(t('Subtask converted to task successfully.')); @@ -35,6 +34,6 @@ class SubtaskConverterController extends BaseController $this->flash->failure(t('Unable to convert the subtask.')); } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $project['id'], 'task_id' => $task_id)), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task_id)), true); } } diff --git a/app/Controller/SubtaskRestrictionController.php b/app/Controller/SubtaskRestrictionController.php index 315b023d1..e777b1dca 100644 --- a/app/Controller/SubtaskRestrictionController.php +++ b/app/Controller/SubtaskRestrictionController.php @@ -56,6 +56,6 @@ class SubtaskRestrictionController extends BaseController 'status' => SubtaskModel::STATUS_INPROGRESS, )); - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])), true); } } diff --git a/app/Controller/TaskDuplicationController.php b/app/Controller/TaskDuplicationController.php index 6f81b25a9..6ebb6d592 100644 --- a/app/Controller/TaskDuplicationController.php +++ b/app/Controller/TaskDuplicationController.php @@ -25,10 +25,10 @@ class TaskDuplicationController extends BaseController if ($task_id > 0) { $this->flash->success(t('Task created successfully.')); - return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task_id))); + return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task_id))); } else { $this->flash->failure(t('Unable to create this task.')); - return $this->response->redirect($this->helper->url->to('TaskDuplicationController', 'duplicate', array('project_id' => $task['project_id'], 'task_id' => $task['id'])), true); + return $this->response->redirect($this->helper->url->to('TaskDuplicationController', 'duplicate', array('task_id' => $task['id'])), true); } } @@ -57,7 +57,7 @@ class TaskDuplicationController extends BaseController $values['category_id'], $values['owner_id'])) { $this->flash->success(t('Task updated successfully.')); - return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $values['project_id'], 'task_id' => $task['id']))); + return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id']))); } $this->flash->failure(t('Unable to update your task.')); diff --git a/app/Controller/TaskExternalLinkController.php b/app/Controller/TaskExternalLinkController.php index 946451fcb..02cf472d3 100644 --- a/app/Controller/TaskExternalLinkController.php +++ b/app/Controller/TaskExternalLinkController.php @@ -85,7 +85,7 @@ class TaskExternalLinkController extends BaseController $this->flash->success(t('Unable to create your link.')); } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])), true); } else { $provider = $this->externalLinkManager->getProvider($values['link_type']); $this->response->html($this->template->render('task_external_link/create', array( @@ -140,7 +140,7 @@ class TaskExternalLinkController extends BaseController if ($valid && $this->taskExternalLinkModel->update($values)) { $this->flash->success(t('Link updated successfully.')); - return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true); + return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])), true); } return $this->edit($values, $errors); @@ -179,6 +179,6 @@ class TaskExternalLinkController extends BaseController $this->flash->failure(t('Unable to remove this link.')); } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id']))); } } diff --git a/app/Controller/TaskFileController.php b/app/Controller/TaskFileController.php index 4c489238c..b3192b3a7 100644 --- a/app/Controller/TaskFileController.php +++ b/app/Controller/TaskFileController.php @@ -21,7 +21,7 @@ class TaskFileController extends BaseController if ($this->request->isPost() && $this->taskFileModel->uploadScreenshot($task['id'], $this->request->getValue('screenshot')) !== false) { $this->flash->success(t('Screenshot uploaded successfully.')); - return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true); + return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])), true); } return $this->response->html($this->template->render('task_file/screenshot', array( @@ -66,7 +66,7 @@ class TaskFileController extends BaseController $this->flash->failure(t('Unable to upload files, check the permissions of your data folder.')); } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])), true); } } @@ -87,7 +87,7 @@ class TaskFileController extends BaseController $this->flash->failure(t('Unable to remove this file.')); } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id']))); } /** diff --git a/app/Controller/TaskInternalLinkController.php b/app/Controller/TaskInternalLinkController.php index 02cc15c4d..7ab01374a 100644 --- a/app/Controller/TaskInternalLinkController.php +++ b/app/Controller/TaskInternalLinkController.php @@ -65,7 +65,7 @@ class TaskInternalLinkController extends BaseController )); } - return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true); + return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])), true); } $errors = array('title' => array(t('The exact same link already exists'))); @@ -123,7 +123,7 @@ class TaskInternalLinkController extends BaseController if ($valid) { if ($this->taskLinkModel->update($values['id'], $values['task_id'], $values['opposite_task_id'], $values['link_id'])) { $this->flash->success(t('Link updated successfully.')); - return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links'); + return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])).'#links'); } $this->flash->failure(t('Unable to update your link.')); @@ -165,6 +165,6 @@ class TaskInternalLinkController extends BaseController $this->flash->failure(t('Unable to remove this link.')); } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id']))); } } diff --git a/app/Controller/TaskMailController.php b/app/Controller/TaskMailController.php index 9e753af1d..5197f4fad 100644 --- a/app/Controller/TaskMailController.php +++ b/app/Controller/TaskMailController.php @@ -12,15 +12,13 @@ class TaskMailController extends BaseController { public function create(array $values = array(), array $errors = array()) { - $project = $this->getProject(); $task = $this->getTask(); $this->response->html($this->helper->layout->task('task_mail/create', array( 'values' => $values, 'errors' => $errors, 'task' => $task, - 'project' => $project, - 'members' => $this->projectPermissionModel->getMembersWithEmail($project['id']), + 'members' => $this->projectPermissionModel->getMembersWithEmail($task['project_id']), ))); } @@ -41,7 +39,7 @@ class TaskMailController extends BaseController 'task_id' => $task['id'], )); - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), 'comments'), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id']), 'comments'), true); } else { $this->create($values, $errors); } diff --git a/app/Controller/TaskModificationController.php b/app/Controller/TaskModificationController.php index b2b94c3d5..3e6f5d178 100644 --- a/app/Controller/TaskModificationController.php +++ b/app/Controller/TaskModificationController.php @@ -23,7 +23,7 @@ class TaskModificationController extends BaseController if (! $this->helper->projectRole->canUpdateTask($task)) { throw new AccessForbiddenException(t('You are not allowed to update tasks assigned to someone else.')); } - + if (! $this->helper->projectRole->canChangeAssignee($task)) { throw new AccessForbiddenException(t('You are not allowed to change the assignee.')); } @@ -67,7 +67,7 @@ class TaskModificationController extends BaseController $this->response->redirect($this->helper->url->to('DashboardController', 'tasks', ['user_id' => $this->userSession->getId()])); break; default: - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', ['project_id' => $task['project_id'], 'task_id' => $task['id']])); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', ['task_id' => $task['id']])); } } @@ -146,7 +146,7 @@ class TaskModificationController extends BaseController if ($valid && $this->updateTask($task, $values, $errors)) { $this->flash->success(t('Task updated successfully.')); - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])), true); } else { $this->flash->failure(t('Unable to update your task.')); $this->edit($values, $errors); diff --git a/app/Controller/TaskMovePositionController.php b/app/Controller/TaskMovePositionController.php index 802eadeda..f630641a0 100644 --- a/app/Controller/TaskMovePositionController.php +++ b/app/Controller/TaskMovePositionController.php @@ -47,6 +47,6 @@ class TaskMovePositionController extends BaseController $values['swimlane_id'] ); - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id']))); } } diff --git a/app/Controller/TaskRecurrenceController.php b/app/Controller/TaskRecurrenceController.php index 7f14cb534..cd23ea3f5 100644 --- a/app/Controller/TaskRecurrenceController.php +++ b/app/Controller/TaskRecurrenceController.php @@ -58,7 +58,7 @@ class TaskRecurrenceController extends BaseController $this->flash->failure(t('Unable to update your task.')); } - return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])), true); + return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])), true); } return $this->edit($values, $errors); diff --git a/app/Controller/TaskStatusController.php b/app/Controller/TaskStatusController.php index 56d38400d..5dbd07ec7 100644 --- a/app/Controller/TaskStatusController.php +++ b/app/Controller/TaskStatusController.php @@ -52,7 +52,7 @@ class TaskStatusController extends BaseController $this->flash->failure($failure_message); } - $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'])), true); } else { $this->response->html($this->template->render($template, array( 'task' => $task, diff --git a/app/Controller/TaskViewController.php b/app/Controller/TaskViewController.php index 05c59bc9b..4e348aa2c 100644 --- a/app/Controller/TaskViewController.php +++ b/app/Controller/TaskViewController.php @@ -107,7 +107,7 @@ class TaskViewController extends BaseController $task = $this->getTask(); $subtask_paginator = $this->paginator - ->setUrl('TaskViewController', 'timetracking', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'pagination' => 'subtasks')) + ->setUrl('TaskViewController', 'timetracking', array('task_id' => $task['id'], 'pagination' => 'subtasks')) ->setMax(15) ->setOrder('start') ->setDirection('DESC') diff --git a/app/Formatter/SubtaskTimeTrackingCalendarFormatter.php b/app/Formatter/SubtaskTimeTrackingCalendarFormatter.php index b7b81d87c..034617262 100644 --- a/app/Formatter/SubtaskTimeTrackingCalendarFormatter.php +++ b/app/Formatter/SubtaskTimeTrackingCalendarFormatter.php @@ -28,7 +28,7 @@ class SubtaskTimeTrackingCalendarFormatter extends BaseFormatter implements Form 'backgroundColor' => $this->colorModel->getBackgroundColor($row['color_id']), 'borderColor' => $this->colorModel->getBorderColor($row['color_id']), 'textColor' => 'black', - 'url' => $this->helper->url->to('TaskViewController', 'show', array('task_id' => $row['task_id'], 'project_id' => $row['project_id'])), + 'url' => $this->helper->url->to('TaskViewController', 'show', array('task_id' => $row['task_id'])), 'editable' => false, ); } diff --git a/app/Formatter/TaskApiFormatter.php b/app/Formatter/TaskApiFormatter.php index 60840bebe..f2e25d087 100644 --- a/app/Formatter/TaskApiFormatter.php +++ b/app/Formatter/TaskApiFormatter.php @@ -28,7 +28,7 @@ class TaskApiFormatter extends BaseFormatter implements FormatterInterface public function format() { if (! empty($this->task)) { - $this->task['url'] = $this->helper->url->to('TaskViewController', 'show', array('task_id' => $this->task['id'], 'project_id' => $this->task['project_id']), '', true); + $this->task['url'] = $this->helper->url->to('TaskViewController', 'show', array('task_id' => $this->task['id']), '', true); $this->task['color'] = $this->colorModel->getColorProperties($this->task['color_id']); } diff --git a/app/Formatter/TaskICalFormatter.php b/app/Formatter/TaskICalFormatter.php index 387074e51..abe595fdd 100644 --- a/app/Formatter/TaskICalFormatter.php +++ b/app/Formatter/TaskICalFormatter.php @@ -128,7 +128,7 @@ class TaskICalFormatter extends BaseFormatter implements FormatterInterface $vEvent->setSummary(t('#%d', $task['id']).' '.$task['title']); $vEvent->setDescription($task['description']); $vEvent->setDescriptionHTML($this->helper->text->markdown($task['description'])); - $vEvent->setUrl($this->helper->url->base().$this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); + $vEvent->setUrl($this->helper->url->base().$this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id']))); if (! empty($task['owner_id'])) { $attendees = new Attendees; diff --git a/app/Helper/SubtaskHelper.php b/app/Helper/SubtaskHelper.php index c1c92aa0d..aa3a47655 100644 --- a/app/Helper/SubtaskHelper.php +++ b/app/Helper/SubtaskHelper.php @@ -82,10 +82,10 @@ class SubtaskHelper extends Base $html = ''; if ($subtask['is_timer_started']) { - $html .= $this->helper->url->icon('pause', t('Stop timer'), 'SubtaskStatusController', 'timer', array('timer' => 'stop', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']), false, 'js-subtask-toggle-timer'); + $html .= $this->helper->url->icon('pause', t('Stop timer'), 'SubtaskStatusController', 'timer', array('timer' => 'stop', 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']), false, 'js-subtask-toggle-timer'); $html .= ' (' . $this->helper->dt->age($subtask['timer_start_date']) .')'; } else { - $html .= $this->helper->url->icon('play-circle-o', t('Start timer'), 'SubtaskStatusController', 'timer', array('timer' => 'start', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']), false, 'js-subtask-toggle-timer'); + $html .= $this->helper->url->icon('play-circle-o', t('Start timer'), 'SubtaskStatusController', 'timer', array('timer' => 'start', 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']), false, 'js-subtask-toggle-timer'); } $html .= ''; diff --git a/app/ServiceProvider/RouteProvider.php b/app/ServiceProvider/RouteProvider.php index 669421880..88e5c2d3d 100644 --- a/app/ServiceProvider/RouteProvider.php +++ b/app/ServiceProvider/RouteProvider.php @@ -89,14 +89,14 @@ class RouteProvider implements ServiceProviderInterface $container['route']->addRoute('project/:project_id/import', 'TaskImportController', 'show'); // Task routes - $container['route']->addRoute('project/:project_id/task/:task_id', 'TaskViewController', 'show'); + $container['route']->addRoute('task/:task_id', 'TaskViewController', 'show'); $container['route']->addRoute('t/:task_id', 'TaskViewController', 'show'); $container['route']->addRoute('public/task/:task_id/:token', 'TaskViewController', 'readonly'); - $container['route']->addRoute('project/:project_id/task/:task_id/activity', 'ActivityController', 'task'); - $container['route']->addRoute('project/:project_id/task/:task_id/transitions', 'TaskViewController', 'transitions'); - $container['route']->addRoute('project/:project_id/task/:task_id/analytics', 'TaskViewController', 'analytics'); - $container['route']->addRoute('project/:project_id/task/:task_id/time-tracking', 'TaskViewController', 'timetracking'); + $container['route']->addRoute('task/:task_id/activity', 'ActivityController', 'task'); + $container['route']->addRoute('task/:task_id/transitions', 'TaskViewController', 'transitions'); + $container['route']->addRoute('task/:task_id/analytics', 'TaskViewController', 'analytics'); + $container['route']->addRoute('task/:task_id/time-tracking', 'TaskViewController', 'timetracking'); // Exports $container['route']->addRoute('export/tasks/:project_id', 'ExportController', 'tasks'); diff --git a/app/Template/analytic/time_comparison.php b/app/Template/analytic/time_comparison.php index 754c68f2f..bf2cd12df 100644 --- a/app/Template/analytic/time_comparison.php +++ b/app/Template/analytic/time_comparison.php @@ -36,10 +36,10 @@ getCollection() as $task): ?> - url->link('#'.$this->text->e($task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + url->link('#'.$this->text->e($task['id']), 'TaskViewController', 'show', array('task_id' => $task['id']), false, '', t('View this task')) ?> - url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id']), false, '', t('View this task')) ?> diff --git a/app/Template/board/task_avatar.php b/app/Template/board/task_avatar.php index 28e0813e9..14dd239ce 100644 --- a/app/Template/board/task_avatar.php +++ b/app/Template/board/task_avatar.php @@ -3,7 +3,7 @@ user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])): ?> class="task-board-assignee task-board-change-assignee" - data-url="url->href('TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"> + data-url="url->href('TaskModificationController', 'edit', array('task_id' => $task['id'])) ?>"> class="task-board-assignee"> diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php index 9982da423..2cdb3bd86 100644 --- a/app/Template/board/task_footer.php +++ b/app/Template/board/task_footer.php @@ -8,7 +8,7 @@ $this->text->e($task['category_name']), 'TaskModificationController', 'edit', - array('task_id' => $task['id'], 'project_id' => $task['project_id']), + array('task_id' => $task['id']), false, 'js-modal-large' . (! empty($task['category_description']) ? ' tooltip' : ''), t('Change category') @@ -79,27 +79,27 @@
- app->tooltipLink('', $this->url->href('BoardTooltipController', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> + app->tooltipLink('', $this->url->href('BoardTooltipController', 'recurrence', array('task_id' => $task['id']))) ?> - app->tooltipLink('', $this->url->href('BoardTooltipController', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> + app->tooltipLink('', $this->url->href('BoardTooltipController', 'recurrence', array('task_id' => $task['id']))) ?> - app->tooltipLink(''.$task['nb_links'], $this->url->href('BoardTooltipController', 'tasklinks', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> + app->tooltipLink(''.$task['nb_links'], $this->url->href('BoardTooltipController', 'tasklinks', array('task_id' => $task['id']))) ?> - app->tooltipLink(''.$task['nb_external_links'], $this->url->href('BoardTooltipController', 'externallinks', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> + app->tooltipLink(''.$task['nb_external_links'], $this->url->href('BoardTooltipController', 'externallinks', array('task_id' => $task['id']))) ?> - app->tooltipLink(''.round($task['nb_completed_subtasks'] / $task['nb_subtasks'] * 100, 0).'%', $this->url->href('BoardTooltipController', 'subtasks', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> + app->tooltipLink(''.round($task['nb_completed_subtasks'] / $task['nb_subtasks'] * 100, 0).'%', $this->url->href('BoardTooltipController', 'subtasks', array('task_id' => $task['id']))) ?> - app->tooltipLink(''.$task['nb_files'], $this->url->href('BoardTooltipController', 'attachments', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> + app->tooltipLink(''.$task['nb_files'], $this->url->href('BoardTooltipController', 'attachments', array('task_id' => $task['id']))) ?> 0): ?> @@ -112,14 +112,14 @@ $task['nb_comments'], 'CommentListController', 'show', - array('task_id' => $task['id'], 'project_id' => $task['project_id']), + array('task_id' => $task['id']), $task['nb_comments'] == 1 ? t('%d comment', $task['nb_comments']) : t('%d comments', $task['nb_comments']) ) ?> - app->tooltipLink('', $this->url->href('BoardTooltipController', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> + app->tooltipLink('', $this->url->href('BoardTooltipController', 'description', array('task_id' => $task['id']))) ?> diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index c4e1c0234..276a407c6 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -10,7 +10,7 @@ data-owner-id="" data-category-id="" data-due-date="" - data-task-url="url->href('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"> + data-task-url="url->href('TaskViewController', 'show', array('task_id' => $task['id'])) ?>"> @@ -20,7 +20,7 @@ user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])): ?> render('task/dropdown', array('task' => $task, 'redirect' => 'board')) ?> projectRole->canUpdateTask($task)): ?> - modal->large('edit', '', 'TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->large('edit', '', 'TaskModificationController', 'edit', array('task_id' => $task['id'])) ?> @@ -31,7 +31,7 @@ text->e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?> - - url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', $this->text->e($task['title'])) ?> + url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id']), false, '', $this->text->e($task['title'])) ?>
@@ -40,7 +40,7 @@ user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])): ?> render('task/dropdown', array('task' => $task, 'redirect' => 'board')) ?> projectRole->canUpdateTask($task)): ?> - modal->large('edit', '', 'TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->large('edit', '', 'TaskModificationController', 'edit', array('task_id' => $task['id'])) ?> @@ -57,7 +57,7 @@ hook->render('template:board:private:task:before-title', array('task' => $task)) ?>
- url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ?>
hook->render('template:board:private:task:after-title', array('task' => $task)) ?> diff --git a/app/Template/board/tooltip_files.php b/app/Template/board/tooltip_files.php index 5cd9b0043..5bf58ef18 100644 --- a/app/Template/board/tooltip_files.php +++ b/app/Template/board/tooltip_files.php @@ -9,13 +9,13 @@ - url->icon('download', t('Download'), 'FileViewerController', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + url->icon('download', t('Download'), 'FileViewerController', 'download', array('task_id' => $task['id'], 'file_id' => $file['id'])) ?> file->getPreviewType($file['name']) !== null || $file['is_image'] == 1): ?> -  modal->large('eye', t('View file'), 'FileViewerController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> -  url->icon('external-link', t('View file'), 'FileViewerController', ($file['is_image'] == 1 ? 'image' : 'show'), array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, '', '', true) ?> +  modal->large('eye', t('View file'), 'FileViewerController', 'show', array('task_id' => $task['id'], 'file_id' => $file['id'])) ?> +  url->icon('external-link', t('View file'), 'FileViewerController', ($file['is_image'] == 1 ? 'image' : 'show'), array('task_id' => $task['id'], 'file_id' => $file['id']), false, '', '', true) ?> file->getBrowserViewType($file['name']) !== null): ?> - url->link(t('View file'), 'FileViewerController', 'browser', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, '', '', true) ?> + url->link(t('View file'), 'FileViewerController', 'browser', array('task_id' => $task['id'], 'file_id' => $file['id']), false, '', '', true) ?> diff --git a/app/Template/comment/create.php b/app/Template/comment/create.php index 95269c762..812d6de0b 100644 --- a/app/Template/comment/create.php +++ b/app/Template/comment/create.php @@ -2,11 +2,11 @@

  • - modal->medium('paper-plane', t('Send by email'), 'CommentMailController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->medium('paper-plane', t('Send by email'), 'CommentMailController', 'create', array('task_id' => $task['id'])) ?>
-
+ form->csrf() ?> form->textEditor('comment', $values, $errors, array('autofocus' => true, 'required' => true, 'aria-label' => t('New comment'))) ?> diff --git a/app/Template/comment/edit.php b/app/Template/comment/edit.php index fc91dcc77..d2e073e4c 100644 --- a/app/Template/comment/edit.php +++ b/app/Template/comment/edit.php @@ -2,7 +2,7 @@

- + form->csrf() ?> form->textEditor('comment', $values, $errors, array('autofocus' => true, 'required' => true, 'aria-label' => t('Comment'))) ?> diff --git a/app/Template/comment/remove.php b/app/Template/comment/remove.php index 03f16e00d..14ab47887 100644 --- a/app/Template/comment/remove.php +++ b/app/Template/comment/remove.php @@ -16,6 +16,6 @@ modal->confirmButtons( 'CommentController', 'remove', - array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']) + array('task_id' => $task['id'], 'comment_id' => $comment['id']) ) ?> diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php index 5f15ffd68..56a99eb18 100644 --- a/app/Template/comment/show.php +++ b/app/Template/comment/show.php @@ -17,14 +17,14 @@
  • - url->icon('link', t('Link'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', '', $this->app->isAjax(), 'comment-'.$comment['id']) ?> + url->icon('link', t('Link'), 'TaskViewController', 'show', array('task_id' => $task['id']), false, '', '', $this->app->isAjax(), 'comment-'.$comment['id']) ?>
  • user->isAdmin() || $this->user->isCurrentUser($comment['user_id']))): ?>
  • - modal->medium('edit', t('Edit'), 'CommentController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?> + modal->medium('edit', t('Edit'), 'CommentController', 'edit', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>
  • - modal->confirm('trash-o', t('Remove'), 'CommentController', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?> + modal->confirm('trash-o', t('Remove'), 'CommentController', 'confirm', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>
diff --git a/app/Template/comment_list/create.php b/app/Template/comment_list/create.php index 213b8ca99..a816ebc64 100644 --- a/app/Template/comment_list/create.php +++ b/app/Template/comment_list/create.php @@ -1,7 +1,7 @@ - + form->csrf() ?> form->textEditor('comment', array('project_id' => $task['project_id']), array(), array('required' => true, 'aria-label' => t('New comment'))) ?> modal->submitButtons() ?> diff --git a/app/Template/comment_list/show.php b/app/Template/comment_list/show.php index 4b6b765db..5ebd7526c 100644 --- a/app/Template/comment_list/show.php +++ b/app/Template/comment_list/show.php @@ -3,11 +3,11 @@
  • - url->icon('sort', t('Change sorting'), 'CommentListController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'js-modal-replace') ?> + url->icon('sort', t('Change sorting'), 'CommentListController', 'toggleSorting', array('task_id' => $task['id']), false, 'js-modal-replace') ?>
  • - modal->medium('paper-plane', t('Send by email'), 'CommentMailController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->medium('paper-plane', t('Send by email'), 'CommentMailController', 'create', array('task_id' => $task['id'])) ?>
diff --git a/app/Template/comment_mail/create.php b/app/Template/comment_mail/create.php index 8d5ceab7b..e58b04fe2 100644 --- a/app/Template/comment_mail/create.php +++ b/app/Template/comment_mail/create.php @@ -1,7 +1,7 @@ - + form->csrf() ?> form->hidden('task_id', $values) ?> form->hidden('user_id', $values) ?> diff --git a/app/Template/event/comment_create.php b/app/Template/event/comment_create.php index 780bba938..de3f22636 100644 --- a/app/Template/event/comment_create.php +++ b/app/Template/event/comment_create.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/comment_delete.php b/app/Template/event/comment_delete.php index e3a2f9fad..13ef37de8 100644 --- a/app/Template/event/comment_delete.php +++ b/app/Template/event/comment_delete.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/comment_update.php b/app/Template/event/comment_update.php index 9e25ec2df..0d911fd14 100644 --- a/app/Template/event/comment_update.php +++ b/app/Template/event/comment_update.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/subtask_create.php b/app/Template/event/subtask_create.php index 9a115c737..5f3c76b79 100644 --- a/app/Template/event/subtask_create.php +++ b/app/Template/event/subtask_create.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/subtask_delete.php b/app/Template/event/subtask_delete.php index 7f0d6d589..b1e487fdb 100644 --- a/app/Template/event/subtask_delete.php +++ b/app/Template/event/subtask_delete.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/subtask_update.php b/app/Template/event/subtask_update.php index e566022e2..3bb078a08 100644 --- a/app/Template/event/subtask_update.php +++ b/app/Template/event/subtask_update.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/task_assignee_change.php b/app/Template/event/task_assignee_change.php index 405f8ac1e..f57ab639a 100644 --- a/app/Template/event/task_assignee_change.php +++ b/app/Template/event/task_assignee_change.php @@ -4,11 +4,11 @@ text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])), $this->text->e($assignee) ) ?> - text->e($author), $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> + text->e($author), $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id']))) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/task_close.php b/app/Template/event/task_close.php index 1ac81ea9b..aefd3a775 100644 --- a/app/Template/event/task_close.php +++ b/app/Template/event/task_close.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/task_create.php b/app/Template/event/task_create.php index 9d0ff3586..89865cc6a 100644 --- a/app/Template/event/task_create.php +++ b/app/Template/event/task_create.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/task_file_create.php b/app/Template/event/task_file_create.php index 7e58fdc18..b197d3ce7 100644 --- a/app/Template/event/task_file_create.php +++ b/app/Template/event/task_file_create.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/task_file_destroy.php b/app/Template/event/task_file_destroy.php index cb21c42ac..882c51bc1 100755 --- a/app/Template/event/task_file_destroy.php +++ b/app/Template/event/task_file_destroy.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/task_internal_link_create_update.php b/app/Template/event/task_internal_link_create_update.php index 5a9144aca..303103321 100644 --- a/app/Template/event/task_internal_link_create_update.php +++ b/app/Template/event/task_internal_link_create_update.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/task_internal_link_delete.php b/app/Template/event/task_internal_link_delete.php index c60d17e34..54194caa5 100644 --- a/app/Template/event/task_internal_link_delete.php +++ b/app/Template/event/task_internal_link_delete.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/task_move_column.php b/app/Template/event/task_move_column.php index e7e5ec284..23f0af7f6 100644 --- a/app/Template/event/task_move_column.php +++ b/app/Template/event/task_move_column.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])), $this->text->e($task['column_title']) ) ?> dt->datetime($date_creation) ?> diff --git a/app/Template/event/task_move_position.php b/app/Template/event/task_move_position.php index 48fbbb1e6..5dedbf67a 100644 --- a/app/Template/event/task_move_position.php +++ b/app/Template/event/task_move_position.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])), $task['position'], $this->text->e($task['column_title']) ) ?> diff --git a/app/Template/event/task_move_swimlane.php b/app/Template/event/task_move_swimlane.php index a467875b5..2190cf333 100644 --- a/app/Template/event/task_move_swimlane.php +++ b/app/Template/event/task_move_swimlane.php @@ -2,12 +2,12 @@ text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])), $this->text->e($task['swimlane_name']) ) ?> diff --git a/app/Template/event/task_open.php b/app/Template/event/task_open.php index 6d5252a1b..eee795d8c 100644 --- a/app/Template/event/task_open.php +++ b/app/Template/event/task_open.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/event/task_update.php b/app/Template/event/task_update.php index 2608f6236..88c90971e 100644 --- a/app/Template/event/task_update.php +++ b/app/Template/event/task_update.php @@ -1,7 +1,7 @@

text->e($author), - $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + $this->url->link(t('#%d', $task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ) ?> dt->datetime($date_creation) ?>

diff --git a/app/Template/notification/footer.php b/app/Template/notification/footer.php index 663a591a3..6888d50b2 100644 --- a/app/Template/notification/footer.php +++ b/app/Template/notification/footer.php @@ -3,7 +3,7 @@ Kanboard app->config('application_url') != ''): ?> - - url->absoluteLink(t('view the task on Kanboard'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + - url->absoluteLink(t('view the task on Kanboard'), 'TaskViewController', 'show', array('task_id' => $task['id'])) ?> - url->absoluteLink(t('view the board on Kanboard'), 'BoardViewController', 'show', array('project_id' => $task['project_id'])) ?> diff --git a/app/Template/notification/task_overdue.php b/app/Template/notification/task_overdue.php index 88140af03..8da0d6208 100644 --- a/app/Template/notification/task_overdue.php +++ b/app/Template/notification/task_overdue.php @@ -16,7 +16,7 @@ # app->config('application_url') !== ''): ?> - url->absoluteLink($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->absoluteLink($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'])) ?> text->e($task['title']) ?> diff --git a/app/Template/project_user_overview/tasks.php b/app/Template/project_user_overview/tasks.php index 1e01a43f8..6f7513458 100644 --- a/app/Template/project_user_overview/tasks.php +++ b/app/Template/project_user_overview/tasks.php @@ -14,7 +14,7 @@ getCollection() as $task): ?> - url->link('#'.$this->text->e($task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + url->link('#'.$this->text->e($task['id']), 'TaskViewController', 'show', array('task_id' => $task['id']), false, '', t('View this task')) ?> url->link($this->text->e($task['project_name']), 'BoardViewController', 'show', array('project_id' => $task['project_id'])) ?> @@ -23,7 +23,7 @@ text->e($task['column_name']) ?> - url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id']), false, '', t('View this task')) ?> diff --git a/app/Template/subtask/create.php b/app/Template/subtask/create.php index 1ed36d474..6919347f2 100644 --- a/app/Template/subtask/create.php +++ b/app/Template/subtask/create.php @@ -12,7 +12,7 @@

- + form->csrf() ?> subtask->renderBulkTitleField($values, $errors, array('autofocus')) ?> @@ -20,7 +20,7 @@ subtask->renderTimeEstimatedField($values, $errors) ?> hook->render('template:subtask:form:create', array('values' => $values, 'errors' => $errors)) ?> - + form->checkbox('another_subtask', t('Create another sub-task'), 1, isset($values['another_subtask']) && $values['another_subtask'] == 1) ?> modal->submitButtons() ?> diff --git a/app/Template/subtask/edit.php b/app/Template/subtask/edit.php index aed57e957..90aaca89a 100644 --- a/app/Template/subtask/edit.php +++ b/app/Template/subtask/edit.php @@ -2,7 +2,7 @@

- + form->csrf() ?> subtask->renderTitleField($values, $errors, array('autofocus')) ?> diff --git a/app/Template/subtask/menu.php b/app/Template/subtask/menu.php index 9ac8fc427..f62e6f23e 100644 --- a/app/Template/subtask/menu.php +++ b/app/Template/subtask/menu.php @@ -2,13 +2,13 @@
  • - modal->medium('edit', t('Edit'), 'SubtaskController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?> + modal->medium('edit', t('Edit'), 'SubtaskController', 'edit', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?>
  • - modal->confirm('trash-o', t('Remove'), 'SubtaskController', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?> + modal->confirm('trash-o', t('Remove'), 'SubtaskController', 'confirm', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?>
  • - modal->confirm('clone', t('Convert to task'), 'SubtaskConverterController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?> + modal->confirm('clone', t('Convert to task'), 'SubtaskConverterController', 'show', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?>
diff --git a/app/Template/subtask/remove.php b/app/Template/subtask/remove.php index cf9bbc358..3db814ed4 100644 --- a/app/Template/subtask/remove.php +++ b/app/Template/subtask/remove.php @@ -15,6 +15,6 @@ modal->confirmButtons( 'SubtaskController', 'remove', - array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']) + array('task_id' => $task['id'], 'subtask_id' => $subtask['id']) ) ?> diff --git a/app/Template/subtask/table.php b/app/Template/subtask/table.php index b8b5c2d95..8b9e04061 100644 --- a/app/Template/subtask/table.php +++ b/app/Template/subtask/table.php @@ -1,7 +1,7 @@ diff --git a/app/Template/subtask_converter/show.php b/app/Template/subtask_converter/show.php index 9ecc70c89..12e1b1bb2 100644 --- a/app/Template/subtask_converter/show.php +++ b/app/Template/subtask_converter/show.php @@ -15,6 +15,6 @@ modal->confirmButtons( 'SubtaskConverterController', 'save', - array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']) + array('task_id' => $task['id'], 'subtask_id' => $subtask['id']) ) ?> diff --git a/app/Template/subtask_restriction/show.php b/app/Template/subtask_restriction/show.php index b6c56a129..710e7508b 100644 --- a/app/Template/subtask_restriction/show.php +++ b/app/Template/subtask_restriction/show.php @@ -1,7 +1,7 @@ - +form->csrf() ?> diff --git a/app/Template/task/details.php b/app/Template/task/details.php index f9b788a65..d659ef48a 100644 --- a/app/Template/task/details.php +++ b/app/Template/task/details.php @@ -86,7 +86,7 @@ user->getId()): ?> - - url->link(t('Assign to me'), 'TaskModificationController', 'assignToMe', ['task_id' => $task['id'], 'project_id' => $task['project_id'], 'csrf_token' => $this->app->getToken()->getReusableCSRFToken()]) ?> + - url->link(t('Assign to me'), 'TaskModificationController', 'assignToMe', ['task_id' => $task['id'], 'csrf_token' => $this->app->getToken()->getReusableCSRFToken()]) ?> @@ -124,7 +124,7 @@ dt->datetime($task['date_started']) ?> - url->link(t('Start now'), 'TaskModificationController', 'start', ['task_id' => $task['id'], 'project_id' => $task['project_id'], 'csrf_token' => $this->app->getToken()->getReusableCSRFToken()]) ?> + url->link(t('Start now'), 'TaskModificationController', 'start', ['task_id' => $task['id'], 'csrf_token' => $this->app->getToken()->getReusableCSRFToken()]) ?>
  • @@ -165,7 +165,7 @@ app->component('external-task-view', array( - 'url' => $this->url->href('ExternalTaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])), + 'url' => $this->url->href('ExternalTaskViewController', 'show', array('task_id' => $task['id'])), )) ?> diff --git a/app/Template/task/dropdown.php b/app/Template/task/dropdown.php index bf170a48f..e73637bc8 100644 --- a/app/Template/task/dropdown.php +++ b/app/Template/task/dropdown.php @@ -6,46 +6,46 @@ projectRole->canUpdateTask($task)): ?> projectRole->canChangeAssignee($task) && array_key_exists('owner_id', $task) && $task['owner_id'] != $this->user->getId()): ?>
  • - url->icon('hand-o-right', t('Assign to me'), 'TaskModificationController', 'assignToMe', ['task_id' => $task['id'], 'project_id' => $task['project_id'], 'csrf_token' => $this->app->getToken()->getReusableCSRFToken(), 'redirect' => isset($redirect) ? $redirect : '']) ?> + url->icon('hand-o-right', t('Assign to me'), 'TaskModificationController', 'assignToMe', ['task_id' => $task['id'], 'csrf_token' => $this->app->getToken()->getReusableCSRFToken(), 'redirect' => isset($redirect) ? $redirect : '']) ?>
  • - url->icon('play', t('Set the start date automatically'), 'TaskModificationController', 'start', ['task_id' => $task['id'], 'project_id' => $task['project_id'], 'csrf_token' => $this->app->getToken()->getReusableCSRFToken(), 'redirect' => isset($redirect) ? $redirect : '']) ?> + url->icon('play', t('Set the start date automatically'), 'TaskModificationController', 'start', ['task_id' => $task['id'], 'csrf_token' => $this->app->getToken()->getReusableCSRFToken(), 'redirect' => isset($redirect) ? $redirect : '']) ?>
  • - modal->large('edit', t('Edit the task'), 'TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->large('edit', t('Edit the task'), 'TaskModificationController', 'edit', array('task_id' => $task['id'])) ?>
  • - modal->medium('plus', t('Add a sub-task'), 'SubtaskController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->medium('plus', t('Add a sub-task'), 'SubtaskController', 'create', array('task_id' => $task['id'])) ?>
  • hook->render('template:task:dropdown:after-basic-actions', array('task' => $task)) ?>
  • - modal->medium('code-fork', t('Add internal link'), 'TaskInternalLinkController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->medium('code-fork', t('Add internal link'), 'TaskInternalLinkController', 'create', array('task_id' => $task['id'])) ?>
  • - modal->medium('external-link', t('Add external link'), 'TaskExternalLinkController', 'find', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->medium('external-link', t('Add external link'), 'TaskExternalLinkController', 'find', array('task_id' => $task['id'])) ?>
  • hook->render('template:task:dropdown:after-add-links', array('task' => $task)) ?>
  • - modal->small('comment-o', t('Add a comment'), 'CommentController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->small('comment-o', t('Add a comment'), 'CommentController', 'create', array('task_id' => $task['id'])) ?>
  • hook->render('template:task:dropdown:after-add-comment', array('task' => $task)) ?>
  • - modal->medium('file', t('Attach a document'), 'TaskFileController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->medium('file', t('Attach a document'), 'TaskFileController', 'create', array('task_id' => $task['id'])) ?>
  • - modal->medium('camera', t('Add a screenshot'), 'TaskPopoverController', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->medium('camera', t('Add a screenshot'), 'TaskPopoverController', 'screenshot', array('task_id' => $task['id'])) ?>
  • hook->render('template:task:dropdown:after-add-attachments', array('task' => $task)) ?>
  • - modal->small('files-o', t('Duplicate'), 'TaskDuplicationController', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->small('files-o', t('Duplicate'), 'TaskDuplicationController', 'duplicate', array('task_id' => $task['id'])) ?>
  • modal->small('clipboard', t('Duplicate to project'), 'TaskDuplicationController', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> @@ -56,21 +56,21 @@ modal->small('clone', t('Move to project'), 'TaskDuplicationController', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
  • - modal->small('paper-plane', t('Send by email'), 'TaskMailController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->small('paper-plane', t('Send by email'), 'TaskMailController', 'create', array('task_id' => $task['id'])) ?>
  • hook->render('template:task:dropdown:after-send-mail', array('task' => $task)) ?> projectRole->canRemoveTask($task)): ?>
  • - modal->confirm('trash-o', t('Remove'), 'TaskSuppressionController', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->confirm('trash-o', t('Remove'), 'TaskSuppressionController', 'confirm', array('task_id' => $task['id'])) ?>
  • projectRole->canChangeTaskStatusInColumn($task['project_id'], $task['column_id'])): ?>
  • - modal->confirm('times', t('Close this task'), 'TaskStatusController', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->confirm('times', t('Close this task'), 'TaskStatusController', 'close', array('task_id' => $task['id'])) ?> - modal->confirm('check-square-o', t('Open this task'), 'TaskStatusController', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + modal->confirm('check-square-o', t('Open this task'), 'TaskStatusController', 'open', array('task_id' => $task['id'])) ?>
  • diff --git a/app/Template/task/layout.php b/app/Template/task/layout.php index 7f6c29139..19f7791e8 100644 --- a/app/Template/task/layout.php +++ b/app/Template/task/layout.php @@ -3,10 +3,10 @@ hook->render('template:task:layout:top', array('task' => $task)) ?> getCollection() as $record): ?> - - + +
    url->link($this->text->e($record['task_title']), 'TaskViewController', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?>url->link($this->text->e($record['subtask_title']), 'TaskViewController', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?>url->link($this->text->e($record['task_title']), 'TaskViewController', 'show', array('task_id' => $record['task_id'])) ?>url->link($this->text->e($record['subtask_title']), 'TaskViewController', 'show', array('task_id' => $record['task_id'])) ?> dt->datetime($record['start']) ?> dt->datetime($record['end']) ?>