mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 22:35:01 +00:00
controller tell which layout twig must serve
This commit is contained in:
@@ -430,26 +430,27 @@ class SingleTaskController extends AbstractController
|
||||
$viewParams['center'] = null;
|
||||
$params['types'] = null;
|
||||
|
||||
|
||||
// Get parameters from url
|
||||
if (!empty($request->query->get('person_id', NULL))) {
|
||||
$personId = $request->query->getInt('person_id');
|
||||
|
||||
$personId = $request->query->getInt('person_id', 0);
|
||||
$person = $personRepository->find($personId);
|
||||
|
||||
if ($person === null) {
|
||||
throw $this->createNotFoundException("This person ' $personId ' does not exist.");
|
||||
}
|
||||
|
||||
$this->denyAccessUnlessGranted(PersonVoter::SEE, $person);
|
||||
|
||||
$viewParams['person'] = $person;
|
||||
$params['person'] = $person;
|
||||
} elseif (!empty($request->query->get('center_id', NULL))) {
|
||||
}
|
||||
|
||||
if (!empty($request->query->get('center_id', NULL))) {
|
||||
$center = $centerRepository->find($request->query->getInt('center_id'));
|
||||
|
||||
if ($center === null) {
|
||||
throw $this->createNotFoundException('center not found');
|
||||
}
|
||||
|
||||
$params['center'] = $center;
|
||||
}
|
||||
|
||||
@@ -459,14 +460,13 @@ class SingleTaskController extends AbstractController
|
||||
$params['types'] = $types;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!empty($request->query->get('user_id', null))) {
|
||||
if ($request->query->get('user_id') === '_unassigned') {
|
||||
$params['unassigned'] = true;
|
||||
} else {
|
||||
$userId = $request->query->getInt('user_id', 0); // sf4 check:
|
||||
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
|
||||
|
||||
$userId = $request->query->getInt('user_id', 0);
|
||||
$user = $this->getDoctrine()->getManager()
|
||||
->getRepository('ChillMainBundle:User')
|
||||
->find($userId);
|
||||
@@ -482,8 +482,7 @@ class SingleTaskController extends AbstractController
|
||||
|
||||
if (!empty($request->query->get('scope_id'))) {
|
||||
|
||||
$scopeId = $request->query->getInt('scope_id', 0); // sf4 check:
|
||||
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
|
||||
$scopeId = $request->query->getInt('scope_id', 0);
|
||||
|
||||
$scope = $this->getDoctrine()->getManager()
|
||||
->getRepository('ChillMainBundle:Scope')
|
||||
|
Reference in New Issue
Block a user