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

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