mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 02:23:51 +00:00
add list by person, user and scope + formatting of submit button in edit
This commit is contained in:
@@ -16,12 +16,12 @@ class TaskController extends Controller
|
||||
{
|
||||
/**
|
||||
* Apply a transition to a task
|
||||
*
|
||||
*
|
||||
* @Route(
|
||||
* "/{_locale}/task/transition/{kind}/{taskId}/{transition}",
|
||||
* name="chill_task_task_transition"
|
||||
* )
|
||||
*
|
||||
*
|
||||
* @param string $kind
|
||||
* @param int $taskId
|
||||
* @param string $transition
|
||||
@@ -32,7 +32,7 @@ class TaskController extends Controller
|
||||
* @return Response
|
||||
*/
|
||||
public function applyTransitionAction(
|
||||
$kind,
|
||||
$kind,
|
||||
$taskId,
|
||||
$transition,
|
||||
SingleTaskRepository $singleTaskRepository,
|
||||
@@ -51,32 +51,32 @@ class TaskController extends Controller
|
||||
);
|
||||
break;
|
||||
default:
|
||||
return new Response("The type '$kind' is not implemented",
|
||||
return new Response("The type '$kind' is not implemented",
|
||||
Response::HTTP_BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
||||
if (NULL === $task) {
|
||||
$this->createHttpNotFoundException("task with id '$taskId' and type "
|
||||
$this->createNotFoundException("task with id '$taskId' and type "
|
||||
. "'$type' does not exists");
|
||||
}
|
||||
|
||||
|
||||
// we simply check that the user can see the task. Other ACL checks
|
||||
// should be performed using `guard` events.
|
||||
$this->denyAccessUnlessGranted(TaskVoter::SHOW, $task);
|
||||
|
||||
|
||||
$workflow = $registry->get($task);
|
||||
|
||||
|
||||
if ($workflow->can($task, $transition)) {
|
||||
$workflow->apply($task, $transition);
|
||||
|
||||
|
||||
$em->flush();
|
||||
|
||||
|
||||
$this->addFlash('success', 'The transition is sucessfully appliyed');
|
||||
|
||||
} else {
|
||||
$this->addFlash('error', 'The transition could not be appliyed');
|
||||
}
|
||||
|
||||
|
||||
return $this->redirect($request->query->get('return_path', $defaultReturnPath));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user