Compare commits

...

81 Commits

Author SHA1 Message Date
09b84379bf recuperation branche oscar 2025-04-08 08:51:54 +02:00
bourgoino
643d5d451a Sélection de compétences. 2025-04-08 08:41:54 +02:00
bourgoino
806044e990 Sélection de compétences. 2025-04-08 08:41:10 +02:00
bourgoino
57a8eba238 Sélection de compétences. 2025-04-08 08:11:56 +02:00
89e0dd4d58 remise au propre branche oscar 2025-04-04 10:28:54 +02:00
7ba2db3d92 Merge branch 'develop' of https://gitea.btssio-poitiers.fr/barillote/hegresphere 2025-04-04 10:26:34 +02:00
234ff39db1 Merge branch 'romain' of https://gitea.btssio-poitiers.fr/barillote/hegresphere into develop 2025-04-04 10:25:36 +02:00
ef25e03cce Merge branch 'romain'
mise a jour du git
2025-04-04 09:00:57 +02:00
9f485f9637 Merge branch 'romain' into develop
fusion pour mettre au propre le git
2025-04-04 08:55:58 +02:00
84397a1028 merge global 2025-04-03 17:43:25 +02:00
d091513600 Merge branch 'romain' into develop
# Conflicts:
#	composer.lock
#	src/Entity/FAQ.php
#	src/Entity/Message.php
#	src/Repository/FAQRepository.php
#	src/Repository/MessageRepository.php
2025-04-03 17:13:47 +02:00
3c117d8e4c le film de minecraft 2025-04-03 14:14:24 +02:00
e222786096 Résolution conflits 2024-12-20 10:39:57 +01:00
bourgoino
9074447216 mhh meuwhhhh 2024-12-12 17:08:34 +01:00
bourgoino
c1a79f7621 messagerio de jannero TATATATADATA 2024-12-12 17:04:38 +01:00
bourgoino
d6d0a9bbad fixation beton 2024-12-12 17:04:38 +01:00
bourgoino
549d0c5bfc la derniere goute de pluie d'eau froide 2024-12-12 17:04:38 +01:00
bourgoino
ebb799bcb8 laisse la 2024-12-12 17:04:37 +01:00
a52c5adb83 profil + routes 2024-12-12 17:04:36 +01:00
c5cec0fa04 plus qu'un 2024-12-12 17:04:36 +01:00
cb867ba8bb moins confiant mais on est la 2024-12-12 17:04:36 +01:00
1567570d12 tqt encore ++ 2024-12-12 17:04:36 +01:00
0e2a2f25f6 ajout diplome et message + gestion des relations 2024-12-12 17:04:36 +01:00
65f5c8cce4 tqtencore
tjr
2024-12-12 17:04:36 +01:00
f244e51aa7 ya des entite tkt 2024-12-12 17:04:36 +01:00
bourgoino
12ac37c97e estebouche attrape ! 2024-12-12 17:04:36 +01:00
80f18f7fc8 message 2024-12-12 17:04:35 +01:00
9a75d46972 ff 2024-12-12 17:04:32 +01:00
f3a44047c4 fusion 2024-12-12 17:04:29 +01:00
c1ea94eb95 profile ++ 2024-12-12 17:04:25 +01:00
e96b410627 profil + routes 2024-12-12 17:04:22 +01:00
1bc9610b75 harmonisation style 2024-12-12 17:04:19 +01:00
f5c0954435 Login Register 2024-12-12 17:04:13 +01:00
e9f74aa3bf Supprimer .idea/.gitignore 2024-12-12 17:03:27 +01:00
e297480fae jvais t'embrasser 2024-12-12 17:03:07 +01:00
bourgoino
579a56c53f fixation beton 2024-12-09 15:47:20 +01:00
bourgoino
a0e50bf187 la derniere goute de pluie d'eau froide 2024-12-06 08:06:44 +01:00
bourgoino
f7c08a5c98 faqq 2024-12-05 17:20:42 +01:00
bourgoino
3cf9ab3bed skillzzz 2024-12-05 16:56:04 +01:00
bourgoino
ae335524db interfesse 2024-12-05 16:56:04 +01:00
bourgoino
9e49da7775 tkt 2024-12-05 16:56:04 +01:00
bourgoino
432d7ba4de laisse la 2024-12-05 16:56:04 +01:00
f8569d8db3 profil + routes 2024-12-05 16:56:04 +01:00
3eca8a4421 fin jeudi 2024-12-05 16:56:04 +01:00
b702ca50ed plus qu'un 2024-12-05 16:55:58 +01:00
9369682362 adaptation page index et page register 2024-12-05 16:55:57 +01:00
9efc4931f9 formregister 2024-12-05 16:55:57 +01:00
a6d83640bd login 2024-12-05 16:55:57 +01:00
ddf458e44c roles 2024-12-05 16:55:57 +01:00
2be0e352ef moins confiant mais on est la 2024-12-05 16:55:48 +01:00
9ec6a67a92 tqt encore ++ 2024-12-05 16:55:40 +01:00
e083dc1cec ajout diplome et message + gestion des relations 2024-12-05 16:55:38 +01:00
ac42fb9f85 tqtencore
tjr
2024-12-05 16:55:28 +01:00
c84c7c4c49 remise à z de la branche 2024-12-05 16:55:24 +01:00
c93e5af9e3 index de l'appli 2024-12-05 16:55:24 +01:00
18dd03a84b vues twig 2024-12-05 16:55:24 +01:00
d4c858474c controllers 2024-12-05 16:55:24 +01:00
e153266b65 ajout FAQ + premiers controller / vues / formulaire pour annonce 2024-12-05 16:55:24 +01:00
bfbccea96f ajout diplome et message + gestion des relations 2024-12-05 16:55:24 +01:00
007935cea6 ya des entite tkt 2024-12-05 16:55:24 +01:00
ALLAVENA--VALETTE Romain
ea5be39a2e tqt 2024-12-05 16:55:19 +01:00
bourgoino
562b343063 estebouche attrape ! 2024-10-17 16:38:47 +02:00
925cbaf3ee Supprimer .idea/phpunit.xml 2024-10-03 15:52:35 +02:00
172c1f7980 Supprimer .idea/vcs.xml 2024-10-03 15:52:31 +02:00
4e066f9b81 Supprimer .idea/workspace.xml 2024-10-03 15:52:27 +02:00
24903c0b5e Supprimer .idea/phpspec.xml 2024-10-03 15:52:24 +02:00
dd4e9bcbca Supprimer .idea/php.xml 2024-10-03 15:52:20 +02:00
1ea636a7cb Supprimer .idea/modules.xml 2024-10-03 15:52:17 +02:00
0502a3586f Supprimer .idea/HegreSphere.iml 2024-10-03 15:52:13 +02:00
0f6093cb94 Supprimer .idea/codeception.xml 2024-10-03 15:52:04 +02:00
fdb13252ea Supprimer .idea/shelf/Uncommitted_changes_before_Checkout_at_03_10_2024_14_52_[Changes]1/shelved.patch 2024-10-03 15:51:59 +02:00
07ce4819ed Supprimer .idea/shelf/Uncommitted_changes_before_Checkout_at_03_10_2024_14_55_[Changes]/shelved.patch 2024-10-03 15:51:54 +02:00
e64e435dc9 Supprimer .idea/shelf/Uncommitted_changes_before_Checkout_at_03_10_2024_14_52_[Changes]/shelved.patch 2024-10-03 15:51:49 +02:00
c8bf1d3995 Supprimer .idea/shelf/Uncommitted_changes_before_Checkout_at_03_10_2024_14_52__Changes_1.xml 2024-10-03 15:51:29 +02:00
39cbe354c5 Supprimer .idea/shelf/Uncommitted_changes_before_Checkout_at_03_10_2024_14_52__Changes_.xml 2024-10-03 15:51:26 +02:00
9d4d998309 Supprimer .idea/shelf/Uncommitted_changes_before_Checkout_at_03_10_2024_14_55__Changes_.xml 2024-10-03 15:51:22 +02:00
1ae8d9d18b Supprimer .idea/.gitignore 2024-10-03 15:38:49 +02:00
30ce97e13b Projet repare 2024-10-03 15:18:31 +02:00
d8324fe288 entite to develop 2024-10-03 15:02:56 +02:00
5870f70725 mise à jour composer 2024-10-03 14:58:48 +02:00
bourgoino
c7dbadace5 ajout entités 2024-09-26 17:23:24 +02:00
52 changed files with 1882 additions and 122 deletions

8
.idea/.gitignore generated vendored
View File

@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -1,4 +1,3 @@
services: services:
###> doctrine/doctrine-bundle ### ###> doctrine/doctrine-bundle ###
database: database:
@ -16,3 +15,4 @@ services:
MP_SMTP_AUTH_ACCEPT_ANY: 1 MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1 MP_SMTP_AUTH_ALLOW_INSECURE: 1
###< symfony/mailer ### ###< symfony/mailer ###

View File

@ -1,13 +1,12 @@
services: services:
###> doctrine/doctrine-bundle ### ###> doctrine/doctrine-bundle ###
database: database:
image: postgres:${POSTGRES_VERSION:-16}-alpine image: postgres:${POSTGRES_VERSION:-16}-alpine
environment: environment:
POSTGRES_DB: ${POSTGRES_DB:-app} POSTGRES_DB: ${POSTGRES_DB:-hegresphere}
# You should definitely change the password in production # You should definitely change the password in production
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-Btssio2024}
POSTGRES_USER: ${POSTGRES_USER:-app} POSTGRES_USER: ${POSTGRES_USER:-bourgoino}
healthcheck: healthcheck:
test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"] test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"]
timeout: 5s timeout: 5s
@ -23,3 +22,4 @@ volumes:
###> doctrine/doctrine-bundle ### ###> doctrine/doctrine-bundle ###
database_data: database_data:
###< doctrine/doctrine-bundle ### ###< doctrine/doctrine-bundle ###

View File

@ -42,8 +42,10 @@
"symfony/validator": "7.1.*", "symfony/validator": "7.1.*",
"symfony/web-link": "7.1.*", "symfony/web-link": "7.1.*",
"symfony/yaml": "7.1.*", "symfony/yaml": "7.1.*",
"symfonycasts/sass-bundle": "^0.7.0",
"twig/extra-bundle": "^2.12|^3.0", "twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0" "twig/twig": "^2.12|^3.0",
"ext-http": "*"
}, },
"config": { "config": {
"allow-plugins": { "allow-plugins": {
@ -100,7 +102,7 @@
"symfony/browser-kit": "7.1.*", "symfony/browser-kit": "7.1.*",
"symfony/css-selector": "7.1.*", "symfony/css-selector": "7.1.*",
"symfony/debug-bundle": "7.1.*", "symfony/debug-bundle": "7.1.*",
"symfony/maker-bundle": "^1.0", "symfony/maker-bundle": "^1.61",
"symfony/phpunit-bridge": "^7.1", "symfony/phpunit-bridge": "^7.1",
"symfony/stopwatch": "7.1.*", "symfony/stopwatch": "7.1.*",
"symfony/web-profiler-bundle": "7.1.*" "symfony/web-profiler-bundle": "7.1.*"

57
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "1bc99d81c026aaf4e662ffffde457d04", "content-hash": "39f4377209acc13ab9e977a5301faef0",
"packages": [ "packages": [
{ {
"name": "composer/semver", "name": "composer/semver",
@ -7423,6 +7423,61 @@
], ],
"time": "2025-01-07T12:50:05+00:00" "time": "2025-01-07T12:50:05+00:00"
}, },
{
"name": "symfonycasts/sass-bundle",
"version": "v0.7.0",
"source": {
"type": "git",
"url": "https://github.com/SymfonyCasts/sass-bundle.git",
"reference": "d88601c50eff716d9273dffbd736adefdc19e2fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SymfonyCasts/sass-bundle/zipball/d88601c50eff716d9273dffbd736adefdc19e2fc",
"reference": "d88601c50eff716d9273dffbd736adefdc19e2fc",
"shasum": ""
},
"require": {
"php": ">=8.1",
"symfony/asset-mapper": "^6.3|^7.0",
"symfony/console": "^5.4|^6.3|^7.0",
"symfony/filesystem": "^5.4|^6.3|^7.0",
"symfony/http-client": "^5.4|^6.3|^7.0",
"symfony/process": "^5.4|^6.3|^7.0"
},
"require-dev": {
"matthiasnoback/symfony-config-test": "^5.0",
"phpstan/phpstan-symfony": "^1.4",
"symfony/framework-bundle": "^6.3|^7.0",
"symfony/phpunit-bridge": "^6.3|^7.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Symfonycasts\\SassBundle\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mathéo Daninos",
"homepage": "https://github.com/WebMamba"
}
],
"description": "Delightful Sass Support for Symfony + AssetMapper",
"keywords": [
"asset-mapper",
"sass"
],
"support": {
"issues": "https://github.com/SymfonyCasts/sass-bundle/issues",
"source": "https://github.com/SymfonyCasts/sass-bundle/tree/v0.7.0"
},
"time": "2024-05-22T14:59:07+00:00"
},
{ {
"name": "twig/extra-bundle", "name": "twig/extra-bundle",
"version": "v3.20.0", "version": "v3.20.0",

View File

@ -13,4 +13,5 @@ return [
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Symfonycasts\SassBundle\SymfonycastsSassBundle::class => ['all' => true],
]; ];

View File

@ -4,7 +4,7 @@
# Put parameters here that don't need to change on each machine where the app is deployed # Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration # https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
parameters: parameters:
app.jwtsecret : '%env(JWT_SECRET)%'
services: services:
# default configuration for services in *this* file # default configuration for services in *this* file
_defaults: _defaults:

View File

@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241121141451 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('DROP SEQUENCE status_id_seq CASCADE');
$this->addSql('DROP TABLE status');
$this->addSql('ALTER TABLE userapp ADD is_verified BOOLEAN NOT NULL');
$this->addSql('ALTER TABLE userapp ALTER roles SET NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('CREATE SEQUENCE status_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE status (id INT NOT NULL, label VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('ALTER TABLE userApp DROP is_verified');
$this->addSql('ALTER TABLE userApp ALTER roles DROP NOT NULL');
}
}

View File

@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241121141722 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE userapp ALTER first_name DROP NOT NULL');
$this->addSql('ALTER TABLE userapp ALTER last_name DROP NOT NULL');
$this->addSql('ALTER TABLE userapp ALTER tel DROP NOT NULL');
$this->addSql('ALTER TABLE userapp ALTER address DROP NOT NULL');
$this->addSql('ALTER TABLE userapp ALTER mail DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE userApp ALTER first_name SET NOT NULL');
$this->addSql('ALTER TABLE userApp ALTER last_name SET NOT NULL');
$this->addSql('ALTER TABLE userApp ALTER tel SET NOT NULL');
$this->addSql('ALTER TABLE userApp ALTER address SET NOT NULL');
$this->addSql('ALTER TABLE userApp ALTER mail SET NOT NULL');
}
}

View File

@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241121141818 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
}
}

View File

@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241121141912 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE userapp ALTER is_verified DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE userApp ALTER is_verified SET NOT NULL');
}
}

View File

@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241121142119 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE intern ALTER cover_letter DROP NOT NULL');
$this->addSql('ALTER TABLE intern ALTER resume DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE intern ALTER cover_letter SET NOT NULL');
$this->addSql('ALTER TABLE intern ALTER resume SET NOT NULL');
}
}

View File

@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241121142432 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
}
}

View File

@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241121145353 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE employee ALTER company_id DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE employee ALTER company_id SET NOT NULL');
}
}

7
public/js/map.js Normal file
View File

@ -0,0 +1,7 @@
<script src="{{ asset('js/map.js') }}"></script>
// initialize the map on the "map" div with a given center and zoom
var map = L.map('map', {
center: [51.505, -0.09],
zoom: 13
});

View File

@ -20,7 +20,6 @@ final class AnnouncementController extends AbstractController
$user = $this->getUser(); $user = $this->getUser();
$announcements = []; $announcements = [];
// Récupérer les paramètres de recherche
$companyName = $request->query->get('company_name'); $companyName = $request->query->get('company_name');
$location = $request->query->get('location'); $location = $request->query->get('location');
$category = $request->query->get('category'); $category = $request->query->get('category');
@ -47,18 +46,27 @@ final class AnnouncementController extends AbstractController
$announcements = $announcementRepository->findBy(['status' => 'Verified']); $announcements = $announcementRepository->findBy(['status' => 'Verified']);
} }
// Filtrer les annonces en fonction des critères de recherche
if ($companyName || $location || $category) { if ($companyName || $location || $category) {
$announcements = $announcementRepository->searchAnnouncements($companyName, $location, $category); $announcements = $announcementRepository->searchAnnouncements($companyName, $location, $category);
} }
$favorites = [];
if (in_array('ROLE_INTERN', $user->getRoles())) {
$favorites = array_map(
fn($f) => $f->getAnnouncement()->getId(),
$user->getFavorites()->toArray()
);
}
return $this->render('announcement/index.html.twig', [ return $this->render('announcement/index.html.twig', [
'announcements' => $announcements, 'announcements' => $announcements,
'favorites' => $favorites,
'showNonValidated' => $request->query->get('show_non_validated', false), 'showNonValidated' => $request->query->get('show_non_validated', false),
]); ]);
} }
#[Route('/new', name: 'app_announcement_new', methods: ['GET', 'POST'])] #[Route('/new', name: 'app_announcement_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response public function new(Request $request, EntityManagerInterface $entityManager): Response
{ {

View File

@ -7,6 +7,8 @@ use App\Entity\Degree;
use App\Entity\Intern; use App\Entity\Intern;
use App\Entity\InternApplication; use App\Entity\InternApplication;
use App\Entity\InternDegree; use App\Entity\InternDegree;
use App\Entity\InternSkill;
use App\Entity\Skill;
use App\Form\InternType; use App\Form\InternType;
use App\Repository\InternRepository; use App\Repository\InternRepository;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@ -146,4 +148,50 @@ final class InternController extends AbstractController
return $this->redirectToRoute('app_profile'); return $this->redirectToRoute('app_profile');
} }
#[Route('/skills/add', name:'app_intern_add_skills', methods:['POST'])]
public function addSkills(Request $request, EntityManagerInterface $entityManager): Response
{
$intern = $this->getUser();
if (!$intern instanceof Intern) {
throw $this->createAccessDeniedException("Seuls les stagiaires peuvent sélectionner des compétences.");
}
$selectedSkillIds = $request->request->all('selected_skills');
if ($selectedSkillIds == []) {
$this->addFlash('error', "Aucune sélection valide n'a été effectuée.");
return $this->redirectToRoute('app_skill_index');
}
$skillRepository = $entityManager->getRepository(Skill::class);
$internSkillRepository = $entityManager->getRepository(InternSkill::class);
foreach ($selectedSkillIds as $skillId) {
$skill = $skillRepository->find($skillId);
if (!$skill) continue;
$existingInternSkill = $internSkillRepository->findOneBy([
'intern' => $intern,
'skill' => $skill
]);
if (!$existingInternSkill) {
$internSkill = new InternSkill();
$internSkill->setIntern($intern);
$internSkill->setSkill($skill);
$entityManager->persist($internSkill);
}
}
$entityManager->flush();
$this->addFlash('success', 'Les compétences ont été ajoutées avec succès.');
return $this->redirectToRoute('app_profile');
}
} }

View File

@ -0,0 +1,136 @@
<?php
namespace App\Controller;
use App\Entity\Announcement;
use App\Entity\Intern;
use App\Entity\InternFavorite;
use App\Repository\InternFavoriteRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class InternFavoriteController extends AbstractController
{
#[Route('/favorite/toggle/{id}', name: 'toggle_favorite')]
public function toggleFavorite(
Announcement $announcement,
EntityManagerInterface $em,
InternFavoriteRepository $repo
): RedirectResponse {
$intern = $this->getUser()->getIntern();
$existing = $repo->findOneBy([
'intern' => $intern,
'announcement' => $announcement
]);
if ($existing) {
$em->remove($existing);
} else {
$favorite = new InternFavorite();
$favorite->setIntern($intern);
$favorite->setAnnouncement($announcement);
$em->persist($favorite);
}
$em->flush();
return $this->redirectToRoute('app_announcement_index');
}
#[Route('/announcement/{id}/favorite/toggle', name: 'app_favorite_toggle', methods: ['POST'])]
public function toggle(Announcement $announcement, EntityManagerInterface $em, Security $security): RedirectResponse
{
$user = $security->getUser();
if (!$user instanceof Intern) {
throw new AccessDeniedHttpException('Seuls les stagiaires peuvent ajouter aux favoris.');
}
$favorite = $em->getRepository(InternFavorite::class)->findOneBy([
'intern' => $user,
'announcement' => $announcement
]);
if ($favorite) {
$em->remove($favorite);
} else {
$favorite = new InternFavorite();
$favorite->setIntern($user);
$favorite->setAnnouncement($announcement);
$em->persist($favorite);
}
$em->flush();
return new RedirectResponse($_SERVER['HTTP_REFERER'] ?? '/');
}
#[Route('/announcement/{id}', name: 'app_announcement_show')]
public function show(Announcement $announcement, InternFavoriteRepository $internFavoriteRepository): Response
{
$user = $this->getUser();
$isFavorite = false;
if (in_array('ROLE_INTERN', $user->getRoles())) {
$favorite = $internFavoriteRepository->findOneBy([
'announcement' => $announcement,
'intern' => $user,
]);
$isFavorite = $favorite ? true : false;
}
return $this->render('announcement/show.html.twig', [
'announcement' => $announcement,
'isFavorite' => $isFavorite,
]);
}
#[Route('/favorite/add/{id}', name: 'app_favorite_add')]
public function addFavorite(Announcement $announcement, EntityManagerInterface $entityManager): Response
{
$user = $this->getUser();
// Vérifier si l'intern a déjà ce favori
$existingFavorite = $entityManager->getRepository(InternFavorite::class)->findOneBy([
'announcement' => $announcement,
'intern' => $user,
]);
if (!$existingFavorite) {
$favorite = new InternFavorite();
$favorite->setAnnouncement($announcement);
$favorite->setIntern($user);
$entityManager->persist($favorite);
$entityManager->flush();
}
return $this->redirectToRoute('app_announcement_show', ['id' => $announcement->getId()]);
}
#[Route('/favorite/remove/{id}', name: 'app_favorite_remove')]
public function removeFavorite(Announcement $announcement, EntityManagerInterface $entityManager): Response
{
$user = $this->getUser();
$favorite = $entityManager->getRepository(InternFavorite::class)->findOneBy([
'announcement' => $announcement,
'intern' => $user,
]);
if ($favorite) {
$entityManager->remove($favorite);
$entityManager->flush();
}
return $this->redirectToRoute('app_announcement_show', ['id' => $announcement->getId()]);
}
}

View File

@ -7,6 +7,7 @@ use App\Entity\Intern;
use App\Entity\InternApplication; use App\Entity\InternApplication;
use App\Entity\UserApp; use App\Entity\UserApp;
use App\Form\UserAppType; use App\Form\UserAppType;
use App\Repository\SkillRepository;
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;
@ -84,4 +85,16 @@ class ProfileController extends AbstractController
'user_app' => $userApp, 'user_app' => $userApp,
]); ]);
} }
#[Route('/profile/pickSkill', name: 'app_profile_pickSkill', methods: ['GET'])]
public function pickSkill(UserApp $userApp): Response
{
return $this->render('skill/index.html.twig', [
'user_app' => $userApp,
]);
}
} }

57
src/Entity/Annonce.php Normal file
View 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;
}
}

42
src/Entity/Competence.php Normal file
View 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
View 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
View 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
View 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
View 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;
}
}

52
src/Entity/Favoris.php Normal file
View File

@ -0,0 +1,52 @@
<?php
namespace App\Entity;
use App\Entity\UserApp;
use App\Entity\Announcement;
use App\Repository\FavorisRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FavorisRepository::class)]
class Favoris
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'favoris')]
#[ORM\JoinColumn(nullable: false)]
private ?UserApp $user = null;
#[ORM\ManyToOne(inversedBy: 'favoris')]
#[ORM\JoinColumn(nullable: false)]
private ?Announcement $announcement = null;
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?UserApp
{
return $this->user;
}
public function setUser(?UserApp $user): static
{
$this->user = $user;
return $this;
}
public function getAnnouncement(): ?Announcement
{
return $this->announcement;
}
public function setAnnouncement(?Announcement $announcement): static
{
$this->announcement = $announcement;
return $this;
}
}

36
src/Entity/Formulaire.php Normal file
View 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;
}
}

36
src/Entity/Liste.php Normal file
View 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;
}
}

135
src/Entity/Utilisateur.php Normal file
View 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
View 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;
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ResetPasswordRequestFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('email', EmailType::class)
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}

View 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()
// ;
// }
}

View 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()
// ;
// }
}

View 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()
// ;
// }
}

View 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()
// ;
// }
}

View 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()
// ;
// }
}

View 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()
// ;
// }
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Repository;
use App\Entity\Favoris;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Favoris>
*/
class FavorisRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Favoris::class);
}
// /**
// * @return Favoris[] Returns an array of Favoris 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): ?Favoris
// {
// return $this->createQueryBuilder('f')
// ->andWhere('f.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View 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()
// ;
// }
}

View 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()
// ;
// }
}

View 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()
// ;
// }
}

View 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()
// ;
// }
}

View File

@ -0,0 +1,60 @@
<?php
namespace App\Security;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Http\Authenticator\AbstractLoginFormAuthenticator;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\CsrfTokenBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\RememberMeBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials;
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
use Symfony\Component\Security\Http\SecurityRequestAttributes;
use Symfony\Component\Security\Http\Util\TargetPathTrait;
class UserAuthenticator extends AbstractLoginFormAuthenticator
{
use TargetPathTrait;
public const LOGIN_ROUTE = 'app_login';
public function __construct(private UrlGeneratorInterface $urlGenerator)
{
}
public function authenticate(Request $request): Passport
{
$nickname = $request->getPayload()->getString('nickname');
$request->getSession()->set(SecurityRequestAttributes::LAST_USERNAME, $nickname);
return new Passport(
new UserBadge($nickname),
new PasswordCredentials($request->getPayload()->getString('password')),
[
new CsrfTokenBadge('authenticate', $request->getPayload()->getString('_csrf_token')),
new RememberMeBadge(),
]
);
}
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
{
if ($targetPath = $this->getTargetPath($request->getSession(), $firewallName)) {
return new RedirectResponse($targetPath);
}
// For example:
return new RedirectResponse($this->urlGenerator->generate('index'));
//throw new \Exception('TODO: provide a valid redirect inside '.__FILE__);
}
protected function getLoginUrl(Request $request): string
{
return $this->urlGenerator->generate(self::LOGIN_ROUTE);
}
}

View File

@ -288,6 +288,9 @@
"config/packages/messenger.yaml" "config/packages/messenger.yaml"
] ]
}, },
"symfonycasts/sass-bundle": {
"version": "v0.7.0"
},
"twig/extra-bundle": { "twig/extra-bundle": {
"version": "v3.13.0" "version": "v3.13.0"
} }

View File

@ -7,84 +7,66 @@
<h1 class="text-3xl font-bold mb-6 text-center">Liste des Annonces</h1> <h1 class="text-3xl font-bold mb-6 text-center">Liste des Annonces</h1>
{% if 'ROLE_ADMIN' in app.user.roles %} {% if 'ROLE_ADMIN' in app.user.roles %}
<!-- Formulaire pour afficher uniquement les annonces non validées --> <form method="get" class="mb-6 text-center">
<form method="get" class="mb-6 text-center"> <label class="flex items-center justify-center space-x-2">
<label class="flex items-center justify-center space-x-2"> <input type="checkbox" name="show_non_validated" value="1" {% if showNonValidated %}checked{% endif %} class="rounded text-teal-500">
<input <span class="text-gray-700">Afficher uniquement les annonces non validées</span>
type="checkbox" </label>
name="show_non_validated" <button type="submit" class="ml-4 bg-teal-500 text-white px-4 py-2 rounded mt-2">Appliquer</button>
value="1" </form>
{% if showNonValidated %}checked{% endif %}
class="rounded text-teal-500"
>
<span class="text-gray-700">Afficher uniquement les annonces non validées</span>
</label>
<button type="submit" class="ml-4 bg-teal-500 text-white px-4 py-2 rounded mt-2">
Appliquer
</button>
</form>
{% endif %} {% endif %}
{% if 'ROLE_EMPLOYEE' in app.user.roles %} {% if 'ROLE_EMPLOYEE' in app.user.roles %}
<!-- Bouton pour créer une annonce --> <div class="text-center mb-6">
<div class="text-center mb-6"> <a href="{{ path('app_announcement_new') }}" class="bg-teal-500 text-white px-6 py-3 rounded-md hover:bg-teal-600">
<a href="{{ path('app_announcement_new') }}" class="bg-teal-500 text-white px-6 py-3 rounded-md hover:bg-teal-600"> Créer une annonce
Créer une annonce </a>
</a> </div>
</div>
{% endif %} {% endif %}
<!-- Liste des annonces -->
<div class="max-w-4xl mx-auto"> <div class="max-w-4xl mx-auto">
<div class="bg-white rounded-lg shadow-lg p-6 inline-block text-center my-10"> <div class="bg-white rounded-lg shadow-lg p-6 inline-block text-center my-10">
<form method="get" class="flex flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-4 text-black"> <form method="get" class="flex flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-4 text-black">
<label> <input class="border border-gray-300 rounded py-2 px-4 w-full md:w-auto" placeholder="Rechercher par entreprise" type="text" name="company_name" value="{{ app.request.query.get('company_name') }}"/>
<input class="border border-gray-300 rounded py-2 px-4 w-full md:w-auto" placeholder="Rechercher par entreprise" type="text" name="company_name" value="{{ app.request.query.get('company_name') }}"/> <input class="border border-gray-300 rounded py-2 px-4 w-full md:w-auto" placeholder="Rechercher par lieu" type="text" name="location" value="{{ app.request.query.get('location') }}"/>
</label> <input class="border border-gray-300 rounded py-2 px-4 w-full md:w-auto" placeholder="Autre recherche" type="text" name="category" value="{{ app.request.query.get('category') }}"/>
<label>
<input class="border border-gray-300 rounded py-2 px-4 w-full md:w-auto" placeholder="Rechercher par lieu" type="text" name="location" value="{{ app.request.query.get('location') }}"/>
</label>
<label>
<input class="border border-gray-300 rounded py-2 px-4 w-full md:w-auto" placeholder="Autre recherche" type="text" name="category" value="{{ app.request.query.get('category') }}"/>
</label>
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-6 rounded">Rechercher</button> <button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-6 rounded">Rechercher</button>
</form> </form>
</div> </div>
{% for announcement in announcements %} {% for announcement in announcements %}
<div class="bg-white p-6 rounded-lg shadow mb-4 relative"> <div class="bg-white p-6 rounded-lg shadow mb-4 relative">
<!-- Statut en haut à droite --> <div class="absolute top-4 right-4 flex items-center space-x-2">
<div class="absolute top-4 right-4">
{% if announcement.status == 'notVerified' %} {% if announcement.status == 'notVerified' %}
<span class="text-red-500 font-semibold">Non validée</span> <span class="text-red-500 font-semibold">Non validée</span>
{% else %} {% else %}
<span class="text-green-500 font-semibold">Validée</span> <span class="text-green-500 font-semibold">Validée</span>
{% endif %} {% endif %}
<form method="post" action="{{ path('app_favorite_toggle', {id: announcement.id}) }}">
<button type="submit" class="text-xl">
{% if announcement.id in favorites %}
{% else %}
{% endif %}
</button>
</form>
</div> </div>
<!-- Titre de l'annonce -->
<h2 class="text-3xl font-semibold mb-2">{{ announcement.title }}</h2> <h2 class="text-3xl font-semibold mb-2">{{ announcement.title }}</h2>
<!-- Nom de l'entreprise -->
<p class="text-gray-600 mb-2">{{ announcement.company.name }}</p> <p class="text-gray-600 mb-2">{{ announcement.company.name }}</p>
<div class="text-gray-500 text-sm mb-4"> <div class="text-gray-500 text-sm mb-4">
<!-- Date du stage -->
<div class="mb-2"> <div class="mb-2">
<i class="fas fa-calendar-alt mr-1"></i> <i class="fas fa-calendar-alt mr-1"></i> <span>Date du stage : {{ announcement.date }}</span>
<span>Date du stage : {{ announcement.date }}</span>
</div> </div>
<!-- Adresse de l'entreprise -->
<div> <div>
<i class="fas fa-map-marker-alt mr-1"></i> <i class="fas fa-map-marker-alt mr-1"></i> <span>{{ announcement.company.address }}</span>
<span>{{ announcement.company.address }}</span>
</div> </div>
</div> </div>
<!-- Lien vers la page de détails --> <a href="{{ path('app_announcement_show', { id: announcement.id }) }}" class="bg-teal-500 text-white px-4 py-2 rounded">
<a href="{{ path('app_announcement_show', { id: announcement.id }) }}"
class="bg-teal-500 text-white px-4 py-2 rounded">
Détails Détails
</a> </a>
</div> </div>
@ -94,4 +76,3 @@
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -80,6 +80,16 @@
</div> </div>
{% endif %} {% endif %}
<!-- Vérifier si c'est un favori -->
<form method="post" action="{{ path(isFavorite ? 'app_favorite_remove' : 'app_favorite_add', {id: announcement.id}) }}">
<button type="submit" class="text-yellow-500">
{% if isFavorite %}
⭐ Retirer des favoris
{% else %}
☆ Ajouter aux favoris
{% endif %}
</button>
</form>
</div> </div>
<!-- Bouton de retour à la liste --> <!-- Bouton de retour à la liste -->

View File

@ -0,0 +1,22 @@
{# Learn how to use Turbo Streams: https://github.com/symfony/ux-turbo#broadcast-doctrine-entities-update #}
{% block create %}
<turbo-stream action="append" target="f_a_qs">
<template>
<div id="{{ 'f_a_q_' ~ id }}">
#{{ id }} created
</div>
</template>
</turbo-stream>
{% endblock %}
{% block update %}
<turbo-stream action="update" target="f_a_q_{{ id }}">
<template>
#{{ id }} updated
</template>
</turbo-stream>
{% endblock %}
{% block remove %}
<turbo-stream action="remove" target="f_a_q_{{ id }}"></turbo-stream>
{% endblock %}

View File

@ -35,21 +35,19 @@
{% endif %} {% endif %}
{% if 'ROLE_ADMIN' in app.user.roles %} {% if 'ROLE_ADMIN' in app.user.roles %}
<!-- Modifier le diplôme --> <!-- Modifier le diplôme -->
<a href="{{ path('app_degree_edit', {'id': degree.id}) }}" <a href="{{ path('app_degree_edit', {'id': degree.id}) }}" class="text-yellow-500 hover:text-yellow-700 mr-3">
class="text-yellow-500 hover:text-yellow-700 mr-3"> <i class="fas fa-edit"></i> Modifier
<i class="fas fa-edit"></i> Modifier </a>
</a>
<!-- Formulaire pour supprimer le diplôme --> <!-- Formulaire pour supprimer le diplôme -->
<form method="post" action="{{ path('app_degree_delete', {'id': degree.id}) }}" <form method="post" action="{{ path('app_degree_delete', {'id': degree.id}) }}" style="display:inline;">
style="display:inline;"> <input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_method" value="DELETE"> <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ degree.id) }}">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ degree.id) }}"> <button type="submit" class="text-red-500 hover:text-red-700">
<button type="submit" class="text-red-500 hover:text-red-700"> <i class="fas fa-trash-alt"></i> Supprimer
<i class="fas fa-trash-alt"></i> Supprimer </button>
</button> </form>
</form>
{% endif %} {% endif %}
</td> </td>
</tr> </tr>

View File

@ -48,4 +48,18 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
<h3 class="text-lg font-semibold mt-6">Vos compétences :</h3>
<ul class="list-disc list-inside text-gray-800">
{% if app.user.skills|length > 0 %}
{% for internSkill in app.user.skills %}
<li>{{ internSkill.skill.label }}</li>
{% endfor %}
{% else %}
<li>Aucune compétence sélectionnée</li>
{% endif %}
</ul>
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
href="{{ path('app_profile_pickSkill') }}">Sélectionner vos compétences</a>
{% endblock %} {% endblock %}

View File

@ -26,13 +26,21 @@
<h3 class="text-lg font-semibold mt-6">Vos compétences :</h3> <h3 class="text-lg font-semibold mt-6">Vos compétences :</h3>
<ul class="list-disc list-inside text-gray-800"> <ul class="list-disc list-inside text-gray-800">
{% if app.user.skills|length > 0 %}
{% for internSkill in app.user.skills %}
<li>{{ internSkill.skill.label }}</li>
{% endfor %}
{% else %}
<br>
Aucune pour le moment
{% endif %}
</ul> </ul>
<br> <br>
<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_user_edit',{id: app.user.id}) }}"> Selectionner vos compétences href="{{ path('app_skill_index',{id: app.user.id}) }}"> Sélectionner vos compétences
</a> </a>
<div class="flex justify-center mt-6"> <div class="flex justify-center 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_user_edit',{id: app.user.id}) }}"> Accéder aux favoris href="{{ path('app_user_edit',{id: app.user.id}) }}"> Accéder aux favoris

View File

@ -0,0 +1,14 @@
{% extends 'base.html.twig' %}
{% block title %}Demande de réinitialisation de mot de passe{% endblock %}
{% block body %}
<section>
<h1>Demande de réinitialisation de mot de passe</h1>
{{ form_start(requestPassForm) }}
{{ form_row(requestPassForm.email) }}
<button type="submit">Envoyer</button>
{{ form_end(requestPassForm) }}
</section>
{% endblock %}

View File

@ -6,47 +6,70 @@
<div class="container mx-auto p-6"> <div class="container mx-auto p-6">
<h1 class="text-3xl font-bold mb-4">Liste des Compétences</h1> <h1 class="text-3xl font-bold mb-4">Liste des Compétences</h1>
<div class="overflow-x-auto bg-white shadow-lg rounded-lg"> {% if 'ROLE_INTERN' in app.user.roles %}
<table class="min-w-full table-auto"> <form method="post" action="{{ path('app_intern_add_skills') }}">
<thead> {% endif %}
<tr class="bg-gray-800 text-white">
<th class="px-4 py-2 text-left">ID</th>
<th class="px-4 py-2 text-left">Label</th>
<th class="px-4 py-2 text-left">Actions</th>
</tr>
</thead>
<tbody>
{% for skill in skills %}
<tr class="border-b">
<td class="px-4 py-2">{{ skill.id }}</td>
<td class="px-4 py-2">{{ skill.label }}</td>
<td class="px-4 py-2">
<a href="{{ path('app_skill_show', {'id': skill.id}) }}" class="text-teal-500 hover:text-teal-700 mr-3">
<i class="fas fa-eye"></i> Voir
</a>
<a href="{{ path('app_skill_edit', {'id': skill.id}) }}" class="text-yellow-500 hover:text-yellow-700 mr-3"> <!-- Tableau des compétences -->
<i class="fas fa-edit"></i> Modifier <div class="overflow-x-auto bg-white shadow-lg rounded-lg">
</a> <table class="min-w-full table-auto">
<thead>
<form method="post" action="{{ path('app_skill_delete', {'id': skill.id}) }}" style="display:inline;"> <tr class="bg-gray-800 text-white">
<input type="hidden" name="_method" value="DELETE"> <th class="px-4 py-2 text-left">ID</th>
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ skill.id) }}"> <th class="px-4 py-2 text-left">Label</th>
<button type="submit" class="text-red-500 hover:text-red-700"> <th class="px-4 py-2 text-left">Actions</th>
<i class="fas fa-trash-alt"></i> Supprimer
</button>
</form>
</td>
</tr> </tr>
{% endfor %} </thead>
</tbody> <tbody>
</table> {% for skill in skills %}
</div> <tr class="border-b">
<td class="px-4 py-2">{{ skill.id }}</td>
<td class="px-4 py-2">{{ skill.label }}</td>
<td class="px-4 py-2">
{% if 'ROLE_INTERN' in app.user.roles %}
<label>
<input type="checkbox" name="selected_skills[]" value="{{ skill.id }}" class="mr-2">
Sélectionner
</label>
{% endif %}
<div class="mt-4"> {% if 'ROLE_ADMIN' in app.user.roles %}
<a href="{{ path('app_skill_new') }}" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"> <!-- Modifier la compétence -->
<i class="fas fa-plus-circle"></i> Ajouter une nouvelle compétence <a href="{{ path('app_skill_edit', {'id': skill.id}) }}" class="text-yellow-500 hover:text-yellow-700 mr-3">
</a> <i class="fas fa-edit"></i> Modifier
</div> </a>
<!-- Supprimer la compétence -->
<form method="post" action="{{ path('app_skill_delete', {'id': skill.id}) }}" style="display:inline;">
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ skill.id) }}">
<button type="submit" class="text-red-500 hover:text-red-700">
<i class="fas fa-trash-alt"></i> Supprimer
</button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if 'ROLE_INTERN' in app.user.roles %}
<div class="mt-4">
<button type="submit" class="bg-blue-500 hover:bg-blue-600 text-white py-2 px-4 rounded-full">
<i class="fas fa-check-circle"></i> Valider la sélection
</button>
</div>
</form>
{% endif %}
{% if 'ROLE_ADMIN' in app.user.roles %}
<div class="mt-4">
<a href="{{ path('app_skill_new') }}" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full">
<i class="fas fa-plus-circle"></i> Ajouter une compétence
</a>
</div>
{% endif %}
</div> </div>
{% endblock %} {% endblock %}