Remove project_id from task URLs

This commit is contained in:
Tomas Dittmann
2022-02-05 05:59:33 +01:00
committed by GitHub
parent 2150ca73b9
commit 61e63ef9e0
97 changed files with 209 additions and 219 deletions

View File

@@ -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);