diff --git a/.gitignore b/.gitignore index b8c6a8a..4a56b88 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,6 @@ ###< symfony/asset-mapper ### .idea +composer.lock + /migrations/ \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -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 diff --git a/compose.override.yaml b/compose.override.yaml index 8dc54de..fc37713 100644 --- a/compose.override.yaml +++ b/compose.override.yaml @@ -1,4 +1,3 @@ - services: ###> doctrine/doctrine-bundle ### database: @@ -16,3 +15,4 @@ services: MP_SMTP_AUTH_ACCEPT_ANY: 1 MP_SMTP_AUTH_ALLOW_INSECURE: 1 ###< symfony/mailer ### + diff --git a/compose.yaml b/compose.yaml index 89c74d1..9afb177 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,4 +1,3 @@ - services: ###> doctrine/doctrine-bundle ### database: @@ -23,3 +22,4 @@ volumes: ###> doctrine/doctrine-bundle ### database_data: ###< doctrine/doctrine-bundle ### + diff --git a/composer.json b/composer.json index 6cda857..18fe331 100644 --- a/composer.json +++ b/composer.json @@ -100,7 +100,7 @@ "symfony/browser-kit": "7.1.*", "symfony/css-selector": "7.1.*", "symfony/debug-bundle": "7.1.*", - "symfony/maker-bundle": "^1.0", + "symfony/maker-bundle": "^1.61", "symfony/phpunit-bridge": "^7.1", "symfony/stopwatch": "7.1.*", "symfony/web-profiler-bundle": "7.1.*" diff --git a/src/Controller/AnnouncementController.php b/src/Controller/AnnouncementController.php index a1da498..699d90b 100644 --- a/src/Controller/AnnouncementController.php +++ b/src/Controller/AnnouncementController.php @@ -20,32 +20,38 @@ final class AnnouncementController extends AbstractController $user = $this->getUser(); $announcements = []; + // Récupérer les paramètres de recherche + $companyName = $request->query->get('company_name'); + $location = $request->query->get('location'); + $category = $request->query->get('category'); + if (in_array('ROLE_ADMIN', $user->getRoles())) { $showNonValidated = $request->query->get('show_non_validated'); if ($showNonValidated) { $announcements = $announcementRepository->findBy(['status' => 'notVerified']); - } - if (!$showNonValidated){ + } else { $announcements = $announcementRepository->findAll(); } - } if (in_array('ROLE_EMPLOYEE', $user->getRoles())) { $company = $user->getCompany(); - if ($company) - { + if ($company) { $announcements = $announcementRepository->findBy(['company' => $company]); } } - if (in_array('ROLE_INTERN', $user->getRoles())) - { + if (in_array('ROLE_INTERN', $user->getRoles())) { $announcements = $announcementRepository->findBy(['status' => 'Verified']); } + // Filtrer les annonces en fonction des critères de recherche + if ($companyName || $location || $category) { + $announcements = $announcementRepository->searchAnnouncements($companyName, $location, $category); + } + return $this->render('announcement/index.html.twig', [ 'announcements' => $announcements, 'showNonValidated' => $request->query->get('show_non_validated', false), diff --git a/src/Entity/Annonce.php b/src/Entity/Annonce.php new file mode 100644 index 0000000..dc600bb --- /dev/null +++ b/src/Entity/Annonce.php @@ -0,0 +1,57 @@ +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; + } +} diff --git a/src/Entity/Competence.php b/src/Entity/Competence.php new file mode 100644 index 0000000..ee8394b --- /dev/null +++ b/src/Entity/Competence.php @@ -0,0 +1,42 @@ +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; + } +} diff --git a/src/Entity/Demandeur.php b/src/Entity/Demandeur.php new file mode 100644 index 0000000..fae439e --- /dev/null +++ b/src/Entity/Demandeur.php @@ -0,0 +1,65 @@ +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; + } +} diff --git a/src/Entity/Diplome.php b/src/Entity/Diplome.php new file mode 100644 index 0000000..5ca827e --- /dev/null +++ b/src/Entity/Diplome.php @@ -0,0 +1,42 @@ +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; + } +} diff --git a/src/Entity/Employe.php b/src/Entity/Employe.php new file mode 100644 index 0000000..1d4fa6c --- /dev/null +++ b/src/Entity/Employe.php @@ -0,0 +1,35 @@ +id; + } + + public function getMail(): ?string + { + return $this->Mail; + } + + public function setMail(string $Mail): static + { + $this->Mail = $Mail; + + return $this; + } +} diff --git a/src/Entity/Entreprise.php b/src/Entity/Entreprise.php new file mode 100644 index 0000000..2807a19 --- /dev/null +++ b/src/Entity/Entreprise.php @@ -0,0 +1,87 @@ +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; + } +} diff --git a/src/Entity/Favoris.php b/src/Entity/Favoris.php new file mode 100644 index 0000000..26f1023 --- /dev/null +++ b/src/Entity/Favoris.php @@ -0,0 +1,27 @@ +id; + } + + public function setId(int $id): static + { + $this->id = $id; + + return $this; + } +} diff --git a/src/Entity/Formulaire.php b/src/Entity/Formulaire.php new file mode 100644 index 0000000..7a8308b --- /dev/null +++ b/src/Entity/Formulaire.php @@ -0,0 +1,36 @@ +id; + } + + public function getDate(): ?\DateTimeInterface + { + return $this->Date; + } + + public function setDate(\DateTimeInterface $Date): static + { + $this->Date = $Date; + + return $this; + } +} diff --git a/src/Entity/Liste.php b/src/Entity/Liste.php new file mode 100644 index 0000000..eccf868 --- /dev/null +++ b/src/Entity/Liste.php @@ -0,0 +1,36 @@ +id; + } + + public function getDate(): ?\DateTimeInterface + { + return $this->Date; + } + + public function setDate(\DateTimeInterface $Date): static + { + $this->Date = $Date; + + return $this; + } +} diff --git a/src/Entity/Utilisateur.php b/src/Entity/Utilisateur.php new file mode 100644 index 0000000..705b358 --- /dev/null +++ b/src/Entity/Utilisateur.php @@ -0,0 +1,135 @@ +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 + */ + 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; + } +} diff --git a/src/Entity/Verifie.php b/src/Entity/Verifie.php new file mode 100644 index 0000000..fa39d14 --- /dev/null +++ b/src/Entity/Verifie.php @@ -0,0 +1,42 @@ +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; + } +} diff --git a/src/Repository/AnnonceRepository.php b/src/Repository/AnnonceRepository.php new file mode 100644 index 0000000..776c143 --- /dev/null +++ b/src/Repository/AnnonceRepository.php @@ -0,0 +1,43 @@ + + */ +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() +// ; +// } +} diff --git a/src/Repository/AnnouncementRepository.php b/src/Repository/AnnouncementRepository.php index 36813af..0e0094b 100644 --- a/src/Repository/AnnouncementRepository.php +++ b/src/Repository/AnnouncementRepository.php @@ -16,6 +16,28 @@ class AnnouncementRepository extends ServiceEntityRepository parent::__construct($registry, Announcement::class); } + public function searchAnnouncements(?string $companyName, ?string $location, ?string $category): array + { + $queryBuilder = $this->createQueryBuilder('a')->InnerJoin('a.company', 'c'); + + if ($companyName) { + $queryBuilder->andWhere('c.name LIKE :companyName') + ->setParameter('companyName', '%' . $companyName . '%'); + } + + if ($location) { + $queryBuilder->andWhere('c.address LIKE :location') + ->setParameter('location', '%' . $location . '%'); + } + + if ($category) { + $queryBuilder->andWhere('a.title LIKE :category OR a.description LIKE :category') + ->setParameter('category', '%' . $category . '%'); + } + + return $queryBuilder->getQuery()->getResult(); + } + // /** // * @return Announcement[] Returns an array of Announcement objects // */ diff --git a/src/Repository/CompetenceRepository.php b/src/Repository/CompetenceRepository.php new file mode 100644 index 0000000..f4fbf89 --- /dev/null +++ b/src/Repository/CompetenceRepository.php @@ -0,0 +1,43 @@ + + */ +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() +// ; +// } +} diff --git a/src/Repository/DemandeurRepository.php b/src/Repository/DemandeurRepository.php new file mode 100644 index 0000000..6ef82d1 --- /dev/null +++ b/src/Repository/DemandeurRepository.php @@ -0,0 +1,43 @@ + + */ +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() +// ; +// } +} diff --git a/src/Repository/DiplomeRepository.php b/src/Repository/DiplomeRepository.php new file mode 100644 index 0000000..777400a --- /dev/null +++ b/src/Repository/DiplomeRepository.php @@ -0,0 +1,43 @@ + + */ +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() +// ; +// } +} diff --git a/src/Repository/EmployeRepository.php b/src/Repository/EmployeRepository.php new file mode 100644 index 0000000..87ac38f --- /dev/null +++ b/src/Repository/EmployeRepository.php @@ -0,0 +1,43 @@ + + */ +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() +// ; +// } +} diff --git a/src/Repository/EntrepriseRepository.php b/src/Repository/EntrepriseRepository.php new file mode 100644 index 0000000..3d0e694 --- /dev/null +++ b/src/Repository/EntrepriseRepository.php @@ -0,0 +1,43 @@ + + */ +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() +// ; +// } +} diff --git a/src/Repository/FavorisRepository.php b/src/Repository/FavorisRepository.php new file mode 100644 index 0000000..4b12a36 --- /dev/null +++ b/src/Repository/FavorisRepository.php @@ -0,0 +1,43 @@ + + */ +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() +// ; +// } +} diff --git a/src/Repository/FormulaireRepository.php b/src/Repository/FormulaireRepository.php new file mode 100644 index 0000000..f27aa6a --- /dev/null +++ b/src/Repository/FormulaireRepository.php @@ -0,0 +1,43 @@ + + */ +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() +// ; +// } +} diff --git a/src/Repository/ListeRepository.php b/src/Repository/ListeRepository.php new file mode 100644 index 0000000..570b25f --- /dev/null +++ b/src/Repository/ListeRepository.php @@ -0,0 +1,43 @@ + + */ +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() +// ; +// } +} diff --git a/src/Repository/UtilisateurRepository.php b/src/Repository/UtilisateurRepository.php new file mode 100644 index 0000000..df1e4c6 --- /dev/null +++ b/src/Repository/UtilisateurRepository.php @@ -0,0 +1,43 @@ + + */ +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() +// ; +// } +} diff --git a/src/Repository/VerifieRepository.php b/src/Repository/VerifieRepository.php new file mode 100644 index 0000000..c5384d7 --- /dev/null +++ b/src/Repository/VerifieRepository.php @@ -0,0 +1,43 @@ + + */ +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() +// ; +// } +} diff --git a/templates/announcement/index.html.twig b/templates/announcement/index.html.twig index 39ecc15..0920dd6 100644 --- a/templates/announcement/index.html.twig +++ b/templates/announcement/index.html.twig @@ -36,6 +36,21 @@
+
+
+ + + + +
+
+ {% for announcement in announcements %}
diff --git a/templates/broadcast/FAQ.stream.html.twig b/templates/broadcast/FAQ.stream.html.twig new file mode 100644 index 0000000..988ccf4 --- /dev/null +++ b/templates/broadcast/FAQ.stream.html.twig @@ -0,0 +1,22 @@ +{# Learn how to use Turbo Streams: https://github.com/symfony/ux-turbo#broadcast-doctrine-entities-update #} +{% block create %} + + + +{% endblock %} + +{% block update %} + + + +{% endblock %} + +{% block remove %} + +{% endblock %} diff --git a/templates/index/index.html.twig b/templates/index/index.html.twig index 44a983e..3af426a 100644 --- a/templates/index/index.html.twig +++ b/templates/index/index.html.twig @@ -11,21 +11,6 @@

Trouvez votre stage de rêve !

Connectez les talents aux opportunités : votre clé vers le succès professionnel

-
-
- - - - -
-

la recherche n'est pas encore implémenté

-