Compare commits
No commits in common. "de080e070d2d7a4b5cc2a96a5de36bee84be5d23" and "643d5d451a107a142135e4c8951069f29c3cfc16" have entirely different histories.
de080e070d
...
643d5d451a
4
.gitignore
vendored
4
.gitignore
vendored
@ -22,4 +22,6 @@
|
|||||||
###< symfony/asset-mapper ###
|
###< symfony/asset-mapper ###
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
composer.lock
|
composer.lock
|
||||||
|
|
||||||
|
/migrations/
|
45
composer.lock
generated
45
composer.lock
generated
@ -379,29 +379,26 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "doctrine/deprecations",
|
"name": "doctrine/deprecations",
|
||||||
"version": "1.1.5",
|
"version": "1.1.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/doctrine/deprecations.git",
|
"url": "https://github.com/doctrine/deprecations.git",
|
||||||
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
|
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
|
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
|
||||||
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
|
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.1 || ^8.0"
|
"php": "^7.1 || ^8.0"
|
||||||
},
|
},
|
||||||
"conflict": {
|
|
||||||
"phpunit/phpunit": "<=7.5 || >=13"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"doctrine/coding-standard": "^9 || ^12 || ^13",
|
"doctrine/coding-standard": "^9 || ^12",
|
||||||
"phpstan/phpstan": "1.4.10 || 2.1.11",
|
"phpstan/phpstan": "1.4.10 || 2.0.3",
|
||||||
"phpstan/phpstan-phpunit": "^1.0 || ^2",
|
"phpstan/phpstan-phpunit": "^1.0 || ^2",
|
||||||
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
|
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
|
||||||
"psr/log": "^1 || ^2 || ^3"
|
"psr/log": "^1 || ^2 || ^3"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
@ -421,9 +418,9 @@
|
|||||||
"homepage": "https://www.doctrine-project.org/",
|
"homepage": "https://www.doctrine-project.org/",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/doctrine/deprecations/issues",
|
"issues": "https://github.com/doctrine/deprecations/issues",
|
||||||
"source": "https://github.com/doctrine/deprecations/tree/1.1.5"
|
"source": "https://github.com/doctrine/deprecations/tree/1.1.4"
|
||||||
},
|
},
|
||||||
"time": "2025-04-07T20:06:18+00:00"
|
"time": "2024-12-07T21:18:45+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "doctrine/doctrine-bundle",
|
"name": "doctrine/doctrine-bundle",
|
||||||
@ -6252,16 +6249,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/stimulus-bundle",
|
"name": "symfony/stimulus-bundle",
|
||||||
"version": "v2.24.0",
|
"version": "v2.23.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/stimulus-bundle.git",
|
"url": "https://github.com/symfony/stimulus-bundle.git",
|
||||||
"reference": "e09840304467cda3324cc116c7f4ee23c8ff227c"
|
"reference": "254f4e05cbaa349d4ae68b9b2e6a22995e0887f9"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/stimulus-bundle/zipball/e09840304467cda3324cc116c7f4ee23c8ff227c",
|
"url": "https://api.github.com/repos/symfony/stimulus-bundle/zipball/254f4e05cbaa349d4ae68b9b2e6a22995e0887f9",
|
||||||
"reference": "e09840304467cda3324cc116c7f4ee23c8ff227c",
|
"reference": "254f4e05cbaa349d4ae68b9b2e6a22995e0887f9",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -6301,7 +6298,7 @@
|
|||||||
"symfony-ux"
|
"symfony-ux"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/stimulus-bundle/tree/v2.24.0"
|
"source": "https://github.com/symfony/stimulus-bundle/tree/v2.23.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -6317,7 +6314,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-03-09T21:10:04+00:00"
|
"time": "2025-01-16T21:55:09+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/stopwatch",
|
"name": "symfony/stopwatch",
|
||||||
@ -6917,16 +6914,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/ux-turbo",
|
"name": "symfony/ux-turbo",
|
||||||
"version": "v2.24.0",
|
"version": "v2.23.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/ux-turbo.git",
|
"url": "https://github.com/symfony/ux-turbo.git",
|
||||||
"reference": "22954300bd0b01ca46f17c7890ea15138d9cf67f"
|
"reference": "db96cf04d70a8c820671ce55530e8bf641ada33f"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/ux-turbo/zipball/22954300bd0b01ca46f17c7890ea15138d9cf67f",
|
"url": "https://api.github.com/repos/symfony/ux-turbo/zipball/db96cf04d70a8c820671ce55530e8bf641ada33f",
|
||||||
"reference": "22954300bd0b01ca46f17c7890ea15138d9cf67f",
|
"reference": "db96cf04d70a8c820671ce55530e8bf641ada33f",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -6995,7 +6992,7 @@
|
|||||||
"turbo-stream"
|
"turbo-stream"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/ux-turbo/tree/v2.24.0"
|
"source": "https://github.com/symfony/ux-turbo/tree/v2.23.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -7011,7 +7008,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-04-04T17:29:20+00:00"
|
"time": "2025-02-06T08:47:30+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/validator",
|
"name": "symfony/validator",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
security:
|
security:
|
||||||
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
|
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
|
||||||
password_hashers:
|
password_hashers:
|
||||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto' # à mettre en auto pour sécuriser les mdp
|
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'plaintext' # à mettre en auto pour sécuriser les mdp
|
||||||
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
||||||
providers:
|
providers:
|
||||||
# used to reload user from session & other features (e.g. switch_user)
|
# used to reload user from session & other features (e.g. switch_user)
|
||||||
|
@ -5,7 +5,6 @@ namespace App\Controller;
|
|||||||
use App\Entity\Announcement;
|
use App\Entity\Announcement;
|
||||||
use App\Form\AnnouncementType;
|
use App\Form\AnnouncementType;
|
||||||
use App\Repository\AnnouncementRepository;
|
use App\Repository\AnnouncementRepository;
|
||||||
use App\Repository\InternApplicationRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -15,14 +14,8 @@ use Symfony\Component\Routing\Attribute\Route;
|
|||||||
#[Route('/announcement')]
|
#[Route('/announcement')]
|
||||||
final class AnnouncementController extends AbstractController
|
final class AnnouncementController extends AbstractController
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
private readonly AnnouncementRepository $announcementRepository,
|
|
||||||
private readonly InternApplicationRepository $internApplicationRepository
|
|
||||||
){}
|
|
||||||
#[Route('/', name: 'app_announcement_index')]
|
#[Route('/', name: 'app_announcement_index')]
|
||||||
public function list(Request $request,): Response
|
public function list(Request $request, AnnouncementRepository $announcementRepository): Response
|
||||||
{
|
{
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$announcements = [];
|
$announcements = [];
|
||||||
@ -35,9 +28,9 @@ final class AnnouncementController extends AbstractController
|
|||||||
$showNonValidated = $request->query->get('show_non_validated');
|
$showNonValidated = $request->query->get('show_non_validated');
|
||||||
|
|
||||||
if ($showNonValidated) {
|
if ($showNonValidated) {
|
||||||
$announcements = $this->announcementRepository->findBy(['status' => 'notVerified']);
|
$announcements = $announcementRepository->findBy(['status' => 'notVerified']);
|
||||||
} else {
|
} else {
|
||||||
$announcements = $this->announcementRepository->findAll();
|
$announcements = $announcementRepository->findAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,16 +38,16 @@ final class AnnouncementController extends AbstractController
|
|||||||
$company = $user->getCompany();
|
$company = $user->getCompany();
|
||||||
|
|
||||||
if ($company) {
|
if ($company) {
|
||||||
$announcements = $this->announcementRepository->findBy(['company' => $company]);
|
$announcements = $announcementRepository->findBy(['company' => $company]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('ROLE_INTERN', $user->getRoles())) {
|
if (in_array('ROLE_INTERN', $user->getRoles())) {
|
||||||
$announcements = $this->announcementRepository->findBy(['status' => 'Verified']);
|
$announcements = $announcementRepository->findBy(['status' => 'Verified']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($companyName || $location || $category) {
|
if ($companyName || $location || $category) {
|
||||||
$announcements = $this->announcementRepository->searchAnnouncements($companyName, $location, $category);
|
$announcements = $announcementRepository->searchAnnouncements($companyName, $location, $category);
|
||||||
}
|
}
|
||||||
|
|
||||||
$favorites = [];
|
$favorites = [];
|
||||||
@ -75,7 +68,7 @@ final class AnnouncementController extends AbstractController
|
|||||||
|
|
||||||
|
|
||||||
#[Route('/new', name: 'app_announcement_new', methods: ['GET', 'POST'])]
|
#[Route('/new', name: 'app_announcement_new', methods: ['GET', 'POST'])]
|
||||||
public function new(Request $request,): Response
|
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
/*$user = $this->getUser();
|
/*$user = $this->getUser();
|
||||||
|
|
||||||
@ -96,8 +89,8 @@ final class AnnouncementController extends AbstractController
|
|||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$announcement->setCreationDate(new \DateTime());
|
$announcement->setCreationDate(new \DateTime());
|
||||||
$announcement->setStatus('notVerified');
|
$announcement->setStatus('notVerified');
|
||||||
$this->entityManager->persist($announcement);
|
$entityManager->persist($announcement);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_announcement_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_announcement_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -117,13 +110,13 @@ final class AnnouncementController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}/edit', name: 'app_announcement_edit', methods: ['GET', 'POST'])]
|
#[Route('/{id}/edit', name: 'app_announcement_edit', methods: ['GET', 'POST'])]
|
||||||
public function edit(Request $request, Announcement $announcement,): Response
|
public function edit(Request $request, Announcement $announcement, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$form = $this->createForm(AnnouncementType::class, $announcement);
|
$form = $this->createForm(AnnouncementType::class, $announcement);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_announcement_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_announcement_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -135,23 +128,23 @@ final class AnnouncementController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}', name: 'app_announcement_delete', methods: ['POST'])]
|
#[Route('/{id}', name: 'app_announcement_delete', methods: ['POST'])]
|
||||||
public function delete(Request $request, Announcement $announcement,): Response
|
public function delete(Request $request, Announcement $announcement, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
if ($this->isCsrfTokenValid('delete'.$announcement->getId(), $request->getPayload()->getString('_token'))) {
|
if ($this->isCsrfTokenValid('delete'.$announcement->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
$this->entityManager->remove($announcement);
|
$entityManager->remove($announcement);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('app_announcement_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_announcement_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}/validate', name: 'app_announcement_validate', methods: ['POST'])]
|
#[Route('/{id}/validate', name: 'app_announcement_validate', methods: ['POST'])]
|
||||||
public function validate(Request $request, Announcement $announcement,): Response
|
public function validate(Request $request, Announcement $announcement, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
if ($announcement->getStatus() !== 'Verified')
|
if ($announcement->getStatus() !== 'Verified')
|
||||||
{
|
{
|
||||||
$announcement->setStatus('Verified');
|
$announcement->setStatus('Verified');
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
}
|
}
|
||||||
return $this->redirectToRoute('app_announcement_show',
|
return $this->redirectToRoute('app_announcement_show',
|
||||||
['id' => $announcement->getId()], Response::HTTP_SEE_OTHER);
|
['id' => $announcement->getId()], Response::HTTP_SEE_OTHER);
|
||||||
|
@ -4,9 +4,7 @@ namespace App\Controller;
|
|||||||
|
|
||||||
use App\Entity\Company;
|
use App\Entity\Company;
|
||||||
use App\Form\CompanyType;
|
use App\Form\CompanyType;
|
||||||
use App\Repository\AnnouncementRepository;
|
|
||||||
use App\Repository\CompanyRepository;
|
use App\Repository\CompanyRepository;
|
||||||
use App\Repository\InternApplicationRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -17,31 +15,25 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|||||||
#[Route('/company')]
|
#[Route('/company')]
|
||||||
final class CompanyController extends AbstractController
|
final class CompanyController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
private readonly InternApplicationRepository $internApplicationRepository,
|
|
||||||
private readonly AnnouncementRepository $announcementRepository,
|
|
||||||
private readonly CompanyRepository $companyRepository,
|
|
||||||
){}
|
|
||||||
#[Route(name: 'app_company_index', methods: ['GET'])]
|
#[Route(name: 'app_company_index', methods: ['GET'])]
|
||||||
public function index(): Response
|
public function index(CompanyRepository $companyRepository): Response
|
||||||
{
|
{
|
||||||
return $this->render('company/index.html.twig', [
|
return $this->render('company/index.html.twig', [
|
||||||
'companies' => $this->companyRepository->findAll(),
|
'companies' => $companyRepository->findAll(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/new', name: 'app_company_new', methods: ['GET', 'POST'])]
|
#[Route('/new', name: 'app_company_new', methods: ['GET', 'POST'])]
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
public function new(Request $request,): Response
|
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$company = new Company();
|
$company = new Company();
|
||||||
$form = $this->createForm(CompanyType::class, $company);
|
$form = $this->createForm(CompanyType::class, $company);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->entityManager->persist($company);
|
$entityManager->persist($company);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_company_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_company_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -62,13 +54,13 @@ final class CompanyController extends AbstractController
|
|||||||
|
|
||||||
#[Route('/{id}/edit', name: 'app_company_edit', methods: ['GET', 'POST'])]
|
#[Route('/{id}/edit', name: 'app_company_edit', methods: ['GET', 'POST'])]
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
public function edit(Request $request, Company $company,): Response
|
public function edit(Request $request, Company $company, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$form = $this->createForm(CompanyType::class, $company);
|
$form = $this->createForm(CompanyType::class, $company);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_company_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_company_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -80,11 +72,11 @@ final class CompanyController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}', name: 'app_company_delete', methods: ['POST'])]
|
#[Route('/{id}', name: 'app_company_delete', methods: ['POST'])]
|
||||||
public function delete(Request $request, Company $company,): Response
|
public function delete(Request $request, Company $company, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
if ($this->isCsrfTokenValid('delete'.$company->getId(), $request->getPayload()->getString('_token'))) {
|
if ($this->isCsrfTokenValid('delete'.$company->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
$this->entityManager->remove($company);
|
$entityManager->remove($company);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('app_company_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_company_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
@ -5,9 +5,7 @@ namespace App\Controller;
|
|||||||
use App\Entity\Degree;
|
use App\Entity\Degree;
|
||||||
use App\Entity\InternDegree;
|
use App\Entity\InternDegree;
|
||||||
use App\Form\DegreeType;
|
use App\Form\DegreeType;
|
||||||
use App\Repository\AnnouncementRepository;
|
|
||||||
use App\Repository\DegreeRepository;
|
use App\Repository\DegreeRepository;
|
||||||
use App\Repository\InternApplicationRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -17,30 +15,24 @@ use Symfony\Component\Routing\Attribute\Route;
|
|||||||
#[Route('/degree')]
|
#[Route('/degree')]
|
||||||
final class DegreeController extends AbstractController
|
final class DegreeController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
private readonly InternApplicationRepository $internApplicationRepository,
|
|
||||||
private readonly AnnouncementRepository $announcementRepository,
|
|
||||||
private readonly DegreeRepository $degreeRepository,
|
|
||||||
){}
|
|
||||||
#[Route(name: 'app_degree_index', methods: ['GET'])]
|
#[Route(name: 'app_degree_index', methods: ['GET'])]
|
||||||
public function index(): Response
|
public function index(DegreeRepository $degreeRepository): Response
|
||||||
{
|
{
|
||||||
return $this->render('degree/index.html.twig', [
|
return $this->render('degree/index.html.twig', [
|
||||||
'degrees' => $this->degreeRepository->findAll(),
|
'degrees' => $degreeRepository->findAll(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/new', name: 'app_degree_new', methods: ['GET', 'POST'])]
|
#[Route('/new', name: 'app_degree_new', methods: ['GET', 'POST'])]
|
||||||
public function new(Request $request,): Response
|
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$degree = new Degree();
|
$degree = new Degree();
|
||||||
$form = $this->createForm(DegreeType::class, $degree);
|
$form = $this->createForm(DegreeType::class, $degree);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->entityManager->persist($degree);
|
$entityManager->persist($degree);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_degree_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_degree_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -60,13 +52,13 @@ final class DegreeController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}/edit', name: 'app_degree_edit', methods: ['GET', 'POST'])]
|
#[Route('/{id}/edit', name: 'app_degree_edit', methods: ['GET', 'POST'])]
|
||||||
public function edit(Request $request, Degree $degree,): Response
|
public function edit(Request $request, Degree $degree, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$form = $this->createForm(DegreeType::class, $degree);
|
$form = $this->createForm(DegreeType::class, $degree);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_degree_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_degree_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -78,11 +70,11 @@ final class DegreeController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}', name: 'app_degree_delete', methods: ['POST'])]
|
#[Route('/{id}', name: 'app_degree_delete', methods: ['POST'])]
|
||||||
public function delete(Request $request, Degree $degree,): Response
|
public function delete(Request $request, Degree $degree, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
if ($this->isCsrfTokenValid('delete'.$degree->getId(), $request->getPayload()->getString('_token'))) {
|
if ($this->isCsrfTokenValid('delete'.$degree->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
$this->entityManager->remove($degree);
|
$entityManager->remove($degree);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('app_degree_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_degree_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
@ -3,11 +3,8 @@
|
|||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Entity\Employee;
|
use App\Entity\Employee;
|
||||||
use App\Entity\InternApplication;
|
|
||||||
use App\Form\EmployeeType;
|
use App\Form\EmployeeType;
|
||||||
use App\Repository\AnnouncementRepository;
|
|
||||||
use App\Repository\EmployeeRepository;
|
use App\Repository\EmployeeRepository;
|
||||||
use App\Repository\InternApplicationRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -17,23 +14,15 @@ use Symfony\Component\Routing\Attribute\Route;
|
|||||||
#[Route('/employee')]
|
#[Route('/employee')]
|
||||||
final class EmployeeController extends AbstractController
|
final class EmployeeController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
private readonly EmployeeRepository $employeeRepository,
|
|
||||||
private readonly AnnouncementRepository $announcementRepository,
|
|
||||||
private readonly InternApplicationRepository $internApplicationRepository
|
|
||||||
)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#[Route(name: 'app_employee_index', methods: ['GET'])]
|
#[Route(name: 'app_employee_index', methods: ['GET'])]
|
||||||
public function index(): Response
|
public function index(EmployeeRepository $employeeRepository): Response
|
||||||
{
|
{
|
||||||
return $this->render('employee/index.html.twig', [
|
return $this->render('employee/index.html.twig', [
|
||||||
'employees' => $this->employeeRepository->findAll(),
|
'employees' => $employeeRepository->findAll(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}', name: 'app_employee_show', requirements: ['id' => '\d+'], methods: ['GET'])]
|
#[Route('/{id}', name: 'app_employee_show', methods: ['GET'])]
|
||||||
public function show(Employee $employee): Response
|
public function show(Employee $employee): Response
|
||||||
{
|
{
|
||||||
return $this->render('employee/show.html.twig', [
|
return $this->render('employee/show.html.twig', [
|
||||||
@ -41,14 +30,14 @@ final class EmployeeController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}/edit', name: 'app_employee_edit', requirements: ['id' => '\d+'], methods: ['GET', 'POST'])]
|
#[Route('/{id}/edit', name: 'app_employee_edit', methods: ['GET', 'POST'])]
|
||||||
public function edit(Request $request, Employee $employee): Response
|
public function edit(Request $request, Employee $employee, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$form = $this->createForm(EmployeeType::class, $employee);
|
$form = $this->createForm(EmployeeType::class, $employee);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_employee_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_employee_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -59,38 +48,14 @@ final class EmployeeController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}', name: 'app_employee_delete', requirements: ['id' => '\d+'], methods: ['POST'])]
|
#[Route('/{id}', name: 'app_employee_delete', methods: ['POST'])]
|
||||||
public function delete(Request $request, Employee $employee): Response
|
public function delete(Request $request, Employee $employee, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
if ($this->isCsrfTokenValid('delete'.$employee->getId(), $request->getPayload()->getString('_token'))) {
|
if ($this->isCsrfTokenValid('delete'.$employee->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
$this->entityManager->remove($employee);
|
$entityManager->remove($employee);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('app_employee_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_employee_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/seeApplications', name: 'app_employee_seeApplications')]
|
|
||||||
public function seeApplications(): Response
|
|
||||||
{
|
|
||||||
$employee = $this->getUser();
|
|
||||||
|
|
||||||
if (!$employee instanceof Employee){
|
|
||||||
throw $this->createAccessDeniedException('Seuls les employés peuvent accéder à cette page.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$company = $employee->getCompany();
|
|
||||||
|
|
||||||
$announcements = $this->announcementRepository
|
|
||||||
->findBy(['company' => $company]);
|
|
||||||
|
|
||||||
$applications = $this->internApplicationRepository
|
|
||||||
->findBy(['application' => $announcements]);
|
|
||||||
|
|
||||||
return $this->render('employee/applications.html.twig', [
|
|
||||||
'applications' => $applications,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,7 @@ namespace App\Controller;
|
|||||||
|
|
||||||
use App\Entity\FAQ;
|
use App\Entity\FAQ;
|
||||||
use App\Form\FAQType;
|
use App\Form\FAQType;
|
||||||
use App\Repository\AnnouncementRepository;
|
|
||||||
use App\Repository\FAQRepository;
|
use App\Repository\FAQRepository;
|
||||||
use App\Repository\InternApplicationRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -17,23 +15,17 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|||||||
#[Route('/faq')]
|
#[Route('/faq')]
|
||||||
final class FAQController extends AbstractController
|
final class FAQController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
private readonly AnnouncementRepository $announcementRepository,
|
|
||||||
private readonly InternApplicationRepository $internApplicationRepository,
|
|
||||||
private readonly FaqRepository $faqRepository,
|
|
||||||
){}
|
|
||||||
#[Route(name: 'app_faq_index', methods: ['GET'])]
|
#[Route(name: 'app_faq_index', methods: ['GET'])]
|
||||||
public function index(): Response
|
public function index(FAQRepository $fAQRepository): Response
|
||||||
{
|
{
|
||||||
return $this->render('faq/index.html.twig', [
|
return $this->render('faq/index.html.twig', [
|
||||||
'faqs' => $this->faqRepository->findAll(),
|
'faqs' => $fAQRepository->findAll(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/new', name: 'app_faq_new', methods: ['GET', 'POST'])]
|
#[Route('/new', name: 'app_faq_new', methods: ['GET', 'POST'])]
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
public function new(Request $request,): Response
|
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$fAQ = new FAQ();
|
$fAQ = new FAQ();
|
||||||
$form = $this->createForm(FAQType::class, $fAQ);
|
$form = $this->createForm(FAQType::class, $fAQ);
|
||||||
@ -41,8 +33,8 @@ final class FAQController extends AbstractController
|
|||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$fAQ->setUpdateDate(new \DateTime());
|
$fAQ->setUpdateDate(new \DateTime());
|
||||||
$this->entityManager->persist($fAQ);
|
$entityManager->persist($fAQ);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_faq_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_faq_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -63,14 +55,14 @@ final class FAQController extends AbstractController
|
|||||||
|
|
||||||
#[Route('/{id}/edit', name: 'app_faq_edit', methods: ['GET', 'POST'])]
|
#[Route('/{id}/edit', name: 'app_faq_edit', methods: ['GET', 'POST'])]
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
public function edit(Request $request, FAQ $fAQ,): Response
|
public function edit(Request $request, FAQ $fAQ, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$form = $this->createForm(FAQType::class, $fAQ);
|
$form = $this->createForm(FAQType::class, $fAQ);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$fAQ->setUpdateDate(new \DateTime());
|
$fAQ->setUpdateDate(new \DateTime());
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_faq_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_faq_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -83,11 +75,11 @@ final class FAQController extends AbstractController
|
|||||||
|
|
||||||
#[Route('/{id}', name: 'app_faq_delete', methods: ['POST'])]
|
#[Route('/{id}', name: 'app_faq_delete', methods: ['POST'])]
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
public function delete(Request $request, FAQ $fAQ,): Response
|
public function delete(Request $request, FAQ $fAQ, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
if ($this->isCsrfTokenValid('delete'.$fAQ->getId(), $request->getPayload()->getString('_token'))) {
|
if ($this->isCsrfTokenValid('delete'.$fAQ->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
$this->entityManager->remove($fAQ);
|
$entityManager->remove($fAQ);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('app_faq_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_faq_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Entity\UserApp;
|
use App\Entity\UserApp;
|
||||||
use App\Repository\AnnouncementRepository;
|
|
||||||
use App\Repository\CompanyRepository;
|
use App\Repository\CompanyRepository;
|
||||||
use App\Repository\InternApplicationRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@ -17,8 +15,6 @@ class IndexController extends AbstractController
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private HttpClientInterface $client,
|
private HttpClientInterface $client,
|
||||||
private readonly CompanyRepository $companyRepository,
|
private readonly CompanyRepository $companyRepository,
|
||||||
private readonly AnnouncementRepository $announcementRepository,
|
|
||||||
private readonly InternApplicationRepository $internApplicationRepository
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -2,20 +2,13 @@
|
|||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Entity\Announcement;
|
|
||||||
use App\Entity\Degree;
|
use App\Entity\Degree;
|
||||||
use App\Entity\Intern;
|
use App\Entity\Intern;
|
||||||
use App\Entity\InternApplication;
|
|
||||||
use App\Entity\InternDegree;
|
use App\Entity\InternDegree;
|
||||||
use App\Entity\InternSkill;
|
use App\Entity\InternSkill;
|
||||||
use App\Entity\Skill;
|
use App\Entity\Skill;
|
||||||
use App\Form\InternType;
|
use App\Form\InternType;
|
||||||
use App\Repository\AnnouncementRepository;
|
|
||||||
use App\Repository\DegreeRepository;
|
|
||||||
use App\Repository\InternApplicationRepository;
|
|
||||||
use App\Repository\InternDegreeRepository;
|
|
||||||
use App\Repository\InternRepository;
|
use App\Repository\InternRepository;
|
||||||
use App\Repository\InternSkillRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -25,20 +18,11 @@ use Symfony\Component\Routing\Attribute\Route;
|
|||||||
#[Route('/intern')]
|
#[Route('/intern')]
|
||||||
final class InternController extends AbstractController
|
final class InternController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
private readonly AnnouncementRepository $announcementRepository,
|
|
||||||
private readonly InternRepository $internRepository,
|
|
||||||
private readonly InternApplicationRepository $internApplicationRepository,
|
|
||||||
private readonly InternDegreeRepository $internDegreeRepository,
|
|
||||||
private readonly InternSkillRepository $internSkillRepository,
|
|
||||||
private readonly DegreeRepository $degreeRepository,
|
|
||||||
){}
|
|
||||||
#[Route(name: 'app_intern_index', methods: ['GET'])]
|
#[Route(name: 'app_intern_index', methods: ['GET'])]
|
||||||
public function index(): Response
|
public function index(InternRepository $internRepository): Response
|
||||||
{
|
{
|
||||||
return $this->render('intern/index.html.twig', [
|
return $this->render('intern/index.html.twig', [
|
||||||
'interns' => $this->internRepository->findAll(),
|
'interns' => $internRepository->findAll(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,13 +35,13 @@ final class InternController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}/edit', name: 'app_intern_edit', methods: ['GET', 'POST'])]
|
#[Route('/{id}/edit', name: 'app_intern_edit', methods: ['GET', 'POST'])]
|
||||||
public function edit(Request $request, Intern $intern,): Response
|
public function edit(Request $request, Intern $intern, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$form = $this->createForm(InternType::class, $intern);
|
$form = $this->createForm(InternType::class, $intern);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_intern_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_intern_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -69,18 +53,18 @@ final class InternController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}', name: 'app_intern_delete', methods: ['POST'])]
|
#[Route('/{id}', name: 'app_intern_delete', methods: ['POST'])]
|
||||||
public function delete(Request $request, Intern $intern,): Response
|
public function delete(Request $request, Intern $intern, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
if ($this->isCsrfTokenValid('delete'.$intern->getId(), $request->getPayload()->getString('_token'))) {
|
if ($this->isCsrfTokenValid('delete'.$intern->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
$this->entityManager->remove($intern);
|
$entityManager->remove($intern);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('app_intern_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_intern_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/degrees/add', name:'app_intern_add_degrees', methods:['POST'])]
|
#[Route('/degrees/add', name:'app_intern_add_degrees', methods:['POST'])]
|
||||||
public function addDegrees(Request $request): Response
|
public function addDegrees(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$intern = $this->getUser();
|
$intern = $this->getUser();
|
||||||
|
|
||||||
@ -95,8 +79,8 @@ final class InternController extends AbstractController
|
|||||||
return $this->redirectToRoute('app_degree_index');
|
return $this->redirectToRoute('app_degree_index');
|
||||||
}
|
}
|
||||||
|
|
||||||
$degreeRepository = $this->entityManager->getRepository(Degree::class);
|
$degreeRepository = $entityManager->getRepository(Degree::class);
|
||||||
$internDegreeRepository = $this->entityManager->getRepository(InternDegree::class);
|
$internDegreeRepository = $entityManager->getRepository(InternDegree::class);
|
||||||
|
|
||||||
foreach ($selectedDegreeIds as $degreeId) {
|
foreach ($selectedDegreeIds as $degreeId) {
|
||||||
$degree = $degreeRepository->find($degreeId);
|
$degree = $degreeRepository->find($degreeId);
|
||||||
@ -116,55 +100,19 @@ final class InternController extends AbstractController
|
|||||||
$internDegree->setDegree($degree);
|
$internDegree->setDegree($degree);
|
||||||
$internDegree->setGraduationDate(new \DateTime());
|
$internDegree->setGraduationDate(new \DateTime());
|
||||||
|
|
||||||
$this->entityManager->persist($internDegree);
|
$entityManager->persist($internDegree);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
$this->addFlash('success', 'Les diplômes ont été ajoutés avec succès.');
|
$this->addFlash('success', 'Les diplômes ont été ajoutés avec succès.');
|
||||||
|
|
||||||
return $this->redirectToRoute('app_profile');
|
return $this->redirectToRoute('app_profile');
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/application/send', name:'app_intern_send_application', methods:['POST'])]
|
|
||||||
public function sendApplication(Request $request,): Response
|
|
||||||
{
|
|
||||||
$intern = $this->getUser();
|
|
||||||
if (!$intern instanceof Intern) {
|
|
||||||
throw $this->createAccessDeniedException("Seuls les stagiaires peuvent envoyer des candidatures.");
|
|
||||||
}
|
|
||||||
|
|
||||||
$announcementRepository = $this->entityManager->getRepository(Announcement::class);
|
|
||||||
$internApplicationRepository = $this->entityManager->getRepository(InternApplication::class);
|
|
||||||
|
|
||||||
$announcementId = $request->request->get('announcement_id');
|
|
||||||
$announcement = $announcementRepository->find($announcementId);
|
|
||||||
|
|
||||||
$existingInternApplication = $internApplicationRepository->findOneBy([
|
|
||||||
'intern' => $intern,
|
|
||||||
'application' => $announcement
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (!$existingInternApplication) {
|
|
||||||
$internApplication = new InternApplication();
|
|
||||||
$internApplication->setIntern($intern);
|
|
||||||
$internApplication->setApplication($announcement);
|
|
||||||
$internApplication->setApplicationDate(new \DateTime());
|
|
||||||
$internApplication->setStatus("En Attente");
|
|
||||||
|
|
||||||
$this->entityManager->persist($internApplication);
|
|
||||||
}
|
|
||||||
$this->entityManager->flush();
|
|
||||||
|
|
||||||
$this->addFlash('success', 'La candidature à bien été envoyée.');
|
|
||||||
|
|
||||||
return $this->redirectToRoute('app_profile');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route('/skills/add', name:'app_intern_add_skills', methods:['POST'])]
|
#[Route('/skills/add', name:'app_intern_add_skills', methods:['POST'])]
|
||||||
public function addSkills(Request $request,): Response
|
public function addSkills(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$intern = $this->getUser();
|
$intern = $this->getUser();
|
||||||
|
|
||||||
@ -179,8 +127,8 @@ final class InternController extends AbstractController
|
|||||||
return $this->redirectToRoute('app_skill_index');
|
return $this->redirectToRoute('app_skill_index');
|
||||||
}
|
}
|
||||||
|
|
||||||
$skillRepository = $this->entityManager->getRepository(Skill::class);
|
$skillRepository = $entityManager->getRepository(Skill::class);
|
||||||
$internSkillRepository = $this->entityManager->getRepository(InternSkill::class);
|
$internSkillRepository = $entityManager->getRepository(InternSkill::class);
|
||||||
|
|
||||||
foreach ($selectedSkillIds as $skillId) {
|
foreach ($selectedSkillIds as $skillId) {
|
||||||
$skill = $skillRepository->find($skillId);
|
$skill = $skillRepository->find($skillId);
|
||||||
@ -197,11 +145,11 @@ final class InternController extends AbstractController
|
|||||||
$internSkill->setIntern($intern);
|
$internSkill->setIntern($intern);
|
||||||
$internSkill->setSkill($skill);
|
$internSkill->setSkill($skill);
|
||||||
|
|
||||||
$this->entityManager->persist($internSkill);
|
$entityManager->persist($internSkill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
$this->addFlash('success', 'Les compétences ont été ajoutées avec succès.');
|
$this->addFlash('success', 'Les compétences ont été ajoutées avec succès.');
|
||||||
|
|
||||||
|
@ -5,9 +5,7 @@ namespace App\Controller;
|
|||||||
use App\Entity\Announcement;
|
use App\Entity\Announcement;
|
||||||
use App\Entity\Intern;
|
use App\Entity\Intern;
|
||||||
use App\Entity\InternFavorite;
|
use App\Entity\InternFavorite;
|
||||||
use App\Repository\AnnouncementRepository;
|
|
||||||
use App\Repository\InternFavoriteRepository;
|
use App\Repository\InternFavoriteRepository;
|
||||||
use App\Repository\InternRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Bundle\SecurityBundle\Security;
|
use Symfony\Bundle\SecurityBundle\Security;
|
||||||
@ -19,12 +17,6 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
|
|
||||||
class InternFavoriteController extends AbstractController
|
class InternFavoriteController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
private readonly AnnouncementRepository $announcementRepository,
|
|
||||||
private readonly InternRepository $internRepository,
|
|
||||||
private readonly InternFavoriteRepository $internFavoriteRepository,
|
|
||||||
){}
|
|
||||||
#[Route('/favorite/toggle/{id}', name: 'toggle_favorite')]
|
#[Route('/favorite/toggle/{id}', name: 'toggle_favorite')]
|
||||||
public function toggleFavorite(
|
public function toggleFavorite(
|
||||||
Announcement $announcement,
|
Announcement $announcement,
|
||||||
@ -53,7 +45,7 @@ class InternFavoriteController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/announcement/{id}/favorite/toggle', name: 'app_favorite_toggle', methods: ['POST'])]
|
#[Route('/announcement/{id}/favorite/toggle', name: 'app_favorite_toggle', methods: ['POST'])]
|
||||||
public function toggle(Announcement $announcement,Security $security): RedirectResponse
|
public function toggle(Announcement $announcement, EntityManagerInterface $em, Security $security): RedirectResponse
|
||||||
{
|
{
|
||||||
$user = $security->getUser();
|
$user = $security->getUser();
|
||||||
|
|
||||||
@ -61,33 +53,33 @@ class InternFavoriteController extends AbstractController
|
|||||||
throw new AccessDeniedHttpException('Seuls les stagiaires peuvent ajouter aux favoris.');
|
throw new AccessDeniedHttpException('Seuls les stagiaires peuvent ajouter aux favoris.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$favorite = $this->entityManager->getRepository(InternFavorite::class)->findOneBy([
|
$favorite = $em->getRepository(InternFavorite::class)->findOneBy([
|
||||||
'intern' => $user,
|
'intern' => $user,
|
||||||
'announcement' => $announcement
|
'announcement' => $announcement
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($favorite) {
|
if ($favorite) {
|
||||||
$this->entityManager->remove($favorite);
|
$em->remove($favorite);
|
||||||
} else {
|
} else {
|
||||||
$favorite = new InternFavorite();
|
$favorite = new InternFavorite();
|
||||||
$favorite->setIntern($user);
|
$favorite->setIntern($user);
|
||||||
$favorite->setAnnouncement($announcement);
|
$favorite->setAnnouncement($announcement);
|
||||||
$this->entityManager->persist($favorite);
|
$em->persist($favorite);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->entityManager->flush();
|
$em->flush();
|
||||||
|
|
||||||
return new RedirectResponse($_SERVER['HTTP_REFERER'] ?? '/');
|
return new RedirectResponse($_SERVER['HTTP_REFERER'] ?? '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/announcement/{id}', name: 'app_announcement_show')]
|
#[Route('/announcement/{id}', name: 'app_announcement_show')]
|
||||||
public function show(Announcement $announcement,): Response
|
public function show(Announcement $announcement, InternFavoriteRepository $internFavoriteRepository): Response
|
||||||
{
|
{
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$isFavorite = false;
|
$isFavorite = false;
|
||||||
|
|
||||||
if (in_array('ROLE_INTERN', $user->getRoles())) {
|
if (in_array('ROLE_INTERN', $user->getRoles())) {
|
||||||
$favorite = $this->internFavoriteRepository->findOneBy([
|
$favorite = $internFavoriteRepository->findOneBy([
|
||||||
'announcement' => $announcement,
|
'announcement' => $announcement,
|
||||||
'intern' => $user,
|
'intern' => $user,
|
||||||
]);
|
]);
|
||||||
@ -102,12 +94,12 @@ class InternFavoriteController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/favorite/add/{id}', name: 'app_favorite_add')]
|
#[Route('/favorite/add/{id}', name: 'app_favorite_add')]
|
||||||
public function addFavorite(Announcement $announcement,): Response
|
public function addFavorite(Announcement $announcement, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
|
||||||
// Vérifier si l'intern a déjà ce favori
|
// Vérifier si l'intern a déjà ce favori
|
||||||
$existingFavorite = $this->entityManager->getRepository(InternFavorite::class)->findOneBy([
|
$existingFavorite = $entityManager->getRepository(InternFavorite::class)->findOneBy([
|
||||||
'announcement' => $announcement,
|
'announcement' => $announcement,
|
||||||
'intern' => $user,
|
'intern' => $user,
|
||||||
]);
|
]);
|
||||||
@ -117,26 +109,26 @@ class InternFavoriteController extends AbstractController
|
|||||||
$favorite->setAnnouncement($announcement);
|
$favorite->setAnnouncement($announcement);
|
||||||
$favorite->setIntern($user);
|
$favorite->setIntern($user);
|
||||||
|
|
||||||
$this->entityManager->persist($favorite);
|
$entityManager->persist($favorite);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('app_announcement_show', ['id' => $announcement->getId()]);
|
return $this->redirectToRoute('app_announcement_show', ['id' => $announcement->getId()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/favorite/remove/{id}', name: 'app_favorite_remove')]
|
#[Route('/favorite/remove/{id}', name: 'app_favorite_remove')]
|
||||||
public function removeFavorite(Announcement $announcement,): Response
|
public function removeFavorite(Announcement $announcement, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
|
||||||
$favorite = $this->entityManager->getRepository(InternFavorite::class)->findOneBy([
|
$favorite = $entityManager->getRepository(InternFavorite::class)->findOneBy([
|
||||||
'announcement' => $announcement,
|
'announcement' => $announcement,
|
||||||
'intern' => $user,
|
'intern' => $user,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($favorite) {
|
if ($favorite) {
|
||||||
$this->entityManager->remove($favorite);
|
$entityManager->remove($favorite);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('app_announcement_show', ['id' => $announcement->getId()]);
|
return $this->redirectToRoute('app_announcement_show', ['id' => $announcement->getId()]);
|
||||||
|
@ -5,8 +5,6 @@ namespace App\Controller;
|
|||||||
use App\Entity\Message;
|
use App\Entity\Message;
|
||||||
use App\Entity\UserApp;
|
use App\Entity\UserApp;
|
||||||
use App\Form\MessageType;
|
use App\Form\MessageType;
|
||||||
use App\Repository\AnnouncementRepository;
|
|
||||||
use App\Repository\InternSkillRepository;
|
|
||||||
use App\Repository\MessageRepository;
|
use App\Repository\MessageRepository;
|
||||||
use App\Repository\UserRepository;
|
use App\Repository\UserRepository;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
@ -18,19 +16,11 @@ use Symfony\Component\Routing\Attribute\Route;
|
|||||||
#[Route('/message')]
|
#[Route('/message')]
|
||||||
final class MessageController extends AbstractController
|
final class MessageController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
private readonly AnnouncementRepository $announcementRepository,
|
|
||||||
private readonly MessageRepository $messageRepository,
|
|
||||||
private readonly UserRepository $repository,
|
|
||||||
private readonly InternSkillRepository $skillRepository,
|
|
||||||
private readonly UserRepository $userRepository,
|
|
||||||
){}
|
|
||||||
#[Route(name: 'app_message_index', methods: ['GET'])]
|
#[Route(name: 'app_message_index', methods: ['GET'])]
|
||||||
public function index(): Response
|
public function index(MessageRepository $messageRepository): Response
|
||||||
{
|
{
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$messages = $this->messageRepository->findLatestMessagesByUser($user);
|
$messages = $messageRepository->findLatestMessagesByUser($user);
|
||||||
|
|
||||||
return $this->render('message/index.html.twig', [
|
return $this->render('message/index.html.twig', [
|
||||||
'messages' => $messages,
|
'messages' => $messages,
|
||||||
@ -38,12 +28,12 @@ final class MessageController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/conversation/{id}', name: 'app_message_conversation', methods: ['GET'])]
|
#[Route('/conversation/{id}', name: 'app_message_conversation', methods: ['GET'])]
|
||||||
public function conversation(Message $message,): Response
|
public function conversation(Message $message, MessageRepository $messageRepository): Response
|
||||||
{
|
{
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$otherUser = $message->getSender() === $user ? $message->getReceiver() : $message->getSender();
|
$otherUser = $message->getSender() === $user ? $message->getReceiver() : $message->getSender();
|
||||||
|
|
||||||
$conversation = $this->messageRepository->findByConversation($user, $otherUser);
|
$conversation = $messageRepository->findByConversation($user, $otherUser);
|
||||||
|
|
||||||
return $this->render('message/conversation.html.twig', [
|
return $this->render('message/conversation.html.twig', [
|
||||||
'conversation' => $conversation,
|
'conversation' => $conversation,
|
||||||
@ -54,12 +44,12 @@ final class MessageController extends AbstractController
|
|||||||
|
|
||||||
|
|
||||||
#[Route('/new/{receiverId}', name: 'app_message_new', methods: ['GET', 'POST'])]
|
#[Route('/new/{receiverId}', name: 'app_message_new', methods: ['GET', 'POST'])]
|
||||||
public function new(Request $request, ?int $receiverId = null,): Response
|
public function new(Request $request, EntityManagerInterface $entityManager, ?int $receiverId = null, UserRepository $userRepository): Response
|
||||||
{
|
{
|
||||||
$message = new Message();
|
$message = new Message();
|
||||||
|
|
||||||
if ($receiverId) {
|
if ($receiverId) {
|
||||||
$receiver = $this->userRepository->find($receiverId);
|
$receiver = $userRepository->find($receiverId);
|
||||||
if ($receiver) {
|
if ($receiver) {
|
||||||
$message->setReceiver($receiver);
|
$message->setReceiver($receiver);
|
||||||
}
|
}
|
||||||
@ -72,8 +62,8 @@ final class MessageController extends AbstractController
|
|||||||
$message->setSendingDate(new \DateTime());
|
$message->setSendingDate(new \DateTime());
|
||||||
$message->setSender($this->getUser());
|
$message->setSender($this->getUser());
|
||||||
|
|
||||||
$this->entityManager->persist($message);
|
$entityManager->persist($message);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_message_index');
|
return $this->redirectToRoute('app_message_index');
|
||||||
}
|
}
|
||||||
@ -92,14 +82,14 @@ final class MessageController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}/edit', name: 'app_message_edit', methods: ['GET', 'POST'])]
|
#[Route('/{id}/edit', name: 'app_message_edit', methods: ['GET', 'POST'])]
|
||||||
public function edit(Request $request, Message $message,): Response
|
public function edit(Request $request, Message $message, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$form = $this->createForm(MessageType::class, $message);
|
$form = $this->createForm(MessageType::class, $message);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$message->setSendingDate(new \DateTime());
|
$message->setSendingDate(new \DateTime());
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_message_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_message_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -111,11 +101,11 @@ final class MessageController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}', name: 'app_message_delete', methods: ['POST'])]
|
#[Route('/{id}', name: 'app_message_delete', methods: ['POST'])]
|
||||||
public function delete(Request $request, Message $message,): Response
|
public function delete(Request $request, Message $message, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
if ($this->isCsrfTokenValid('delete'.$message->getId(), $request->getPayload()->getString('_token'))) {
|
if ($this->isCsrfTokenValid('delete'.$message->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
$this->entityManager->remove($message);
|
$entityManager->remove($message);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('app_message_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_message_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
@ -2,12 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Entity\Announcement;
|
|
||||||
use App\Entity\Intern;
|
|
||||||
use App\Entity\InternApplication;
|
|
||||||
use App\Entity\UserApp;
|
use App\Entity\UserApp;
|
||||||
use App\Form\UserAppType;
|
use App\Form\UserAppType;
|
||||||
use App\Repository\InternApplicationRepository;
|
|
||||||
use App\Repository\SkillRepository;
|
use App\Repository\SkillRepository;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
@ -17,10 +13,6 @@ use Symfony\Component\Routing\Attribute\Route;
|
|||||||
|
|
||||||
class ProfileController extends AbstractController
|
class ProfileController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
private readonly InternApplicationRepository $internApplicationRepository,
|
|
||||||
){}
|
|
||||||
#[Route('/profile', name: 'app_profile')]
|
#[Route('/profile', name: 'app_profile')]
|
||||||
public function profile(): Response
|
public function profile(): Response
|
||||||
{
|
{
|
||||||
@ -30,33 +22,19 @@ class ProfileController extends AbstractController
|
|||||||
throw $this->createAccessDeniedException('Vous devez être connecté pour accéder à cette page.');
|
throw $this->createAccessDeniedException('Vous devez être connecté pour accéder à cette page.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user instanceof Intern)
|
|
||||||
{
|
|
||||||
|
|
||||||
$internApplications = $this->internApplicationRepository->findBy([
|
|
||||||
'intern' => $user,
|
|
||||||
]);
|
|
||||||
|
|
||||||
return $this->render('profile/index.html.twig', [
|
|
||||||
'user' => $user,
|
|
||||||
'applications' => $internApplications
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->render('profile/index.html.twig', [
|
return $this->render('profile/index.html.twig', [
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
'applications' => []
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('profile/{id}/edit', name: 'app_profile_edit', methods: ['GET', 'POST'])]
|
#[Route('profile/{id}/edit', name: 'app_profile_edit', methods: ['GET', 'POST'])]
|
||||||
public function edit(Request $request, UserApp $userApp,): Response
|
public function edit(Request $request, UserApp $userApp, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$form = $this->createForm(UserAppType::class, $userApp);
|
$form = $this->createForm(UserAppType::class, $userApp);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_profile', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_profile', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -67,21 +45,6 @@ class ProfileController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/profile/{id}/visit', name: 'app_profile_visit')]
|
|
||||||
public function visitProfile( int $id): Response
|
|
||||||
{
|
|
||||||
$user = $this->entityManager->getRepository(Intern::class)->find($id);
|
|
||||||
|
|
||||||
if (!$user) {
|
|
||||||
throw $this->createNotFoundException('Utilisateur non trouvé.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->render('profile/index.html.twig', [
|
|
||||||
'user' => $user,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#[Route('profile/pickDegree', name: 'app_profile_pickDegree', methods: ['GET'])]
|
#[Route('profile/pickDegree', name: 'app_profile_pickDegree', methods: ['GET'])]
|
||||||
public function pickDegree(UserApp $userApp): Response
|
public function pickDegree(UserApp $userApp): Response
|
||||||
{
|
{
|
||||||
|
@ -6,25 +6,19 @@ use App\Entity\Employee;
|
|||||||
use App\Entity\Intern;
|
use App\Entity\Intern;
|
||||||
use App\Entity\UserApp;
|
use App\Entity\UserApp;
|
||||||
use App\Form\RegistrationFormType;
|
use App\Form\RegistrationFormType;
|
||||||
use App\Repository\InternApplicationRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Bundle\SecurityBundle\Security;
|
use Symfony\Bundle\SecurityBundle\Security;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
use App\Entity\Company;
|
|
||||||
|
|
||||||
#[Route('/register', name: 'app_register')]
|
#[Route('/register', name: 'app_register')]
|
||||||
class RegistrationController extends AbstractController
|
class RegistrationController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
){}
|
|
||||||
#[Route('/', name: '_intern')]
|
#[Route('/', name: '_intern')]
|
||||||
public function register(Request $request, UserPasswordHasherInterface $userPasswordHasher, Security $security): Response
|
public function register(Request $request, UserPasswordHasherInterface $userPasswordHasher, Security $security, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$user = new Intern();
|
$user = new Intern();
|
||||||
$form = $this->createForm(RegistrationFormType::class, $user);
|
$form = $this->createForm(RegistrationFormType::class, $user);
|
||||||
@ -38,52 +32,44 @@ class RegistrationController extends AbstractController
|
|||||||
// encode the plain password
|
// encode the plain password
|
||||||
$user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword));
|
$user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword));
|
||||||
|
|
||||||
$this->entityManager->persist($user);
|
$entityManager->persist($user);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
|
// do anything else you need here, like send an email
|
||||||
|
|
||||||
return $security->login($user, 'form_login', 'main');
|
return $security->login($user, 'form_login', 'main');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('registration/register.html.twig', [
|
return $this->render('registration/register.html.twig', [
|
||||||
'registrationForm' => $form,
|
'registrationForm' => $form,
|
||||||
'employee' => False,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/employee', name: '_employee')]
|
#[Route('/employee', name: '_employee')]
|
||||||
public function registerEmployee(Request $request, UserPasswordHasherInterface $userPasswordHasher, Security $security): Response
|
public function registerEmployee(Request $request, UserPasswordHasherInterface $userPasswordHasher, Security $security, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$user = new Employee();
|
$user = new Employee();
|
||||||
$form = $this->createForm(RegistrationFormType::class, $user)
|
$form = $this->createForm(RegistrationFormType::class, $user);
|
||||||
->add('company', EntityType::class, [
|
|
||||||
'class' => Company::class,
|
|
||||||
'choice_label' => 'name',
|
|
||||||
'placeholder' => 'Sélectionnez une entreprise',
|
|
||||||
'label' => 'Entreprise',
|
|
||||||
]);
|
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
/** @var string $plainPassword */
|
/** @var string $plainPassword */
|
||||||
$plainPassword = $form->get('plainPassword')->getData();
|
$plainPassword = $form->get('plainPassword')->getData();
|
||||||
|
|
||||||
$company = $form->get('company')->getData();
|
|
||||||
$user->setCompany($company);
|
|
||||||
|
|
||||||
$user->setRoles(['ROLE_EMPLOYEE']);
|
$user->setRoles(['ROLE_EMPLOYEE']);
|
||||||
// Encoder le mot de passe
|
// encode the plain password
|
||||||
$user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword));
|
$user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword));
|
||||||
|
|
||||||
$this->entityManager->persist($user);
|
$entityManager->persist($user);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
|
// do anything else you need here, like send an email
|
||||||
|
|
||||||
return $security->login($user, 'form_login', 'main');
|
return $security->login($user, 'form_login', 'main');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('registration/register.html.twig', [
|
return $this->render('registration/register.html.twig', [
|
||||||
'registrationForm' => $form,
|
'registrationForm' => $form,
|
||||||
'employee' => True,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Repository\InternApplicationRepository;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Bundle\SecurityBundle\Security;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||||
|
@ -4,8 +4,6 @@ namespace App\Controller;
|
|||||||
|
|
||||||
use App\Entity\Skill;
|
use App\Entity\Skill;
|
||||||
use App\Form\SkillType;
|
use App\Form\SkillType;
|
||||||
use App\Repository\AnnouncementRepository;
|
|
||||||
use App\Repository\InternApplicationRepository;
|
|
||||||
use App\Repository\SkillRepository;
|
use App\Repository\SkillRepository;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
@ -17,30 +15,25 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|||||||
#[Route('/skill')]
|
#[Route('/skill')]
|
||||||
final class SkillController extends AbstractController
|
final class SkillController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
private readonly InternApplicationRepository $internApplicationRepository,
|
|
||||||
private readonly AnnouncementRepository $skillRepository,
|
|
||||||
){}
|
|
||||||
#[Route(name: 'app_skill_index', methods: ['GET'])]
|
#[Route(name: 'app_skill_index', methods: ['GET'])]
|
||||||
public function index(): Response
|
public function index(SkillRepository $skillRepository): Response
|
||||||
{
|
{
|
||||||
return $this->render('skill/index.html.twig', [
|
return $this->render('skill/index.html.twig', [
|
||||||
'skills' => $this->skillRepository->findAll(),
|
'skills' => $skillRepository->findAll(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/new', name: 'app_skill_new', methods: ['GET', 'POST'])]
|
#[Route('/new', name: 'app_skill_new', methods: ['GET', 'POST'])]
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
public function new(Request $request,): Response
|
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$skill = new Skill();
|
$skill = new Skill();
|
||||||
$form = $this->createForm(SkillType::class, $skill);
|
$form = $this->createForm(SkillType::class, $skill);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->entityManager->persist($skill);
|
$entityManager->persist($skill);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_skill_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_skill_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -61,13 +54,13 @@ final class SkillController extends AbstractController
|
|||||||
|
|
||||||
#[Route('/{id}/edit', name: 'app_skill_edit', methods: ['GET', 'POST'])]
|
#[Route('/{id}/edit', name: 'app_skill_edit', methods: ['GET', 'POST'])]
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
public function edit(Request $request, Skill $skill,): Response
|
public function edit(Request $request, Skill $skill, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$form = $this->createForm(SkillType::class, $skill);
|
$form = $this->createForm(SkillType::class, $skill);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_skill_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_skill_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -80,11 +73,11 @@ final class SkillController extends AbstractController
|
|||||||
|
|
||||||
#[Route('/{id}', name: 'app_skill_delete', methods: ['POST'])]
|
#[Route('/{id}', name: 'app_skill_delete', methods: ['POST'])]
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
#[IsGranted('ROLE_ADMIN')]
|
||||||
public function delete(Request $request, Skill $skill,): Response
|
public function delete(Request $request, Skill $skill, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
if ($this->isCsrfTokenValid('delete'.$skill->getId(), $request->getPayload()->getString('_token'))) {
|
if ($this->isCsrfTokenValid('delete'.$skill->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
$this->entityManager->remove($skill);
|
$entityManager->remove($skill);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('app_skill_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_skill_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
@ -4,7 +4,6 @@ namespace App\Controller;
|
|||||||
|
|
||||||
use App\Entity\UserApp;
|
use App\Entity\UserApp;
|
||||||
use App\Form\UserAppType;
|
use App\Form\UserAppType;
|
||||||
use App\Repository\AnnouncementRepository;
|
|
||||||
use App\Repository\UserRepository;
|
use App\Repository\UserRepository;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
@ -15,16 +14,11 @@ use Symfony\Component\Routing\Attribute\Route;
|
|||||||
#[Route('/user')]
|
#[Route('/user')]
|
||||||
final class UserAppController extends AbstractController
|
final class UserAppController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
private readonly AnnouncementRepository $announcementRepository,
|
|
||||||
private readonly UserRepository $userRepository,
|
|
||||||
){}
|
|
||||||
#[Route(name: 'app_user_index', methods: ['GET'])]
|
#[Route(name: 'app_user_index', methods: ['GET'])]
|
||||||
public function index(): Response
|
public function index(UserRepository $userRepository): Response
|
||||||
{
|
{
|
||||||
return $this->render('user_app/index.html.twig', [
|
return $this->render('user_app/index.html.twig', [
|
||||||
'user_apps' => $this->userRepository->findAll(),
|
'user_apps' => $userRepository->findAll(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,13 +31,13 @@ final class UserAppController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}/edit', name: 'app_user_edit', methods: ['GET', 'POST'])]
|
#[Route('/{id}/edit', name: 'app_user_edit', methods: ['GET', 'POST'])]
|
||||||
public function edit(Request $request, UserApp $userApp,): Response
|
public function edit(Request $request, UserApp $userApp, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$form = $this->createForm(UserAppType::class, $userApp);
|
$form = $this->createForm(UserAppType::class, $userApp);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
@ -55,11 +49,11 @@ final class UserAppController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}', name: 'app_user_delete', methods: ['POST'])]
|
#[Route('/{id}', name: 'app_user_delete', methods: ['POST'])]
|
||||||
public function delete(Request $request, UserApp $userApp,): Response
|
public function delete(Request $request, UserApp $userApp, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
if ($this->isCsrfTokenValid('delete'.$userApp->getId(), $request->getPayload()->getString('_token'))) {
|
if ($this->isCsrfTokenValid('delete'.$userApp->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
$this->entityManager->remove($userApp);
|
$entityManager->remove($userApp);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
57
src/Entity/Annonce.php
Normal file
57
src/Entity/Annonce.php
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\AnnonceRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: AnnonceRepository::class)]
|
||||||
|
class Annonce
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Titre = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Description = null;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(int $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitre(): ?string
|
||||||
|
{
|
||||||
|
return $this->Titre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setTitre(string $Titre): static
|
||||||
|
{
|
||||||
|
$this->Titre = $Titre;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription(): ?string
|
||||||
|
{
|
||||||
|
return $this->Description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDescription(string $Description): static
|
||||||
|
{
|
||||||
|
$this->Description = $Description;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,6 @@ use Doctrine\Common\Collections\ArrayCollection;
|
|||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
|
||||||
#[ORM\Entity(repositoryClass: CompanyRepository::class)]
|
#[ORM\Entity(repositoryClass: CompanyRepository::class)]
|
||||||
class Company
|
class Company
|
||||||
{
|
{
|
||||||
|
42
src/Entity/Competence.php
Normal file
42
src/Entity/Competence.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\CompetenceRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: CompetenceRepository::class)]
|
||||||
|
class Competence
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Libelle = null;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(int $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLibelle(): ?string
|
||||||
|
{
|
||||||
|
return $this->Libelle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLibelle(string $Libelle): static
|
||||||
|
{
|
||||||
|
$this->Libelle = $Libelle;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
65
src/Entity/Demandeur.php
Normal file
65
src/Entity/Demandeur.php
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\DemandeurRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: DemandeurRepository::class)]
|
||||||
|
class Demandeur
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $LM = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $CV = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Mail = null;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLM(): ?string
|
||||||
|
{
|
||||||
|
return $this->LM;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLM(string $LM): static
|
||||||
|
{
|
||||||
|
$this->LM = $LM;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCV(): ?string
|
||||||
|
{
|
||||||
|
return $this->CV;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCV(string $CV): static
|
||||||
|
{
|
||||||
|
$this->CV = $CV;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMail(): ?string
|
||||||
|
{
|
||||||
|
return $this->Mail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMail(string $Mail): static
|
||||||
|
{
|
||||||
|
$this->Mail = $Mail;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
42
src/Entity/Diplome.php
Normal file
42
src/Entity/Diplome.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\DiplomeRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: DiplomeRepository::class)]
|
||||||
|
class Diplome
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Libelle = null;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(int $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLibelle(): ?string
|
||||||
|
{
|
||||||
|
return $this->Libelle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLibelle(string $Libelle): static
|
||||||
|
{
|
||||||
|
$this->Libelle = $Libelle;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
35
src/Entity/Employe.php
Normal file
35
src/Entity/Employe.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\EmployeRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: EmployeRepository::class)]
|
||||||
|
class Employe
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Mail = null;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMail(): ?string
|
||||||
|
{
|
||||||
|
return $this->Mail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMail(string $Mail): static
|
||||||
|
{
|
||||||
|
$this->Mail = $Mail;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
87
src/Entity/Entreprise.php
Normal file
87
src/Entity/Entreprise.php
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\EntrepriseRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: EntrepriseRepository::class)]
|
||||||
|
class Entreprise
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Nom = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Adresse = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Tel = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Mail = null;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(int $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getNom(): ?string
|
||||||
|
{
|
||||||
|
return $this->Nom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setNom(string $Nom): static
|
||||||
|
{
|
||||||
|
$this->Nom = $Nom;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAdresse(): ?string
|
||||||
|
{
|
||||||
|
return $this->Adresse;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setAdresse(string $Adresse): static
|
||||||
|
{
|
||||||
|
$this->Adresse = $Adresse;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTel(): ?string
|
||||||
|
{
|
||||||
|
return $this->Tel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setTel(string $Tel): static
|
||||||
|
{
|
||||||
|
$this->Tel = $Tel;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMail(): ?string
|
||||||
|
{
|
||||||
|
return $this->Mail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMail(string $Mail): static
|
||||||
|
{
|
||||||
|
$this->Mail = $Mail;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
36
src/Entity/Formulaire.php
Normal file
36
src/Entity/Formulaire.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\FormulaireRepository;
|
||||||
|
use Doctrine\DBAL\Types\Types;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: FormulaireRepository::class)]
|
||||||
|
class Formulaire
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(type: Types::DATE_MUTABLE)]
|
||||||
|
private ?\DateTimeInterface $Date = null;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDate(): ?\DateTimeInterface
|
||||||
|
{
|
||||||
|
return $this->Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDate(\DateTimeInterface $Date): static
|
||||||
|
{
|
||||||
|
$this->Date = $Date;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,6 @@ use Doctrine\Common\Collections\ArrayCollection;
|
|||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\DBAL\Types\Types;
|
use Doctrine\DBAL\Types\Types;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
use App\Entity\Company;
|
|
||||||
|
|
||||||
#[ORM\Entity(repositoryClass: InternRepository::class)]
|
#[ORM\Entity(repositoryClass: InternRepository::class)]
|
||||||
class Intern extends UserApp
|
class Intern extends UserApp
|
||||||
@ -192,22 +191,6 @@ class Intern extends UserApp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
#[ORM\ManyToOne(targetEntity: Company::class)]
|
|
||||||
#[ORM\JoinColumn(nullable: false)]
|
|
||||||
private ?Company $company = null;
|
|
||||||
|
|
||||||
// Getter et setter pour la société
|
|
||||||
public function getCompany(): ?Company
|
|
||||||
{
|
|
||||||
return $this->company;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setCompany(?Company $company): self
|
|
||||||
{
|
|
||||||
$this->company = $company;
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,6 @@ class InternApplication
|
|||||||
#[ORM\Column(type: Types::DATE_MUTABLE)]
|
#[ORM\Column(type: Types::DATE_MUTABLE)]
|
||||||
private ?\DateTimeInterface $applicationDate = null;
|
private ?\DateTimeInterface $applicationDate = null;
|
||||||
|
|
||||||
#[ORM\Column(length: 20)]
|
|
||||||
private ?string $status = null;
|
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
@ -66,14 +63,4 @@ class InternApplication
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStatus(): ?string
|
|
||||||
{
|
|
||||||
return $this->status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setStatus(?string $status): void
|
|
||||||
{
|
|
||||||
$this->status = $status;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
36
src/Entity/Liste.php
Normal file
36
src/Entity/Liste.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\ListeRepository;
|
||||||
|
use Doctrine\DBAL\Types\Types;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: ListeRepository::class)]
|
||||||
|
class Liste
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(type: Types::DATE_MUTABLE)]
|
||||||
|
private ?\DateTimeInterface $Date = null;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDate(): ?\DateTimeInterface
|
||||||
|
{
|
||||||
|
return $this->Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDate(\DateTimeInterface $Date): static
|
||||||
|
{
|
||||||
|
$this->Date = $Date;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,6 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||||
use Symfony\Component\Security\Core\User\UserInterface;
|
use Symfony\Component\Security\Core\User\UserInterface;
|
||||||
use App\Entity\Entreprise;
|
|
||||||
|
|
||||||
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||||
#[ORM\Table(name: 'userApp')]
|
#[ORM\Table(name: 'userApp')]
|
||||||
@ -187,7 +186,6 @@ class UserApp implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
135
src/Entity/Utilisateur.php
Normal file
135
src/Entity/Utilisateur.php
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\UtilisateurRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: UtilisateurRepository::class)]
|
||||||
|
class Utilisateur
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Nom = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Prenom = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Tel = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Adresse = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Ajout de la relation OneToMany
|
||||||
|
#[ORM\OneToMany(targetEntity: Message::class, mappedBy: 'utilisateur')]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private Collection $messages;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->messages = new ArrayCollection();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(int $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getNom(): ?string
|
||||||
|
{
|
||||||
|
return $this->Nom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setNom(string $Nom): static
|
||||||
|
{
|
||||||
|
$this->Nom = $Nom;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPrenom(): ?string
|
||||||
|
{
|
||||||
|
return $this->Prenom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPrenom(string $Prenom): static
|
||||||
|
{
|
||||||
|
$this->Prenom = $Prenom;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTel(): ?string
|
||||||
|
{
|
||||||
|
return $this->Tel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setTel(string $Tel): static
|
||||||
|
{
|
||||||
|
$this->Tel = $Tel;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAdresse(): ?string
|
||||||
|
{
|
||||||
|
return $this->Adresse;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setAdresse(string $Adresse): static
|
||||||
|
{
|
||||||
|
$this->Adresse = $Adresse;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getter et setter pour la relation avec Message
|
||||||
|
/**
|
||||||
|
* @return Collection<int, Message>
|
||||||
|
*/
|
||||||
|
public function getMessages(): Collection
|
||||||
|
{
|
||||||
|
return $this->messages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addMessage(Message $message): static
|
||||||
|
{
|
||||||
|
if (!$this->messages->contains($message)) {
|
||||||
|
$this->messages[] = $message;
|
||||||
|
$message->setUtilisateur($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeMessage(Message $message): static
|
||||||
|
{
|
||||||
|
if ($this->messages->removeElement($message)) {
|
||||||
|
if ($message->getUtilisateur() === $this) {
|
||||||
|
$message->setUtilisateur(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
42
src/Entity/Verifie.php
Normal file
42
src/Entity/Verifie.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\VerifieRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: VerifieRepository::class)]
|
||||||
|
class Verifie
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $Libelle = null;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(int $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLibelle(): ?string
|
||||||
|
{
|
||||||
|
return $this->Libelle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLibelle(string $Libelle): static
|
||||||
|
{
|
||||||
|
$this->Libelle = $Libelle;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
@ -15,19 +15,12 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
use Symfony\Component\Validator\Constraints\IsTrue;
|
use Symfony\Component\Validator\Constraints\IsTrue;
|
||||||
use Symfony\Component\Validator\Constraints\Length;
|
use Symfony\Component\Validator\Constraints\Length;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use App\Entity\Company;
|
|
||||||
use App\Entity\Intern;
|
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|
||||||
use Doctrine\ORM\EntityRepository;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
||||||
|
|
||||||
|
|
||||||
class RegistrationFormType extends AbstractType
|
class RegistrationFormType extends AbstractType
|
||||||
{
|
{
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
|
|
||||||
->add('nickname', TextType::class, [
|
->add('nickname', TextType::class, [
|
||||||
'label' => 'Utilisateur : ',
|
'label' => 'Utilisateur : ',
|
||||||
])
|
])
|
||||||
@ -52,7 +45,10 @@ class RegistrationFormType extends AbstractType
|
|||||||
new NotBlank(),
|
new NotBlank(),
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
|
//
|
||||||
->add('plainPassword', PasswordType::class, [
|
->add('plainPassword', PasswordType::class, [
|
||||||
|
// instead of being set onto the object directly,
|
||||||
|
// this is read and encoded in the controller
|
||||||
'mapped' => false,
|
'mapped' => false,
|
||||||
'attr' => ['autocomplete' => 'new-password'],
|
'attr' => ['autocomplete' => 'new-password'],
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
@ -62,10 +58,12 @@ class RegistrationFormType extends AbstractType
|
|||||||
new Length([
|
new Length([
|
||||||
'min' => 6,
|
'min' => 6,
|
||||||
'minMessage' => 'Votre mot de passe doit avoir au moins {{ limit }} caractères',
|
'minMessage' => 'Votre mot de passe doit avoir au moins {{ limit }} caractères',
|
||||||
|
// max length allowed by Symfony for security reasons
|
||||||
'max' => 4096,
|
'max' => 4096,
|
||||||
]),
|
]),
|
||||||
],
|
],
|
||||||
]);
|
])
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver): void
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
|
43
src/Repository/AnnonceRepository.php
Normal file
43
src/Repository/AnnonceRepository.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Annonce;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Annonce>
|
||||||
|
*/
|
||||||
|
class AnnonceRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Annonce::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Annonce[] Returns an array of Annonce objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('a')
|
||||||
|
// ->andWhere('a.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('a.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Annonce
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('a')
|
||||||
|
// ->andWhere('a.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
43
src/Repository/CompetenceRepository.php
Normal file
43
src/Repository/CompetenceRepository.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Competence;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Competence>
|
||||||
|
*/
|
||||||
|
class CompetenceRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Competence::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Competence[] Returns an array of Competence objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('c')
|
||||||
|
// ->andWhere('c.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('c.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Competence
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('c')
|
||||||
|
// ->andWhere('c.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
43
src/Repository/DemandeurRepository.php
Normal file
43
src/Repository/DemandeurRepository.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Demandeur;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Demandeur>
|
||||||
|
*/
|
||||||
|
class DemandeurRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Demandeur::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Demandeur[] Returns an array of Demandeur objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('d')
|
||||||
|
// ->andWhere('d.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('d.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Demandeur
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('d')
|
||||||
|
// ->andWhere('d.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
43
src/Repository/DiplomeRepository.php
Normal file
43
src/Repository/DiplomeRepository.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Diplome;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Diplome>
|
||||||
|
*/
|
||||||
|
class DiplomeRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Diplome::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Diplome[] Returns an array of Diplome objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('d')
|
||||||
|
// ->andWhere('d.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('d.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Diplome
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('d')
|
||||||
|
// ->andWhere('d.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
43
src/Repository/EmployeRepository.php
Normal file
43
src/Repository/EmployeRepository.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Employe;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Employe>
|
||||||
|
*/
|
||||||
|
class EmployeRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Employe::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Employe[] Returns an array of Employe objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('e')
|
||||||
|
// ->andWhere('e.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('e.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Employe
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('e')
|
||||||
|
// ->andWhere('e.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
43
src/Repository/EntrepriseRepository.php
Normal file
43
src/Repository/EntrepriseRepository.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Entreprise;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Entreprise>
|
||||||
|
*/
|
||||||
|
class EntrepriseRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Entreprise::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Entreprise[] Returns an array of Entreprise objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('e')
|
||||||
|
// ->andWhere('e.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('e.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Entreprise
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('e')
|
||||||
|
// ->andWhere('e.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
43
src/Repository/FormulaireRepository.php
Normal file
43
src/Repository/FormulaireRepository.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Formulaire;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Formulaire>
|
||||||
|
*/
|
||||||
|
class FormulaireRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Formulaire::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Formulaire[] Returns an array of Formulaire objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('f')
|
||||||
|
// ->andWhere('f.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('f.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Formulaire
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('f')
|
||||||
|
// ->andWhere('f.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
43
src/Repository/ListeRepository.php
Normal file
43
src/Repository/ListeRepository.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Liste;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Liste>
|
||||||
|
*/
|
||||||
|
class ListeRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Liste::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Liste[] Returns an array of Liste objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('l')
|
||||||
|
// ->andWhere('l.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('l.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Liste
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('l')
|
||||||
|
// ->andWhere('l.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
43
src/Repository/UtilisateurRepository.php
Normal file
43
src/Repository/UtilisateurRepository.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Utilisateur;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Utilisateur>
|
||||||
|
*/
|
||||||
|
class UtilisateurRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Utilisateur::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Utilisateur[] Returns an array of Utilisateur objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('u')
|
||||||
|
// ->andWhere('u.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('u.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Utilisateur
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('u')
|
||||||
|
// ->andWhere('u.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
43
src/Repository/VerifieRepository.php
Normal file
43
src/Repository/VerifieRepository.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Verifie;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Verifie>
|
||||||
|
*/
|
||||||
|
class VerifieRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Verifie::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Verifie[] Returns an array of Verifie objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('v')
|
||||||
|
// ->andWhere('v.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('v.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Verifie
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('v')
|
||||||
|
// ->andWhere('v.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
@ -52,34 +52,6 @@
|
|||||||
<span>{{ announcement.creationDate | date('d/m/Y') }}</span>
|
<span>{{ announcement.creationDate | date('d/m/Y') }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if 'ROLE_INTERN' in app.user.roles %}
|
|
||||||
<form method="post" action="{{ path('app_intern_send_application') }}">
|
|
||||||
<input type="hidden" name="announcement_id" value="{{ announcement.id }}">
|
|
||||||
<button type="submit" class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded">
|
|
||||||
<i class="fas fa-paper-plane"></i> Candidater à cette offre
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if 'ROLE_ADMIN' in app.user.roles %}
|
|
||||||
|
|
||||||
<!-- Boutons Modifier et Valider -->
|
|
||||||
<div class="mt-4 flex space-x-4">
|
|
||||||
<a href="{{ path('app_announcement_edit', { id: announcement.id }) }}"
|
|
||||||
class="bg-teal-500 text-white px-4 py-2 rounded hover:bg-teal-600">
|
|
||||||
Modifier l'annonce
|
|
||||||
</a>
|
|
||||||
|
|
||||||
{% if announcement.status == 'notVerified' %}
|
|
||||||
<form method="post" action="{{ path('app_announcement_validate', { id: announcement.id }) }}">
|
|
||||||
<button type="submit" class="bg-green-500 text-white px-4 py-2 rounded hover:bg-green-600">
|
|
||||||
Valider l'annonce
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
<!-- Vérifier si c'est un favori -->
|
<!-- Vérifier si c'est un favori -->
|
||||||
<form method="post" action="{{ path(isFavorite ? 'app_favorite_remove' : 'app_favorite_add', {id: announcement.id}) }}">
|
<form method="post" action="{{ path(isFavorite ? 'app_favorite_remove' : 'app_favorite_add', {id: announcement.id}) }}">
|
||||||
<button type="submit" class="text-yellow-500">
|
<button type="submit" class="text-yellow-500">
|
||||||
|
@ -28,8 +28,7 @@
|
|||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2">
|
||||||
{% if 'ROLE_INTERN' in app.user.roles %}
|
{% if 'ROLE_INTERN' in app.user.roles %}
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="selected_degrees[]" value="{{ degree.id }}"
|
<input type="checkbox" name="selected_degrees[]" value="{{ degree.id }}" class="mr-2">
|
||||||
class="mr-2">
|
|
||||||
Sélectionner
|
Sélectionner
|
||||||
</label>
|
</label>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -68,8 +67,7 @@
|
|||||||
{% if 'ROLE_ADMIN' in app.user.roles %}
|
{% if 'ROLE_ADMIN' in app.user.roles %}
|
||||||
<!-- Lien pour ajouter un nouveau diplôme -->
|
<!-- Lien pour ajouter un nouveau diplôme -->
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<a href="{{ path('app_degree_new') }}" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4
|
<a href="{{ path('app_degree_new') }}" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full">
|
||||||
rounded-full">
|
|
||||||
<i class="fas fa-plus-circle"></i> Ajouter un nouveau diplôme
|
<i class="fas fa-plus-circle"></i> Ajouter un nouveau diplôme
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Liste des Candidatures{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<h2 class="text-2xl font-bold mb-6">Candidatures reçues</h2>
|
|
||||||
|
|
||||||
{% for app in applications %}
|
|
||||||
<div class="border border-gray-300 rounded-lg p-4 mb-4 shadow-sm bg-white">
|
|
||||||
<p><strong>Annonce :</strong> {{ app.application.title }}</p>
|
|
||||||
<p><strong>Candidat :</strong> {{ app.intern.firstName }} {{ app.intern.lastName }}</p>
|
|
||||||
<p><strong>Date :</strong> {{ app.applicationDate|date('d/m/Y') }}</p>
|
|
||||||
<p><strong>Statut :</strong> {{ app.status }}</p>
|
|
||||||
|
|
||||||
<a href="{{ path('app_profile_visit', { id: app.intern.id }) }}"
|
|
||||||
class="inline-block mt-2 bg-teal-500 hover:bg-teal-600 text-white px-4 py-2 rounded">
|
|
||||||
Voir le profil du candidat
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
<p>Aucune candidature pour le moment.</p>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@ -8,12 +8,6 @@
|
|||||||
<p class="text-gray-600">Téléphone : {{ app.user.tel }}</p>
|
<p class="text-gray-600">Téléphone : {{ app.user.tel }}</p>
|
||||||
<p class="text-gray-600">Email : {{ app.user.mail }}</p>
|
<p class="text-gray-600">Email : {{ app.user.mail }}</p>
|
||||||
|
|
||||||
<a href="{{ path('app_employee_seeApplications') }}"
|
|
||||||
class="bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded">
|
|
||||||
Voir les candidatures reçues
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="flex justify-end mt-6">
|
<div class="flex justify-end mt-6">
|
||||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
|
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
|
||||||
href="{{ path('app_profile_edit',{id: app.user.id}) }}"> Modifier
|
href="{{ path('app_profile_edit',{id: app.user.id}) }}"> Modifier
|
||||||
|
@ -46,25 +46,6 @@
|
|||||||
href="{{ path('app_user_edit',{id: app.user.id}) }}"> Accéder aux favoris
|
href="{{ path('app_user_edit',{id: app.user.id}) }}"> Accéder aux favoris
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="text-lg font-semibold mt-6">Vos candidatures :</h3>
|
|
||||||
|
|
||||||
{% if applications|length > 0 %}
|
|
||||||
<ul class="space-y-4 mt-2">
|
|
||||||
{% for appli in applications %}
|
|
||||||
<div class="border border-gray-300 bg-gray-50 p-4 rounded-lg shadow-sm">
|
|
||||||
<p><strong>Offre :</strong> {{ appli.application.title }}</p>
|
|
||||||
<p><strong>Entreprise :</strong> {{ appli.application.company.name }}</p>
|
|
||||||
<p><strong>Date de candidature :</strong> {{ appli.applicationDate|date('d/m/Y') }}</p>
|
|
||||||
<p><strong>Statut :</strong> {{ appli.status }}</p>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
{% else %}
|
|
||||||
<p class="text-gray-600">Vous n'avez pas encore postulé à une offre.</p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
|
||||||
<div class="flex justify-end mt-6">
|
<div class="flex justify-end mt-6">
|
||||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
|
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
|
||||||
href="{{ path('app_profile_edit',{id: app.user.id}) }}"> Modifier
|
href="{{ path('app_profile_edit',{id: app.user.id}) }}"> Modifier
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Profil du candidat{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<div class="max-w-3xl mx-auto mt-8 bg-white p-6 rounded-lg shadow-lg border border-gray-300">
|
|
||||||
<h2 class="text-2xl font-bold mb-4">Profil du candidat</h2>
|
|
||||||
|
|
||||||
<div class="mb-4">
|
|
||||||
<p><strong>Nom :</strong> {{ user.lastName }}</p>
|
|
||||||
<p><strong>Prénom :</strong> {{ user.firstName }}</p>
|
|
||||||
<p><strong>Email :</strong> {{ user.mail }}</p>
|
|
||||||
<p><strong>Téléphone :</strong> {{ user.tel }}</p>
|
|
||||||
<p><strong>Adresse :</strong> {{ user.address }}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-4">
|
|
||||||
<h3 class="text-xl font-semibold">Diplômes</h3>
|
|
||||||
<ul class="list-disc list-inside text-gray-800 mt-2">
|
|
||||||
{% if user.degrees|length > 0 %}
|
|
||||||
{% for deg in user.degrees %}
|
|
||||||
<li>
|
|
||||||
{{ deg.degree.label }} — Obtenu le {{ deg.graduationDate|date('d/m/Y') }}
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
{% else %}
|
|
||||||
<p class="text-gray-500 mt-2">Aucun diplôme renseigné.</p>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-4">
|
|
||||||
<h3 class="text-xl font-semibold">Compétences</h3>
|
|
||||||
<ul class="list-disc list-inside text-gray-800 mt-2">
|
|
||||||
{% if user.skills|length > 0 %}
|
|
||||||
{% for skill in user.skills %}
|
|
||||||
<li>{{ skill.label }}</li>
|
|
||||||
{% endfor %}
|
|
||||||
{% else %}
|
|
||||||
<p class="text-gray-500 mt-2">Aucune compétence renseignée.</p>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mt-6">
|
|
||||||
<a href="{{ path('app_index') }}"
|
|
||||||
class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full">
|
|
||||||
Retour à l'accueil
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
@ -36,15 +36,6 @@
|
|||||||
{{ form_errors(registrationForm.mail) }}
|
{{ form_errors(registrationForm.mail) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if employee %}
|
|
||||||
<div class="mb-4">
|
|
||||||
{{ form_label(registrationForm.company, 'Sélectionnez une entreprise', {'label_attr': {'class': 'block text-gray-700 mb-2'}}) }}
|
|
||||||
{{ form_widget(registrationForm.company, {'attr': {'class': 'w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
|
||||||
{{ form_errors(registrationForm.company) }}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<!-- Mot de passe -->
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
{{ form_label(registrationForm.plainPassword, 'Mot de passe', {'label_attr': {'class': 'block text-gray-700 mb-2'}}) }}
|
{{ form_label(registrationForm.plainPassword, 'Mot de passe', {'label_attr': {'class': 'block text-gray-700 mb-2'}}) }}
|
||||||
{{ form_widget(registrationForm.plainPassword, {'attr': {'class': 'w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
{{ form_widget(registrationForm.plainPassword, {'attr': {'class': 'w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user