mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
final touches to controller
This commit is contained in:
parent
ef84576903
commit
9c428f989c
@ -113,51 +113,32 @@ class ReassignAccompanyingPeriodController extends AbstractController
|
|||||||
|
|
||||||
$assignForm->handleRequest($request);
|
$assignForm->handleRequest($request);
|
||||||
|
|
||||||
$userFromId = null !== $userFrom ? $userFrom->getId() : null;
|
|
||||||
dump($userFrom);
|
|
||||||
if ($assignForm->isSubmitted()) {
|
if ($assignForm->isSubmitted()) {
|
||||||
dump(' assign submitted');
|
|
||||||
|
|
||||||
|
|
||||||
if ($assignForm->isSubmitted()) {
|
if ($assignForm->isSubmitted()) {
|
||||||
dump('reassign');
|
|
||||||
|
|
||||||
$assignPeriodIds = json_decode($assignForm->get('periods')->getData(), true);
|
$assignPeriodIds = json_decode($assignForm->get('periods')->getData(), true);
|
||||||
$userTo = $assignForm->get('userTo')->getData();
|
$userTo = $assignForm->get('userTo')->getData();
|
||||||
$userFrom = $assignForm->get('userFrom')->getData();
|
$userFrom = $assignForm->get('userFrom')->getData();
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
dump($assignPeriodIds);
|
|
||||||
foreach($assignPeriodIds as $periodId) {
|
foreach($assignPeriodIds as $periodId) {
|
||||||
$period = $this->courseRepository->find($periodId);
|
$period = $this->courseRepository->find($periodId);
|
||||||
|
|
||||||
if ($userFrom === $period->getUser()) {
|
if ($userFrom === $period->getUser()) {
|
||||||
$period->setUser($userTo);
|
$period->setUser($userTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($i === 10) {
|
|
||||||
// dd($i);
|
|
||||||
}
|
|
||||||
|
|
||||||
dump($period);
|
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
||||||
// redirect to the first page
|
// redirect to the first page
|
||||||
|
return $this->redirectToRoute('chill_course_list_reassign', [
|
||||||
|
'form' => ['user' => $userFrom->getId()],
|
||||||
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
dump('no assign form');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return new Response(
|
return new Response(
|
||||||
$this->engine->render('@ChillPerson/AccompanyingPeriod/reassign_list.html.twig', [
|
$this->engine->render('@ChillPerson/AccompanyingPeriod/reassign_list.html.twig', [
|
||||||
'paginator' => $paginator,
|
'paginator' => $paginator,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user