mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
corrections
This commit is contained in:
parent
1d9b8729ab
commit
59da93fd75
@ -11,8 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Controller;
|
namespace Chill\PersonBundle\Controller;
|
||||||
|
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
|
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument;
|
||||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodWorkVoter;
|
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodWorkVoter;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
@ -22,12 +20,7 @@ use Symfony\Component\Security\Core\Security;
|
|||||||
|
|
||||||
class AccompanyingCourseWorkEvaluationDocumentController extends AbstractController
|
class AccompanyingCourseWorkEvaluationDocumentController extends AbstractController
|
||||||
{
|
{
|
||||||
private Security $security;
|
public function __construct(Private Security $security) {}
|
||||||
|
|
||||||
public function __construct(Security $security)
|
|
||||||
{
|
|
||||||
$this->security = $security;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route(
|
* @Route(
|
||||||
@ -38,16 +31,10 @@ class AccompanyingCourseWorkEvaluationDocumentController extends AbstractControl
|
|||||||
*/
|
*/
|
||||||
public function showAccompanyingCourseWork(AccompanyingPeriodWorkEvaluationDocument $document): Response
|
public function showAccompanyingCourseWork(AccompanyingPeriodWorkEvaluationDocument $document): Response
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$work = $document->getAccompanyingPeriodWorkEvaluation()->getAccompanyingPeriodWork();
|
||||||
|
|
||||||
/** @var AccompanyingPeriodWorkEvaluation $evaluation */
|
|
||||||
$evaluation = $em->getRepository(AccompanyingPeriodWorkEvaluation::class)->find($document->getAccompanyingPeriodWorkEvaluation());
|
|
||||||
|
|
||||||
/** @var AccompanyingPeriodWork $work */
|
|
||||||
$work = $em->getRepository(AccompanyingPeriodWork::class)->find($evaluation->getAccompanyingPeriodWork());
|
|
||||||
|
|
||||||
return $this->redirectToRoute(
|
return $this->redirectToRoute(
|
||||||
$this->security->isGranted(AccompanyingPeriodWorkVoter::UPDATE)?
|
$this->security->isGranted(AccompanyingPeriodWorkVoter::UPDATE, $work) ?
|
||||||
'chill_person_accompanying_period_work_edit' : 'chill_person_accompanying_period_work_show', [
|
'chill_person_accompanying_period_work_edit' : 'chill_person_accompanying_period_work_show', [
|
||||||
'id' => $work->getId()
|
'id' => $work->getId()
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user