Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
a6e7db75fd | |||
ef7551d755 | |||
ebeafaeeed | |||
ea41c3cccc | |||
be1bd0541c | |||
ffcdd46003 | |||
6763f991dd | |||
0f130c6453 | |||
08ae5a6676 | |||
97f71e6e23 | |||
ebc0a27382 | |||
5cde70a7b3 | |||
fab5249ac5 | |||
3f2fcfd269 | |||
f38c5e4350 | |||
3ab2ef5a9e | |||
adbfe09f01 | |||
c60aa4c43a | |||
f71e0027eb | |||
3a8d60fddb | |||
5219334da2 | |||
136dc8367e | |||
de2ab661b5 | |||
e607897c5b | |||
57bd6c953e | |||
37812be99b | |||
ba7e152552 | |||
76b4d05620 | |||
e66a2510ca | |||
3b353cde0b | |||
17fd3ef23a | |||
e7a9a3fd5c | |||
2782b154ed | |||
6dd6550292 | |||
60d5ae04ac | |||
6860e00bf8 | |||
922834da8a | |||
cbce2ca3c6 | |||
428ee14836 | |||
7a4c7aa01e | |||
3ba44656b3 | |||
2dc0f69e4d | |||
b8e03593af | |||
df69ccf634 | |||
6903630012 | |||
f0c7c03b9b | |||
1531c122b8 | |||
|
168ff58d15 | ||
e29b52cb83 |
2
.env
2
.env
@ -37,5 +37,5 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
|
||||
###< symfony/messenger ###
|
||||
|
||||
###> symfony/mailer ###
|
||||
# MAILER_DSN=null://null
|
||||
MAILER_DSN=null://null
|
||||
###< symfony/mailer ###
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -23,3 +23,5 @@
|
||||
/public/assets/
|
||||
/assets/vendor/
|
||||
###< symfony/asset-mapper ###
|
||||
|
||||
.idea/
|
@ -1,3 +1,20 @@
|
||||
body {
|
||||
background-color: skyblue;
|
||||
background-color: #31393C;
|
||||
}
|
||||
.wrapper {
|
||||
color: #D0DDD7;
|
||||
margin: 1em auto;
|
||||
max-width: 800px;
|
||||
width: 95%;
|
||||
font: 18px/1.5 sans-serif;
|
||||
}
|
||||
|
||||
.hegre-navbar {
|
||||
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
|
||||
backdrop-filter: blur(5px);
|
||||
-webkit-backdrop-filter: blur(5px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
}
|
76
assets/styles/style.css
Normal file
76
assets/styles/style.css
Normal file
@ -0,0 +1,76 @@
|
||||
body {
|
||||
background: linear-gradient(to right, #5CE1E6, #C1FF72, #cb6ce6);
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-family: "Fredoka", sans-serif;
|
||||
font-optical-sizing: auto;
|
||||
font-style: normal;
|
||||
font-variation-settings: "wdth" 100;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 60%;
|
||||
height: auto;
|
||||
float: right;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: auto;
|
||||
margin: auto 0 auto;
|
||||
}
|
||||
|
||||
form {
|
||||
margin-right: 20px;
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 50px;
|
||||
}
|
||||
|
||||
form div {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.logo{
|
||||
margin-bottom: 65%;
|
||||
margin-right: 30%;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
font-family: "Fredoka", sans-serif;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="password"] {
|
||||
width: 90%;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 10px 20px;
|
||||
background-color: #5CE1E6;
|
||||
color: black;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #CB6CE6;
|
||||
}
|
||||
|
||||
.submit {
|
||||
margin-left: 15%;
|
||||
}
|
@ -23,7 +23,7 @@ doctrine:
|
||||
prefix: 'App\Entity'
|
||||
alias: App
|
||||
controller_resolver:
|
||||
auto_mapping: false
|
||||
auto_mapping: true
|
||||
|
||||
when@test:
|
||||
doctrine:
|
||||
|
@ -4,14 +4,32 @@ security:
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
||||
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
||||
providers:
|
||||
users_in_memory: { memory: null }
|
||||
# used to reload user from session & other features (e.g. switch_user)
|
||||
app_user_provider:
|
||||
entity:
|
||||
class: App\Entity\Employee
|
||||
property: email
|
||||
# used to reload user from session & other features (e.g. switch_user)
|
||||
firewalls:
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
main:
|
||||
lazy: true
|
||||
provider: users_in_memory
|
||||
provider: app_user_provider
|
||||
custom_authenticator: App\Security\LoginFormAuthenticator
|
||||
logout:
|
||||
path: app_logout
|
||||
# where to redirect after logout
|
||||
# target: app_any_route
|
||||
|
||||
remember_me:
|
||||
secret: '%kernel.secret%'
|
||||
lifetime: 604800
|
||||
path: /
|
||||
# by default, the feature is enabled by checking a checkbox in the
|
||||
# login form, uncomment the following line to always enable it.
|
||||
#always_remember_me: true
|
||||
|
||||
# activate different ways to authenticate
|
||||
# https://symfony.com/doc/current/security.html#the-firewall
|
||||
@ -19,11 +37,14 @@ security:
|
||||
# https://symfony.com/doc/current/security/impersonating_user.html
|
||||
# switch_user: true
|
||||
|
||||
role_hierarchy:
|
||||
ROLE_ADMIN: ['ROLE_USER']
|
||||
|
||||
# Easy way to control access for large sections of your site
|
||||
# Note: Only the *first* access control that matches will be used
|
||||
access_control:
|
||||
# - { path: ^/admin, roles: ROLE_ADMIN }
|
||||
# - { path: ^/profile, roles: ROLE_USER }
|
||||
- { path: ^/login, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/*, roles: IS_AUTHENTICATED_FULLY}
|
||||
|
||||
when@test:
|
||||
security:
|
||||
@ -32,7 +53,7 @@ when@test:
|
||||
# important to generate secure password hashes. In tests however, secure hashes
|
||||
# are not important, waste resources and increase test times. The following
|
||||
# reduces the work factor to the lowest possible values.
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
|
||||
Symfony\Component\Security\Core\Employee\PasswordAuthenticatedUserInterface:
|
||||
algorithm: auto
|
||||
cost: 4 # Lowest possible value for bcrypt
|
||||
time_cost: 3 # Lowest possible value for argon
|
||||
|
114
migrations/Version20241212162704.php
Normal file
114
migrations/Version20241212162704.php
Normal file
@ -0,0 +1,114 @@
|
||||
<?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 Version20241212162704 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('CREATE SEQUENCE category_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE SEQUENCE employee_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE SEQUENCE incident_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE SEQUENCE incident_type_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE SEQUENCE mission_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE SEQUENCE ride_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE SEQUENCE skill_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE TABLE assignment (employee_id INT NOT NULL, ride_id INT NOT NULL, start_hour TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, end_hour TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(employee_id, ride_id))');
|
||||
$this->addSql('CREATE INDEX IDX_30C544BA8C03F15C ON assignment (employee_id)');
|
||||
$this->addSql('CREATE INDEX IDX_30C544BA302A8A70 ON assignment (ride_id)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_30C544BA8C03F15C302A8A70 ON assignment (employee_id, ride_id)');
|
||||
$this->addSql('CREATE TABLE category (id INT NOT NULL, label VARCHAR(30) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE TABLE employee (id INT NOT NULL, missions_id INT DEFAULT NULL, incidents_id INT DEFAULT NULL, email VARCHAR(180) NOT NULL, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(30) NOT NULL, password VARCHAR(255) NOT NULL, roles JSON NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE INDEX IDX_5D9F75A117C042CF ON employee (missions_id)');
|
||||
$this->addSql('CREATE INDEX IDX_5D9F75A155955332 ON employee (incidents_id)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL ON employee (email)');
|
||||
$this->addSql('CREATE TABLE employee_skill (employee INT NOT NULL, skill INT NOT NULL, PRIMARY KEY(employee, skill))');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_B630E90E5D9F75A15E3DE477 ON employee_skill (employee, skill)');
|
||||
$this->addSql('CREATE TABLE incident (id INT NOT NULL, ride_id INT DEFAULT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE INDEX IDX_3D03A11A302A8A70 ON incident (ride_id)');
|
||||
$this->addSql('CREATE TABLE incident_type (id INT NOT NULL, incidents_id INT DEFAULT NULL, label VARCHAR(30) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE INDEX IDX_66D2209655955332 ON incident_type (incidents_id)');
|
||||
$this->addSql('CREATE TABLE mission (id INT NOT NULL, label VARCHAR(30) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE TABLE mission_category (mission INT NOT NULL, category INT NOT NULL, PRIMARY KEY(mission, category))');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_EB018789067F23C64C19C1 ON mission_category (mission, category)');
|
||||
$this->addSql('CREATE TABLE representation (employee_id INT NOT NULL, ride_id INT NOT NULL, count INT NOT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(employee_id, ride_id))');
|
||||
$this->addSql('CREATE INDEX IDX_29D5499E8C03F15C ON representation (employee_id)');
|
||||
$this->addSql('CREATE INDEX IDX_29D5499E302A8A70 ON representation (ride_id)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_29D5499E8C03F15C302A8A70AA9E377A ON representation (employee_id, ride_id, date)');
|
||||
$this->addSql('CREATE TABLE requirement (mission INT NOT NULL, skill INT NOT NULL, PRIMARY KEY(mission, skill))');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_DB3F55509067F23C5E3DE477 ON requirement (mission, skill)');
|
||||
$this->addSql('CREATE TABLE ride (id INT NOT NULL, label VARCHAR(30) NOT NULL, count INT NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE TABLE skill (id INT NOT NULL, label VARCHAR(30) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)');
|
||||
$this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)');
|
||||
$this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)');
|
||||
$this->addSql('COMMENT ON COLUMN messenger_messages.created_at IS \'(DC2Type:datetime_immutable)\'');
|
||||
$this->addSql('COMMENT ON COLUMN messenger_messages.available_at IS \'(DC2Type:datetime_immutable)\'');
|
||||
$this->addSql('COMMENT ON COLUMN messenger_messages.delivered_at IS \'(DC2Type:datetime_immutable)\'');
|
||||
$this->addSql('CREATE OR REPLACE FUNCTION notify_messenger_messages() RETURNS TRIGGER AS $$
|
||||
BEGIN
|
||||
PERFORM pg_notify(\'messenger_messages\', NEW.queue_name::text);
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;');
|
||||
$this->addSql('DROP TRIGGER IF EXISTS notify_trigger ON messenger_messages;');
|
||||
$this->addSql('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON messenger_messages FOR EACH ROW EXECUTE PROCEDURE notify_messenger_messages();');
|
||||
$this->addSql('ALTER TABLE assignment ADD CONSTRAINT FK_30C544BA8C03F15C FOREIGN KEY (employee_id) REFERENCES employee (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE assignment ADD CONSTRAINT FK_30C544BA302A8A70 FOREIGN KEY (ride_id) REFERENCES ride (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE employee ADD CONSTRAINT FK_5D9F75A117C042CF FOREIGN KEY (missions_id) REFERENCES mission (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE employee ADD CONSTRAINT FK_5D9F75A155955332 FOREIGN KEY (incidents_id) REFERENCES incident (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE incident ADD CONSTRAINT FK_3D03A11A302A8A70 FOREIGN KEY (ride_id) REFERENCES ride (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE incident_type ADD CONSTRAINT FK_66D2209655955332 FOREIGN KEY (incidents_id) REFERENCES incident (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE representation ADD CONSTRAINT FK_29D5499E8C03F15C FOREIGN KEY (employee_id) REFERENCES employee (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE representation ADD CONSTRAINT FK_29D5499E302A8A70 FOREIGN KEY (ride_id) REFERENCES ride (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
}
|
||||
|
||||
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('DROP SEQUENCE category_id_seq CASCADE');
|
||||
$this->addSql('DROP SEQUENCE employee_id_seq CASCADE');
|
||||
$this->addSql('DROP SEQUENCE incident_id_seq CASCADE');
|
||||
$this->addSql('DROP SEQUENCE incident_type_id_seq CASCADE');
|
||||
$this->addSql('DROP SEQUENCE mission_id_seq CASCADE');
|
||||
$this->addSql('DROP SEQUENCE ride_id_seq CASCADE');
|
||||
$this->addSql('DROP SEQUENCE skill_id_seq CASCADE');
|
||||
$this->addSql('ALTER TABLE assignment DROP CONSTRAINT FK_30C544BA8C03F15C');
|
||||
$this->addSql('ALTER TABLE assignment DROP CONSTRAINT FK_30C544BA302A8A70');
|
||||
$this->addSql('ALTER TABLE employee DROP CONSTRAINT FK_5D9F75A117C042CF');
|
||||
$this->addSql('ALTER TABLE employee DROP CONSTRAINT FK_5D9F75A155955332');
|
||||
$this->addSql('ALTER TABLE incident DROP CONSTRAINT FK_3D03A11A302A8A70');
|
||||
$this->addSql('ALTER TABLE incident_type DROP CONSTRAINT FK_66D2209655955332');
|
||||
$this->addSql('ALTER TABLE representation DROP CONSTRAINT FK_29D5499E8C03F15C');
|
||||
$this->addSql('ALTER TABLE representation DROP CONSTRAINT FK_29D5499E302A8A70');
|
||||
$this->addSql('DROP TABLE assignment');
|
||||
$this->addSql('DROP TABLE category');
|
||||
$this->addSql('DROP TABLE employee');
|
||||
$this->addSql('DROP TABLE employee_skill');
|
||||
$this->addSql('DROP TABLE incident');
|
||||
$this->addSql('DROP TABLE incident_type');
|
||||
$this->addSql('DROP TABLE mission');
|
||||
$this->addSql('DROP TABLE mission_category');
|
||||
$this->addSql('DROP TABLE representation');
|
||||
$this->addSql('DROP TABLE requirement');
|
||||
$this->addSql('DROP TABLE ride');
|
||||
$this->addSql('DROP TABLE skill');
|
||||
$this->addSql('DROP TABLE messenger_messages');
|
||||
}
|
||||
}
|
58
src/Controller/AffectationController.php
Normal file
58
src/Controller/AffectationController.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class AffectationController extends AbstractController
|
||||
{
|
||||
#[Route('/affectation', name: 'app_affectation')]
|
||||
public function index(): Response
|
||||
{
|
||||
|
||||
|
||||
return $this->render('affectation/index.html.twig', [
|
||||
'controller_name' => 'AffectationController',
|
||||
]);
|
||||
}
|
||||
|
||||
public function add(Request $request)
|
||||
{
|
||||
$validated = $request->validate([
|
||||
'name' => 'required|string|max:255',
|
||||
'description' => 'nullable|string',
|
||||
]);
|
||||
|
||||
$affectation = Affectation::create($validated);
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Affectation réussie',
|
||||
'data' => $affectation
|
||||
], 201);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
$affectations = Affectation::all();
|
||||
|
||||
return response()->json([
|
||||
'data' => $affectations
|
||||
], 200);
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
$affectation = Affectation::find($id);
|
||||
|
||||
if (!$affectation) {
|
||||
return response()->json(['message' => ''], 404);
|
||||
}
|
||||
|
||||
$affectation->delete();
|
||||
|
||||
return response()->json(['message' => ''], 200);
|
||||
}
|
||||
|
||||
}
|
74
src/Controller/CategoryController.php
Normal file
74
src/Controller/CategoryController.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Category;
|
||||
use App\Form\CategoryType;
|
||||
use App\Repository\CategoryRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
final class CategoryController extends AbstractController
|
||||
{
|
||||
#[Route(path:'/category', name: 'category')]
|
||||
#[Route(name: 'app_category_index', methods: ['GET'])]
|
||||
public function index(CategoryRepository $categoryRepository): Response
|
||||
{
|
||||
return $this->render('category/index.html.twig', [
|
||||
'categories' => $categoryRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: 'app_category_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$category = new Category();
|
||||
$form = $this->createForm(CategoryType::class, $category);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->persist($category);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_category_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('category/new.html.twig', [
|
||||
'category' => $category,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
#[Route('/{id}/edit', name: 'app_category_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Category $category, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(CategoryType::class, $category);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_category_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('category/edit.html.twig', [
|
||||
'category' => $category,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_category_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, Category $category, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$category->getId(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($category);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('app_category_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
}
|
@ -5,14 +5,14 @@ namespace App\Controller;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||
|
||||
#[Route('/dashboard', name: 'IndexController')]
|
||||
class IndexController extends AbstractController
|
||||
class DashboardController extends AbstractController
|
||||
{
|
||||
#[Route('', name: '_index')]
|
||||
#[Route(path: '/dashboard', name: 'dashboard')]
|
||||
public function index(): Response
|
||||
{
|
||||
|
||||
return $this->render('index/index.html.twig');
|
||||
return $this->render('dashboard/index.html.twig');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
86
src/Controller/EmployeeController.php
Normal file
86
src/Controller/EmployeeController.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Employee;
|
||||
use App\Form\EmployeeType;
|
||||
use App\Repository\EmployeeRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/employee', name: 'employee')]
|
||||
final class EmployeeController extends AbstractController
|
||||
{
|
||||
#[Route('',name: '_index', methods: ['GET'])]
|
||||
public function index(EmployeeRepository $employeeRepository): Response
|
||||
{
|
||||
return $this->render('employee/index.html.twig', [
|
||||
'employees' => $employeeRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: '_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$employee = new Employee();
|
||||
$form = $this->createForm(EmployeeType::class, $employee);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
|
||||
$employee->setPassword(
|
||||
password_hash($form->get('plainPassword')->getData(), PASSWORD_BCRYPT)
|
||||
);
|
||||
|
||||
$entityManager->persist($employee);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('employee_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('employee/new.html.twig', [
|
||||
'employee' => $employee,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: '_show', methods: ['GET'])]
|
||||
public function show(Employee $employee): Response
|
||||
{
|
||||
return $this->render('employee/show.html.twig', [
|
||||
'employee' => $employee,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}/edit', name: '_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Employee $employee, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(EmployeeType::class, $employee);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('employee_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('employee/edit.html.twig', [
|
||||
'employee' => $employee,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: '_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, Employee $employee, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$employee->getId(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($employee);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('employee_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
}
|
18
src/Controller/IncidentController.php
Normal file
18
src/Controller/IncidentController.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class IncidentController extends AbstractController
|
||||
{
|
||||
#[Route('/incident', name: 'app_incident')]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('incident/index.html.twig', [
|
||||
'controller_name' => 'IncidentController',
|
||||
]);
|
||||
}
|
||||
}
|
81
src/Controller/MissionController.php
Normal file
81
src/Controller/MissionController.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Mission;
|
||||
use App\Form\MissionType;
|
||||
use App\Repository\MissionRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/mission', name: 'mission')]
|
||||
final class MissionController extends AbstractController
|
||||
{
|
||||
#[Route(name: '_index', methods: ['GET'])]
|
||||
public function index(MissionRepository $missionRepository): Response
|
||||
{
|
||||
return $this->render('mission/index.html.twig', [
|
||||
'missions' => $missionRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: '_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$mission = new Mission();
|
||||
$form = $this->createForm(MissionType::class, $mission);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->persist($mission);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('mission_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('mission/new.html.twig', [
|
||||
'mission' => $mission,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: '_show', methods: ['GET'])]
|
||||
public function show(Mission $mission): Response
|
||||
{
|
||||
return $this->render('mission/show.html.twig', [
|
||||
'mission' => $mission,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}/edit', name: '_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Mission $mission, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(MissionType::class, $mission);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('mission_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('mission/edit.html.twig', [
|
||||
'mission' => $mission,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: '_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, Mission $mission, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$mission->getId(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($mission);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('mission_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
}
|
94
src/Controller/RepresentationController.php
Normal file
94
src/Controller/RepresentationController.php
Normal file
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Employee;
|
||||
use App\Entity\Representation;
|
||||
use App\Entity\Ride;
|
||||
use App\Form\RepresentationType;
|
||||
use App\Repository\RepresentationRepository;
|
||||
use App\Repository\RideRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/representation', name: 'representation')]
|
||||
final class RepresentationController extends AbstractController
|
||||
{
|
||||
public function __toString(): string
|
||||
{
|
||||
// TODO: Implement __toString() method.
|
||||
return "";
|
||||
}
|
||||
|
||||
#[Route(name: '_index', methods: ['GET'])]
|
||||
public function index(RepresentationRepository $representationRepository): Response
|
||||
{
|
||||
return $this->render('representation/index.html.twig', [
|
||||
'representations' => $representationRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: '_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager, RideRepository $rideRepository): Response
|
||||
{
|
||||
$representation = new Representation();
|
||||
$form = $this->createForm(RepresentationType::class, $representation);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$ride = $rideRepository->find($representation->getRide());
|
||||
$newCount = $ride->getCount() + $representation->getCount();
|
||||
$ride->setCount($newCount);
|
||||
|
||||
$entityManager->persist($representation);
|
||||
$entityManager->flush();
|
||||
//
|
||||
return $this->redirectToRoute('representation_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('representation/new.html.twig', [
|
||||
'representation' => $representation,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{employee}', name: '_show', methods: ['GET'])]
|
||||
public function show(Representation $representation): Response
|
||||
{
|
||||
return $this->render('representation/show.html.twig', [
|
||||
'representation' => $representation,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{employee}/edit', name: '_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Representation $representation, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(RepresentationType::class, $representation);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('representation_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('representation/edit.html.twig', [
|
||||
'representation' => $representation,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{employee}', name: '_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, Representation $representation, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$representation->getEmployee(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($representation);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('representation_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
}
|
100
src/Controller/RideController.php
Normal file
100
src/Controller/RideController.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Ride;
|
||||
use App\Form\RideType;
|
||||
use App\Repository\RideRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/ride', name: 'ride')]
|
||||
final class RideController extends AbstractController
|
||||
{
|
||||
#[Route(name: '_index', methods: ['GET'])]
|
||||
public function index(RideRepository $rideRepository): Response
|
||||
{
|
||||
return $this->render('ride/index.html.twig', [
|
||||
'rides' => $rideRepository->findAll(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: '_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$ride = new Ride();
|
||||
$form = $this->createForm(RideType::class, $ride);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->persist($ride);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('ride_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('ride/new.html.twig', [
|
||||
'ride' => $ride,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: '_show', methods: ['GET'])]
|
||||
public function show(Ride $ride): Response
|
||||
{
|
||||
return $this->render('ride/show.html.twig', [
|
||||
'ride' => $ride,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}/edit', name: '_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Ride $ride, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(RideType::class, $ride);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('ride_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('ride/edit.html.twig', [
|
||||
'ride' => $ride,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}/increment', name: '_increment', methods: ['GET', 'POST'])]
|
||||
public function incrementCount(Request $request, Ride $ride, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(RideType::class);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$ride->setCount($ride->getCount() + 15);
|
||||
$entityManager->persist($ride);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
|
||||
return $this->redirectToRoute('ride_show', ['id' => $ride->getId()], Response::HTTP_SEE_OTHER);
|
||||
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: '_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, Ride $ride, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$ride->getId(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($ride);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('ride_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
|
||||
}
|
37
src/Controller/SecurityController.php
Normal file
37
src/Controller/SecurityController.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Form\LoginType;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||
|
||||
#[Route(path: '/login', name: 'security')]
|
||||
class SecurityController extends AbstractController
|
||||
{
|
||||
#[Route(path: '', name: '_login')]
|
||||
public function login(AuthenticationUtils $authenticationUtils): Response
|
||||
{
|
||||
// if ($this->getUser()) {
|
||||
// return $this->redirectToRoute('dashboard');
|
||||
// }
|
||||
|
||||
// get the login error if there is one
|
||||
$error = $authenticationUtils->getLastAuthenticationError();
|
||||
|
||||
// last username entered by the user
|
||||
$lastUsername = $authenticationUtils->getLastUsername();
|
||||
|
||||
|
||||
return $this->render('security/login.html.twig', ['last_username' => $lastUsername, 'error' => $error]);
|
||||
}
|
||||
|
||||
#[Route(path: '/logout', name: '_logout')]
|
||||
public function logout(): void
|
||||
{
|
||||
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
|
||||
}
|
||||
}
|
69
src/Entity/Assignment.php
Normal file
69
src/Entity/Assignment.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\AssignmentRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: AssignmentRepository::class)]
|
||||
#[ORM\UniqueConstraint(
|
||||
columns: ['employee_id', 'ride_id']
|
||||
)]
|
||||
class Assignment
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Employee::class, inversedBy: 'assignments')]
|
||||
private ?Employee $employee = null;
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Ride::class, inversedBy: 'assignments')]
|
||||
private ?Ride $ride = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?\DateTime $startHour = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?\DateTime $endHour = null;
|
||||
|
||||
public function getStartHour(): ?\DateTime
|
||||
{
|
||||
return $this->startHour;
|
||||
}
|
||||
|
||||
public function getEmployee(): ?Employee
|
||||
{
|
||||
return $this->employee;
|
||||
}
|
||||
|
||||
public function setEmployee(?Employee $employee): void
|
||||
{
|
||||
$this->employee = $employee;
|
||||
}
|
||||
|
||||
public function getRide(): ?Ride
|
||||
{
|
||||
return $this->ride;
|
||||
}
|
||||
|
||||
public function setRide(?Ride $ride): void
|
||||
{
|
||||
$this->ride = $ride;
|
||||
}
|
||||
|
||||
public function setStartHour(?\DateTime $startHour): void
|
||||
{
|
||||
$this->startHour = $startHour;
|
||||
}
|
||||
|
||||
public function getEndHour(): ?\DateTime
|
||||
{
|
||||
return $this->endHour;
|
||||
}
|
||||
|
||||
public function setEndHour(?\DateTime $endHour): void
|
||||
{
|
||||
$this->endHour = $endHour;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
|
||||
use App\Repository\CategoryRepository;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: CategoryRepository::class)]
|
||||
class Category
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 30)]
|
||||
private ?string $label = null;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: MissionCategory::class, mappedBy: 'category')]
|
||||
private Collection $missionCategories;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(int $id): static
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
public function setLabel(string $label): static
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMission(): ?Mission
|
||||
{
|
||||
return $this->mission;
|
||||
}
|
||||
|
||||
public function setMission(?Mission $mission): void
|
||||
{
|
||||
$this->mission = $mission;
|
||||
}
|
||||
|
||||
public function getMissionCategorie(): Collection
|
||||
{
|
||||
return $this->missionCategories;
|
||||
}
|
||||
|
||||
public function addMissionCategory(MissionCategory $missionCategory): static
|
||||
{
|
||||
if(!$this->missionCategories->contains($missionCategory)) {
|
||||
$this->missionCategories->add($missionCategory);
|
||||
$missionCategory->setCategory($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeMissionCategory(MissionCategory $missionCategory): static
|
||||
{
|
||||
if($this->missionCategories->removeElement($missionCategory)) {
|
||||
if($missionCategory->getCategory() === $this) {
|
||||
$missionCategory->setCategory(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,23 +2,161 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Repository\EmployeeRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
#[ORM\Entity(repositoryClass: EmployeeRepository::class)]
|
||||
class Employee
|
||||
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]
|
||||
class Employee implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 180)]
|
||||
private ?string $email = null;
|
||||
|
||||
#[ORM\Column(length: 30)]
|
||||
private ?string $firstName = null;
|
||||
|
||||
#[ORM\Column(length: 30)]
|
||||
private ?string $lastName = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?string $password = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private array $roles = [];
|
||||
|
||||
#[ORM\OneToMany(targetEntity: EmployeeSkill::class, mappedBy: 'employee')]
|
||||
private Collection $employeeSkills;
|
||||
|
||||
//Changer en ManyToMany et pareil dans mission
|
||||
#[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'employee')]
|
||||
private Collection $missions;
|
||||
|
||||
//Changer en OneToMany et inversement dans incident
|
||||
#[ORM\ManyToOne(targetEntity: Incident::class, inversedBy: 'employee')]
|
||||
private Collection $incidents;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Assignment::class, mappedBy: 'employee')]
|
||||
private Collection $assignments;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Representation::class, mappedBy: 'employee')]
|
||||
private Collection $representations;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->assignments = new ArrayCollection();
|
||||
$this->representations = new ArrayCollection();
|
||||
$this->employeeSkills = new ArrayCollection();
|
||||
}
|
||||
|
||||
|
||||
public function getEmployeeSkills(): Collection
|
||||
{
|
||||
return $this->employeeSkills;
|
||||
}
|
||||
|
||||
public function addEmployeeSkill(EmployeeSkill $employeeSkill): static
|
||||
{
|
||||
if(!$this->employeeSkills->contains($employeeSkill)) {
|
||||
$this->employeeSkills->add($employeeSkill);
|
||||
$employeeSkill->setEmployee($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeEmployeeSkill(EmployeeSkill $employeeSkill): static
|
||||
{
|
||||
if($this->employeeSkills->removeElement($employeeSkill)) {
|
||||
if($employeeSkill->getEmployee() === $this) {
|
||||
$employeeSkill->setEmployee(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
// public function getEmployeeMissions(): Collection
|
||||
// {
|
||||
// return $this->employeeMissions;
|
||||
// }
|
||||
//
|
||||
// public function setEmployeeMissions(Collection $employeeMissions): void
|
||||
// {
|
||||
// $this->employeeMissions = $employeeMissions;
|
||||
// }
|
||||
|
||||
// public function getEmployeeIncidents(): Collection
|
||||
// {
|
||||
// return $this->employeeIncidents;
|
||||
// }
|
||||
//
|
||||
// public function setEmployeeIncidents(Collection $employeeIncidents): void
|
||||
// {
|
||||
// $this->employeeIncidents = $employeeIncidents;
|
||||
// }
|
||||
|
||||
public function getAssignments(): Collection
|
||||
{
|
||||
return $this->assignments;
|
||||
}
|
||||
|
||||
public function addAssigment(Assignment $assignment): static
|
||||
{
|
||||
if(!$this->assignments->contains($assignment)) {
|
||||
$this->assignments->add($assignment);
|
||||
$assignment->setEmployee($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeAssigment(Assignment $assignment): static
|
||||
{
|
||||
if($this->assignments->removeElement($assignment)) {
|
||||
if($assignment->getEmployee() === $this) {
|
||||
$assignment->setEmployee(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRepresentations(): Collection
|
||||
{
|
||||
return $this->representations;
|
||||
}
|
||||
|
||||
public function addRepresentation(Representation $representation): static
|
||||
{
|
||||
if(!$this->representations->contains($representation)) {
|
||||
$this->representations->add($representation);
|
||||
$representation->setEmployee($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeRepresentation(Representation $representation): static
|
||||
{
|
||||
if($this->representations->removeElement($representation)) {
|
||||
if($representation->getEmployee() === $this) {
|
||||
$representation->setEmployee(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
@ -31,6 +169,18 @@ class Employee
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): static
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFirstName(): ?string
|
||||
{
|
||||
return $this->firstName;
|
||||
@ -54,4 +204,71 @@ class Employee
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPassword(): ?string
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setPassword(string $password): static
|
||||
{
|
||||
$this->password = $password;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function eraseCredentials(): void
|
||||
{
|
||||
// If you store any temporary, sensitive data on the user, clear it here
|
||||
// $this->plainPassword = null;
|
||||
}
|
||||
|
||||
public function getUserIdentifier(): string
|
||||
{
|
||||
return (string) $this->email;
|
||||
}
|
||||
|
||||
public function getRoles(): array
|
||||
{
|
||||
$roles = $this->roles;
|
||||
// guarantee every user at least has ROLE_USER
|
||||
$roles[] = 'ROLE_USER';
|
||||
|
||||
return array_unique($roles);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<string> $roles
|
||||
*/
|
||||
public function setRoles(array $roles): static
|
||||
{
|
||||
$this->roles = $roles;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMissions(): ?Collection
|
||||
{
|
||||
return $this->missions;
|
||||
}
|
||||
|
||||
public function setMissions(Collection $missions): void
|
||||
{
|
||||
$this->missions = $missions;
|
||||
}
|
||||
|
||||
public function getIncidents(): ?Collection
|
||||
{
|
||||
return $this->incidents;
|
||||
}
|
||||
|
||||
public function setIncidents(Collection $incidents): void
|
||||
{
|
||||
$this->incidents = $incidents;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->firstName . ' ' . $this->lastName;
|
||||
}
|
||||
}
|
||||
|
46
src/Entity/EmployeeSkill.php
Normal file
46
src/Entity/EmployeeSkill.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\EmployeeSkillRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: EmployeeSkillRepository::class)]
|
||||
#[ORM\UniqueConstraint(
|
||||
columns: ['employee', 'skill']
|
||||
)]
|
||||
class EmployeeSkill
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Employee::class, inversedBy: 'employeeSkills')]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private ?Employee $employee = null;
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Skill::class, inversedBy: 'employeeSkills')]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private ?Skill $skill = null;
|
||||
|
||||
public function getSkill(): ?Skill
|
||||
{
|
||||
return $this->skill;
|
||||
}
|
||||
|
||||
public function setSkill(?Skill $skill): void
|
||||
{
|
||||
$this->skill = $skill;
|
||||
}
|
||||
|
||||
public function getEmployee(): ?Employee
|
||||
{
|
||||
return $this->employee;
|
||||
}
|
||||
|
||||
public function setEmployee(?Employee $employee): void
|
||||
{
|
||||
$this->employee = $employee;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\IncidentRepository;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: IncidentRepository::class)]
|
||||
class Incident
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $description = null;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'incident')]
|
||||
private ?Employee $employee;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: IncidentType::class, mappedBy: 'incident')]
|
||||
private ?IncidentType $incidentType;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Ride::class, inversedBy: 'incidents')]
|
||||
private ?Ride $ride;
|
||||
|
||||
public function getEmployeeincidents(): Collection
|
||||
{
|
||||
return $this->employeeincidents;
|
||||
}
|
||||
|
||||
public function setEmployeeincidents(Collection $employeeincidents): void
|
||||
{
|
||||
$this->employeeincidents = $employeeincidents;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(int $id): static
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function setLabel(string $description): static
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmployee(): ?Employee
|
||||
{
|
||||
return $this->employee;
|
||||
}
|
||||
|
||||
public function setEmployee(?Employee $employee): void
|
||||
{
|
||||
$this->employee = $employee;
|
||||
}
|
||||
|
||||
public function getIncidentType(): ?IncidentType
|
||||
{
|
||||
return $this->incidentType;
|
||||
}
|
||||
|
||||
public function setIncidentType(?IncidentType $incidentType): void
|
||||
{
|
||||
$this->incidentType = $incidentType;
|
||||
}
|
||||
|
||||
public function getRide(): ?Ride
|
||||
{
|
||||
return $this->ride;
|
||||
}
|
||||
|
||||
public function setRide(?Ride $ride): void
|
||||
{
|
||||
$this->ride = $ride;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
|
||||
use App\Repository\IncidentTypeRepository;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: IncidentTypeRepository::class)]
|
||||
class IncidentType
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 30)]
|
||||
private ?string $label = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Incident::class, inversedBy: 'incidentType')]
|
||||
private Collection $incidents;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(int $id): static
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
public function setLabel(string $label): static
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIncidents(): Collection
|
||||
{
|
||||
return $this->incidents;
|
||||
}
|
||||
|
||||
public function setIncidents(Collection $incidents): void
|
||||
{
|
||||
$this->incidents = $incidents;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1 +1,150 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
|
||||
use App\Repository\MissionRepository;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: MissionRepository::class)]
|
||||
class Mission
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 30)]
|
||||
private ?string $label = null;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Requirement::class, mappedBy: 'mission')]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'mission')]
|
||||
private Collection $requirements;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'mission')]
|
||||
private ?Employee $employee = null;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: MissionCategory::class, mappedBy: 'mission')]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'mission')]
|
||||
private Collection $missionCategories;
|
||||
|
||||
public function getRequirements(): Collection
|
||||
{
|
||||
return $this->requirements;
|
||||
}
|
||||
|
||||
public function addRequirement(Requirement $requirement): static
|
||||
{
|
||||
if(!$this->requirements->contains($requirement)) {
|
||||
$this->requirements->add($requirement);
|
||||
$requirement->setMission($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeRequirement(Requirement $requirement): static
|
||||
{
|
||||
if($this->requirements->removeElement($requirement)) {
|
||||
if($requirement->getMission() === $this) {
|
||||
$requirement->setMission(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmployeemissions(): Collection
|
||||
{
|
||||
return $this->employeemissions;
|
||||
}
|
||||
|
||||
public function setEmployeemissions(Collection $employeemissions): void
|
||||
{
|
||||
$this->employeemissions = $employeemissions;
|
||||
}
|
||||
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(int $id): static
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
public function setLabel(string $label): static
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmployee(): ?employee
|
||||
{
|
||||
return $this->employee;
|
||||
}
|
||||
|
||||
public function setEmployee(?employee $employee): void
|
||||
{
|
||||
$this->employee = $employee;
|
||||
}
|
||||
|
||||
public function getCategories(): Collection
|
||||
{
|
||||
return $this->categories;
|
||||
}
|
||||
|
||||
public function setCategories(Collection $categories): void
|
||||
{
|
||||
$this->categories = $categories;
|
||||
}
|
||||
|
||||
public function getRide(): ?Ride
|
||||
{
|
||||
return $this->ride;
|
||||
}
|
||||
|
||||
public function setRide(?Ride $ride): void
|
||||
{
|
||||
$this->ride = $ride;
|
||||
}
|
||||
|
||||
public function getMissionCategorie(): Collection
|
||||
{
|
||||
return $this->missionCategories;
|
||||
}
|
||||
|
||||
public function addMissionCategory(MissionCategory $missionCategory): static
|
||||
{
|
||||
if(!$this->missionCategories->contains($missionCategory)) {
|
||||
$this->missionCategories->add($missionCategory);
|
||||
$missionCategory->setMission($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeMissionCategory(MissionCategory $missionCategory): static
|
||||
{
|
||||
if($this->missionCategories->removeElement($missionCategory)) {
|
||||
if($missionCategory->getMission() === $this) {
|
||||
$missionCategory->setMission(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
43
src/Entity/MissionCategory.php
Normal file
43
src/Entity/MissionCategory.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\MissionCategoryRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: MissionCategoryRepository::class)]
|
||||
#[ORM\UniqueConstraint(columns: ['mission', 'category'])]
|
||||
class MissionCategory
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'missionCategories')]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private ?Mission $mission = null;
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Category::class, inversedBy: 'missionCategories')]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private ?Category $category = null;
|
||||
|
||||
public function getMission(): ?Mission
|
||||
{
|
||||
return $this->mission;
|
||||
}
|
||||
|
||||
public function setMission(?Mission $mission): void
|
||||
{
|
||||
$this->mission = $mission;
|
||||
}
|
||||
|
||||
public function getCategory(): ?Category
|
||||
{
|
||||
return $this->category;
|
||||
}
|
||||
|
||||
public function setCategory(?Category $category): void
|
||||
{
|
||||
$this->category = $category;
|
||||
}
|
||||
|
||||
|
||||
}
|
70
src/Entity/Representation.php
Normal file
70
src/Entity/Representation.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\RepresentationRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: RepresentationRepository::class)]
|
||||
#[ORM\UniqueConstraint(
|
||||
columns: ['employee_id', 'ride_id', 'date']
|
||||
)]
|
||||
class Representation
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Employee::class, inversedBy: 'representations')]
|
||||
private ?Employee $employee = null;
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Ride::class, inversedBy: 'representations')]
|
||||
private ?Ride $ride = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?int $count = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?\DateTime $date = null;
|
||||
|
||||
public function getCount(): ?int
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
public function setCount(?int $count): void
|
||||
{
|
||||
$this->count = $count;
|
||||
}
|
||||
|
||||
public function getDate(): ?\DateTime
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
public function setDate(?\DateTime $date): void
|
||||
{
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
public function getEmployee(): ?Employee
|
||||
{
|
||||
return $this->employee;
|
||||
}
|
||||
|
||||
public function setEmployee(?Employee $employee): void
|
||||
{
|
||||
$this->employee = $employee;
|
||||
}
|
||||
|
||||
public function getRide(): ?Ride
|
||||
{
|
||||
return $this->ride;
|
||||
}
|
||||
|
||||
public function setRide(?Ride $ride): void
|
||||
{
|
||||
$this->ride = $ride;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
44
src/Entity/Requirement.php
Normal file
44
src/Entity/Requirement.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
|
||||
use App\Repository\RequirementRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: RequirementRepository::class)]
|
||||
#[ORM\UniqueConstraint(
|
||||
columns: ['mission', 'skill']
|
||||
)]
|
||||
class Requirement
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'requirements')]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private ?Mission $mission = null;
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Skill::class, inversedBy: 'requirements')]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private ?Skill $skill = null;
|
||||
|
||||
public function getMission(): ?Mission
|
||||
{
|
||||
return $this->mission;
|
||||
}
|
||||
|
||||
public function setMission(?Mission $mission): void
|
||||
{
|
||||
$this->mission = $mission;
|
||||
}
|
||||
|
||||
public function getSkill(): ?Skill
|
||||
{
|
||||
return $this->skill;
|
||||
}
|
||||
|
||||
public function setSkill(?Skill $skill): void
|
||||
{
|
||||
$this->skill = $skill;
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\RequirementsRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Mission::class, mappedBy: 'requirements')]
|
||||
#[ORM\OneToMany(targetEntity: Skill::class, mappedBy: 'requirements')]
|
||||
class Requirements
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
}
|
@ -1 +1,147 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\RideRepository;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: RideRepository::class)]
|
||||
class Ride
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 30)]
|
||||
private ?string $label = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?int $count = null;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Assignment::class, mappedBy: 'ride')]
|
||||
private Collection $assignments;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Representation::class, mappedBy: 'ride')]
|
||||
private Collection $representations;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Incident::class, mappedBy: 'ride')]
|
||||
private Collection $incidents;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Mission::class, mappedBy: 'ride')]
|
||||
private Collection $missions;
|
||||
|
||||
public function getAssignments(): Collection
|
||||
{
|
||||
return $this->assignments;
|
||||
}
|
||||
|
||||
public function addAssigment(Assignment $assignment): static
|
||||
{
|
||||
if(!$this->assignments->contains($assignment)) {
|
||||
$this->assignments->add($assignment);
|
||||
$assignment->setRide($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeAssigment(Assignment $assignment): static
|
||||
{
|
||||
if($this->assignments->removeElement($assignment)) {
|
||||
if($assignment->getRide() === $this) {
|
||||
$assignment->setRide(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRepresentations(): Collection
|
||||
{
|
||||
return $this->incidents;
|
||||
}
|
||||
|
||||
public function addRepresentation(Representation $representation): static
|
||||
{
|
||||
if(!$this->representations->contains($representation)) {
|
||||
$this->representations->add($representation);
|
||||
$representation->setRide($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeRepresentation(Representation $representation): static
|
||||
{
|
||||
if($this->representations->removeElement($representation)) {
|
||||
if($representation->getRide() === $this) {
|
||||
$representation->setRide(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(int $id): static
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
public function setLabel(string $label): static
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCount(): ?int
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
public function setCount(int $count): static
|
||||
{
|
||||
$this->count = $count;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMissions(): Collection
|
||||
{
|
||||
return $this->missions;
|
||||
}
|
||||
|
||||
public function setMissions(Collection $missions): void
|
||||
{
|
||||
$this->missions = $missions;
|
||||
}
|
||||
|
||||
public function getIncidents(): Collection
|
||||
{
|
||||
return $this->incidents;
|
||||
}
|
||||
|
||||
public function setIncidents(Collection $incidents): void
|
||||
{
|
||||
$this->incidents = $incidents;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
}
|
||||
|
@ -1 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\SkillRepository;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: SkillRepository::class)]
|
||||
class Skill
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 30)]
|
||||
private ?string $label = null;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Requirement::class, mappedBy: 'skill')]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'skill')]
|
||||
private Collection $requirements;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: EmployeeSkill::class, mappedBy: 'skill')]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'skill')]
|
||||
private Collection $employeeSkills;
|
||||
|
||||
public function getRequirements(): Collection
|
||||
{
|
||||
return $this->requirements;
|
||||
}
|
||||
|
||||
public function addRequirement(Requirement $requirement): static
|
||||
{
|
||||
if(!$this->requirements->contains($requirement)) {
|
||||
$this->requirements->add($requirement);
|
||||
$requirement->setSkill($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeRequirement(Requirement $requirement): static
|
||||
{
|
||||
if($this->requirements->removeElement($requirement)) {
|
||||
if($requirement->getSkill() === $this) {
|
||||
$requirement->setSkill(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(int $id): static
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
public function setLabel(string $label): static
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmployeeSkills(): Collection
|
||||
{
|
||||
return $this->employeeSkills;
|
||||
}
|
||||
|
||||
public function addEmployeeSkill(EmployeeSkill $employeeSkill): static
|
||||
{
|
||||
if(!$this->employeeSkills->contains($employeeSkill)) {
|
||||
$this->employeeSkills->add($employeeSkill);
|
||||
$employeeSkill->setSkill($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeEmployeeSkill(EmployeeSkill $employeeSkill): static
|
||||
{
|
||||
if($this->employeeSkills->removeElement($employeeSkill)) {
|
||||
if($employeeSkill->getSkill() === $this) {
|
||||
$employeeSkill->setSkill(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
28
src/Form/CategoryType.php
Normal file
28
src/Form/CategoryType.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Category;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
|
||||
class CategoryType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('label', TextType::class, [
|
||||
'label' => 'Category label',
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Category::class,
|
||||
]);
|
||||
}
|
||||
}
|
59
src/Form/EmployeeType.php
Normal file
59
src/Form/EmployeeType.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Employee;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\Length;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class EmployeeType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('email', EmailType::class, ['label' => 'Email Address'])
|
||||
->add('firstName', TextType::class, ['label' => 'First Name'])
|
||||
->add('lastName', TextType::class, ['label' => 'Last Name'])
|
||||
->add('roles', ChoiceType::class, [
|
||||
'label' => 'Roles (comma-separated)',
|
||||
'required' => false,
|
||||
'choices' => [
|
||||
'User' => 'ROLE_USER',
|
||||
'Admin' => 'ROLE_ADMIN',
|
||||
],
|
||||
'multiple' => true, // Allow multiple selections
|
||||
'expanded' => true, // Render as checkboxes
|
||||
])
|
||||
->add('plainPassword', PasswordType::class, [
|
||||
// instead of being set onto the object directly,
|
||||
// this is read and encoded in the controller
|
||||
'mapped' => false,
|
||||
'attr' => ['autocomplete' => 'new-password'],
|
||||
'constraints' => [
|
||||
new NotBlank([
|
||||
'message' => 'Please enter a password',
|
||||
]),
|
||||
new Length([
|
||||
'min' => 6,
|
||||
'minMessage' => 'Your password should be at least {{ limit }} characters',
|
||||
// max length allowed by Symfony for security reasons
|
||||
'max' => 4096,
|
||||
]),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Employee::class,
|
||||
]);
|
||||
}
|
||||
}
|
28
src/Form/LoginType.php
Normal file
28
src/Form/LoginType.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
use App\Entity\Employee;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
|
||||
class LoginType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('email', EmailType::class)
|
||||
->add('password', PasswordType::class)
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Employee::class,
|
||||
]);
|
||||
}
|
||||
}
|
25
src/Form/MissionType.php
Normal file
25
src/Form/MissionType.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Mission;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class MissionType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('label')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Mission::class,
|
||||
]);
|
||||
}
|
||||
}
|
39
src/Form/RepresentationType.php
Normal file
39
src/Form/RepresentationType.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Employee;
|
||||
use App\Entity\Representation;
|
||||
use App\Entity\Ride;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class RepresentationType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('employee', EntityType::class, [
|
||||
'class' => Employee::class,
|
||||
'choice_label' => 'email',
|
||||
])
|
||||
->add('ride', EntityType::class, [
|
||||
'class' => Ride::class,
|
||||
'choice_label' => 'label',
|
||||
])
|
||||
->add('count')
|
||||
->add('date', null, [
|
||||
'widget' => 'single_text',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Representation::class,
|
||||
]);
|
||||
}
|
||||
}
|
38
src/Form/RideType.php
Normal file
38
src/Form/RideType.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Incident;
|
||||
use App\Entity\IncidentType;
|
||||
use App\Entity\Mission;
|
||||
use App\Entity\Ride;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class RideType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('label')
|
||||
->add('count')
|
||||
->add('incidents', EntityType::class, [
|
||||
'class' => Incident::class,
|
||||
'choice_label' => 'id',
|
||||
])
|
||||
->add('missions', EntityType::class, [
|
||||
'class' => Mission::class,
|
||||
'choice_label' => 'id',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Ride::class,
|
||||
]);
|
||||
}
|
||||
}
|
43
src/Repository/AssignmentRepository.php
Normal file
43
src/Repository/AssignmentRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Assignment;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Assignment>
|
||||
*/
|
||||
class AssignmentRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Assignment::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Assignment[] Returns an array of Assignment 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): ?Assignment
|
||||
// {
|
||||
// return $this->createQueryBuilder('a')
|
||||
// ->andWhere('a.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
43
src/Repository/CategoryRepository.php
Normal file
43
src/Repository/CategoryRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Category;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Category>
|
||||
*/
|
||||
class CategoryRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Category::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Category[] Returns an array of Category 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): ?Category
|
||||
// {
|
||||
// return $this->createQueryBuilder('c')
|
||||
// ->andWhere('c.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
60
src/Repository/EmployeeRepository.php
Normal file
60
src/Repository/EmployeeRepository.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Employee;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Employee>
|
||||
*/
|
||||
class EmployeeRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Employee::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to upgrade (rehash) the user's password automatically over time.
|
||||
*/
|
||||
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
|
||||
{
|
||||
if (!$user instanceof Employee) {
|
||||
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $user::class));
|
||||
}
|
||||
|
||||
$user->setPassword($newHashedPassword);
|
||||
$this->getEntityManager()->persist($user);
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Employee[] Returns an array of Employee 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): ?Employee
|
||||
// {
|
||||
// return $this->createQueryBuilder('e')
|
||||
// ->andWhere('e.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
43
src/Repository/EmployeeSkillRepository.php
Normal file
43
src/Repository/EmployeeSkillRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\EmployeeSkill;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<EmployeeSkill>
|
||||
*/
|
||||
class EmployeeSkillRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, EmployeeSkill::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return EmployeeSkill[] Returns an array of EmployeeSkill 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): ?EmployeeSkill
|
||||
// {
|
||||
// return $this->createQueryBuilder('e')
|
||||
// ->andWhere('e.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
43
src/Repository/IncidentRepository.php
Normal file
43
src/Repository/IncidentRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Incident;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Incident>
|
||||
*/
|
||||
class IncidentRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Incident::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Incident[] Returns an array of Incident objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('i')
|
||||
// ->andWhere('i.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('i.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Incident
|
||||
// {
|
||||
// return $this->createQueryBuilder('i')
|
||||
// ->andWhere('i.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
43
src/Repository/IncidentTypeRepository.php
Normal file
43
src/Repository/IncidentTypeRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\IncidentType;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<IncidentType>
|
||||
*/
|
||||
class IncidentTypeRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, IncidentType::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return IncidentType[] Returns an array of IncidentType objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('i')
|
||||
// ->andWhere('i.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('i.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?IncidentType
|
||||
// {
|
||||
// return $this->createQueryBuilder('i')
|
||||
// ->andWhere('i.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
43
src/Repository/MissionCategoryRepository.php
Normal file
43
src/Repository/MissionCategoryRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\MissionCategory;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<MissionCategory>
|
||||
*/
|
||||
class MissionCategoryRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, MissionCategory::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return MissionCategory[] Returns an array of MissionCategory objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('m')
|
||||
// ->andWhere('m.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('m.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?MissionCategory
|
||||
// {
|
||||
// return $this->createQueryBuilder('m')
|
||||
// ->andWhere('m.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
43
src/Repository/MissionRepository.php
Normal file
43
src/Repository/MissionRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Mission;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Mission>
|
||||
*/
|
||||
class MissionRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Mission::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Mission[] Returns an array of Mission objects
|
||||
*/
|
||||
public function findByExampleField($value): array
|
||||
{
|
||||
return $this->createQueryBuilder('m')
|
||||
->andWhere('m.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('m.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function findOneBySomeField($value): ?Mission
|
||||
{
|
||||
return $this->createQueryBuilder('m')
|
||||
->andWhere('m.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
}
|
43
src/Repository/RepresentationRepository.php
Normal file
43
src/Repository/RepresentationRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Representation;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Representation>
|
||||
*/
|
||||
class RepresentationRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Representation::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Representation[] Returns an array of Representation objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('r')
|
||||
// ->andWhere('r.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('r.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Representation
|
||||
// {
|
||||
// return $this->createQueryBuilder('r')
|
||||
// ->andWhere('r.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
43
src/Repository/RequirementRepository.php
Normal file
43
src/Repository/RequirementRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Requirement;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Requirement>
|
||||
*/
|
||||
class RequirementRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Requirement::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Requirement[] Returns an array of Requirement objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('r')
|
||||
// ->andWhere('r.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('r.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Requirement
|
||||
// {
|
||||
// return $this->createQueryBuilder('r')
|
||||
// ->andWhere('r.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
43
src/Repository/RideRepository.php
Normal file
43
src/Repository/RideRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Ride;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Ride>
|
||||
*/
|
||||
class RideRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Ride::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Ride[] Returns an array of Ride objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('r')
|
||||
// ->andWhere('r.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('r.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Ride
|
||||
// {
|
||||
// return $this->createQueryBuilder('r')
|
||||
// ->andWhere('r.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
43
src/Repository/SkillRepository.php
Normal file
43
src/Repository/SkillRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Skill;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Skill>
|
||||
*/
|
||||
class SkillRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Skill::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Skill[] Returns an array of Skill objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('s')
|
||||
// ->andWhere('s.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('s.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Skill
|
||||
// {
|
||||
// return $this->createQueryBuilder('s')
|
||||
// ->andWhere('s.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
60
src/Security/LoginFormAuthenticator.php
Normal file
60
src/Security/LoginFormAuthenticator.php
Normal 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 LoginFormAuthenticator extends AbstractLoginFormAuthenticator
|
||||
{
|
||||
use TargetPathTrait;
|
||||
|
||||
public const LOGIN_ROUTE = 'security_login';
|
||||
|
||||
public function __construct(private UrlGeneratorInterface $urlGenerator)
|
||||
{
|
||||
}
|
||||
|
||||
public function authenticate(Request $request): Passport
|
||||
{
|
||||
$email = $request->getPayload()->getString('_username');
|
||||
|
||||
$request->getSession()->set(SecurityRequestAttributes::LAST_USERNAME, $email);
|
||||
|
||||
return new Passport(
|
||||
new UserBadge($email),
|
||||
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('dashboard'));
|
||||
//return new RedirectResponse($this->urlGenerator->generate('DashboardController'));
|
||||
}
|
||||
|
||||
protected function getLoginUrl(Request $request): string
|
||||
{
|
||||
return $this->urlGenerator->generate(self::LOGIN_ROUTE);
|
||||
}
|
||||
}
|
61
src/Service/RelationService.php
Normal file
61
src/Service/RelationService.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
|
||||
use App\Entity\Assignment;
|
||||
use App\Entity\Category;
|
||||
use App\Entity\Employee;
|
||||
use App\Entity\EmployeeSkill;
|
||||
use App\Entity\Mission;
|
||||
use App\Entity\MissionCategory;
|
||||
use App\Entity\Representation;
|
||||
use App\Entity\Requirement;
|
||||
use App\Entity\Ride;
|
||||
use App\Entity\Skill;
|
||||
|
||||
class RelationService {
|
||||
public function setAssignment(Ride $ride, Employee $employee, \DateTime $startHour, \DateTime $endHour )
|
||||
{
|
||||
$assignment = new Assignment();
|
||||
|
||||
$assignment->setEmployee($employee);
|
||||
$assignment->setRide($ride);
|
||||
$assignment->setStartHour($startHour);
|
||||
$assignment->setEndHour($endHour);
|
||||
}
|
||||
|
||||
public function setEmployeeSkill(Skill $skill, Employee $employee )
|
||||
{
|
||||
$employeeSkill = new EmployeeSkill();
|
||||
|
||||
$employeeSkill->setEmployee($employee);
|
||||
$employeeSkill->setSkill($skill);
|
||||
}
|
||||
|
||||
public function setMissionCategory(Mission $mission, Category $category )
|
||||
{
|
||||
$missionCategory = new MissionCategory();
|
||||
|
||||
$missionCategory->setMission($mission);
|
||||
$missionCategory->setCategory($category);
|
||||
}
|
||||
|
||||
public function setRepresentation(Ride $ride, Employee $employee,int $count ,\DateTime $date )
|
||||
{
|
||||
$representation = new Representation();
|
||||
|
||||
$representation->setRide($ride);
|
||||
$representation->setEmployee($employee);
|
||||
$representation->setCount($count);
|
||||
$representation->setDate($date);
|
||||
}
|
||||
|
||||
public function setRequirement(Skill $skill, Mission $mission )
|
||||
{
|
||||
$requirement = new Requirement();
|
||||
|
||||
$requirement->setSkill($skill);
|
||||
$requirement->setMission($mission);
|
||||
}
|
||||
}
|
@ -288,6 +288,9 @@
|
||||
"config/packages/messenger.yaml"
|
||||
]
|
||||
},
|
||||
"symfonycasts/verify-email-bundle": {
|
||||
"version": "v1.17.0"
|
||||
},
|
||||
"twig/extra-bundle": {
|
||||
"version": "v3.13.0"
|
||||
}
|
||||
|
21
templates/affectation/index.html.twig
Normal file
21
templates/affectation/index.html.twig
Normal file
@ -0,0 +1,21 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Affectation{% endblock %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
|
||||
<div class="wrapper">
|
||||
<h1>Affectation des utilisateurs.</h1>
|
||||
|
||||
{% for employee in employees %}
|
||||
<tr>
|
||||
<td>{{ employee.id }}</td>
|
||||
</tr>
|
||||
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="7">no records found</td>
|
||||
</tr>
|
||||
</div>
|
||||
{% endblock %}
|
@ -4,6 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Welcome!{% endblock %}</title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
{% block stylesheets %}
|
||||
{% endblock %}
|
||||
|
||||
@ -12,6 +13,51 @@
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
|
||||
{% for label, messages in app.flashes %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ label }}">{{ message }}</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="ml-5 mr-5 ">
|
||||
<nav class="navbar navbar-expand-lg navbar-dark p-3 m-2 rounded hegre-navbar">
|
||||
<a class="navbar-brand " href="#">
|
||||
<img src="https://getbootstrap.com/docs/4.4/assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top" alt="">
|
||||
HegreLand
|
||||
</a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="{{ path('dashboard') }}">Dashboard<span class="sr-only"></span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ path('ride_index') }}">Attractions</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ path('representation_index') }}">Représentation</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ path('employee_index') }}">Employées</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
|
||||
{% block body %}
|
||||
|
||||
{% endblock %}
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
4
templates/category/_delete_form.html.twig
Normal file
4
templates/category/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
<form method="post" action="{{ path('app_category_delete', {'id': category.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ category.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/category/_form.html.twig
Normal file
4
templates/category/_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
13
templates/category/edit.html.twig
Normal file
13
templates/category/edit.html.twig
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Category{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Category</h1>
|
||||
|
||||
{{ include('category/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('app_category_index') }}">back to list</a>
|
||||
|
||||
{{ include('category/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
34
templates/category/index.html.twig
Normal file
34
templates/category/index.html.twig
Normal file
@ -0,0 +1,34 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Category index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Liste des catégories disponibles :</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Label</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for category in categories %}
|
||||
<tr>
|
||||
<td>{{ category.id }}</td>
|
||||
<td>{{ category.label }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_category_edit', {'id': category.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_category_new') }}">Create new</a>
|
||||
{% endblock %}
|
11
templates/category/new.html.twig
Normal file
11
templates/category/new.html.twig
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Category{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Category</h1>
|
||||
|
||||
{{ include('category/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('app_category_index') }}">back to list</a>
|
||||
{% endblock %}
|
@ -2,11 +2,11 @@
|
||||
|
||||
{% block title %}Dashboard{% endblock %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
|
||||
<div class="wrapper">
|
||||
<h1>Welcome, *Dashboard User* !</h1>
|
||||
|
||||
This is a placeholder.
|
||||
</div>
|
||||
{% endblock %}
|
4
templates/employee/_delete_form.html.twig
Normal file
4
templates/employee/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
<form method="post" action="{{ path('employee_delete', {'id': employee.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ employee.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/employee/_form.html.twig
Normal file
4
templates/employee/_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
13
templates/employee/edit.html.twig
Normal file
13
templates/employee/edit.html.twig
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Employee{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Employee</h1>
|
||||
|
||||
{{ include('employee/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('employee_index') }}">back to list</a>
|
||||
|
||||
{{ include('employee/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
41
templates/employee/index.html.twig
Normal file
41
templates/employee/index.html.twig
Normal file
@ -0,0 +1,41 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Employee index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Employee index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Email</th>
|
||||
<th>FirstName</th>
|
||||
<th>LastName</th>
|
||||
<th>Roles</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for employee in employees %}
|
||||
<tr>
|
||||
<td>{{ employee.id }}</td>
|
||||
<td>{{ employee.email }}</td>
|
||||
<td>{{ employee.firstName }}</td>
|
||||
<td>{{ employee.lastName }}</td>
|
||||
<td>{{ employee.roles ? employee.roles|json_encode : '' }}</td>
|
||||
<td>
|
||||
<a href="{{ path('employee_show', {'id': employee.id}) }}">show</a>
|
||||
<a href="{{ path('employee_edit', {'id': employee.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="7">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('employee_new') }}">Create new</a>
|
||||
{% endblock %}
|
11
templates/employee/new.html.twig
Normal file
11
templates/employee/new.html.twig
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Employee{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Employee</h1>
|
||||
|
||||
{{ include('employee/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('employee_index') }}">back to list</a>
|
||||
{% endblock %}
|
38
templates/employee/show.html.twig
Normal file
38
templates/employee/show.html.twig
Normal file
@ -0,0 +1,38 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Employee{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Employee</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ employee.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Email</th>
|
||||
<td>{{ employee.email }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>FirstName</th>
|
||||
<td>{{ employee.firstName }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>LastName</th>
|
||||
<td>{{ employee.lastName }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Roles</th>
|
||||
<td>{{ employee.roles ? employee.roles|json_encode : '' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('employee_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('employee_edit', {'id': employee.id}) }}">edit</a>
|
||||
|
||||
{{ include('employee/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
4
templates/mission/_delete_form.html.twig
Normal file
4
templates/mission/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
<form method="post" action="{{ path('_delete', {'id': mission.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ mission.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/mission/_form.html.twig
Normal file
4
templates/mission/_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
13
templates/mission/edit.html.twig
Normal file
13
templates/mission/edit.html.twig
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Mission{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Mission</h1>
|
||||
|
||||
{{ include('mission/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('app_mission_index') }}">back to list</a>
|
||||
|
||||
{{ include('mission/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
35
templates/mission/index.html.twig
Normal file
35
templates/mission/index.html.twig
Normal file
@ -0,0 +1,35 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Mission index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Mission index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Label</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for mission in missions %}
|
||||
<tr>
|
||||
<td>{{ mission.id }}</td>
|
||||
<td>{{ mission.label }}</td>
|
||||
<td>
|
||||
<a href="{{ path('mission_show', {'id': mission.id}) }}">show</a>
|
||||
<a href="{{ path('mission_edit', {'id': mission.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('mission_new') }}">Create new</a>
|
||||
{% endblock %}
|
11
templates/mission/new.html.twig
Normal file
11
templates/mission/new.html.twig
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Mission{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Mission</h1>
|
||||
|
||||
{{ include('mission/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('mission_index') }}">back to list</a>
|
||||
{% endblock %}
|
26
templates/mission/show.html.twig
Normal file
26
templates/mission/show.html.twig
Normal file
@ -0,0 +1,26 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Mission{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Mission</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ mission.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Label</th>
|
||||
<td>{{ mission.label }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('_edit', {'id': mission.id}) }}">edit</a>
|
||||
|
||||
{{ include('mission/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
4
templates/representation/_delete_form.html.twig
Normal file
4
templates/representation/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
<form method="post" action="{{ path('app_representation_delete', {'employee': representation.employee}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ representation.employee) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/representation/_form.html.twig
Normal file
4
templates/representation/_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
13
templates/representation/edit.html.twig
Normal file
13
templates/representation/edit.html.twig
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Representation{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Representation</h1>
|
||||
|
||||
{{ include('representation/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('representation_index') }}">back to list</a>
|
||||
|
||||
{{ include('representation/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
39
templates/representation/index.html.twig
Normal file
39
templates/representation/index.html.twig
Normal file
@ -0,0 +1,39 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Representation index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Representation index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Employee</th>
|
||||
<th>Ride</th>
|
||||
<th>Count</th>
|
||||
<th>Date</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for representation in representations %}
|
||||
<tr>
|
||||
<td>{{ representation.employee }}</td>
|
||||
<td>{{ representation.ride }}</td>
|
||||
<td>{{ representation.count }}</td>
|
||||
<td>{{ representation.date ? representation.date|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>
|
||||
<a href="{{ path('representation_show', {'employee': representation.employee}) }}">show</a>
|
||||
<a href="{{ path('representation_edit', {'employee': representation.employee}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="5">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('representation_new') }}">Create new</a>
|
||||
{% endblock %}
|
11
templates/representation/new.html.twig
Normal file
11
templates/representation/new.html.twig
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Representation{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Representation</h1>
|
||||
|
||||
{{ include('representation/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('representation_index') }}">back to list</a>
|
||||
{% endblock %}
|
34
templates/representation/show.html.twig
Normal file
34
templates/representation/show.html.twig
Normal file
@ -0,0 +1,34 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Representation{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Representation</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Employee</th>
|
||||
<td>{{ representation.employee }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Ride</th>
|
||||
<td>{{ representation.ride }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Count</th>
|
||||
<td>{{ representation.count }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<td>{{ representation.date ? representation.date|date('Y-m-d H:i:s') : '' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('representation_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('representation_edit', {'employee': representation.employee}) }}">edit</a>
|
||||
|
||||
{{ include('representation/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
4
templates/ride/_delete_form.html.twig
Normal file
4
templates/ride/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
<form method="post" action="{{ path('ride_delete', {'id': ride.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ ride.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/ride/_form.html.twig
Normal file
4
templates/ride/_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
13
templates/ride/edit.html.twig
Normal file
13
templates/ride/edit.html.twig
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Ride{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Ride</h1>
|
||||
|
||||
{{ include('ride/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('ride_index') }}">back to list</a>
|
||||
|
||||
{{ include('ride/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
37
templates/ride/index.html.twig
Normal file
37
templates/ride/index.html.twig
Normal file
@ -0,0 +1,37 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Ride index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Ride index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Label</th>
|
||||
<th>Count</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for ride in rides %}
|
||||
<tr>
|
||||
<td>{{ ride.id }}</td>
|
||||
<td>{{ ride.label }}</td>
|
||||
<td>{{ ride.count }}</td>
|
||||
<td>
|
||||
<a href="{{ path('ride_show', {'id': ride.id}) }}">show</a>
|
||||
<a href="{{ path('ride_edit', {'id': ride.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="4">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('ride_new') }}">Create new</a>
|
||||
{% endblock %}
|
11
templates/ride/new.html.twig
Normal file
11
templates/ride/new.html.twig
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Ride{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Ride</h1>
|
||||
|
||||
{{ include('ride/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('ride_index') }}">back to list</a>
|
||||
{% endblock %}
|
36
templates/ride/show.html.twig
Normal file
36
templates/ride/show.html.twig
Normal file
@ -0,0 +1,36 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Ride{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block body %}
|
||||
<h1>Ride</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ ride.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Label</th>
|
||||
<td>{{ ride.label }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Count</th>
|
||||
<td>{{ ride.count }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<a href="{{ path('ride_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('ride_edit', {'id': ride.id}) }}">edit</a>
|
||||
|
||||
<form method="post" action="{{ path('ride_increment', {'id': ride.id}) }}" onsubmit="return confirm('Attraction complète ?');">
|
||||
|
||||
{{ include('ride/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
41
templates/security/login.html.twig
Normal file
41
templates/security/login.html.twig
Normal file
@ -0,0 +1,41 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}HegreLand{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form method="post">
|
||||
{% if error %}
|
||||
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.user %}
|
||||
<div class="mb-3">
|
||||
You are logged in as {{ app.user.userIdentifier }}, <a href="{{ path('security_logout') }}">Logout</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
|
||||
<label for="username">Email</label>
|
||||
<input type="email" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="email" required autofocus>
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>
|
||||
|
||||
<input type="hidden" name="_csrf_token"
|
||||
value="{{ csrf_token('authenticate') }}"
|
||||
>
|
||||
|
||||
{#
|
||||
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
|
||||
See https://symfony.com/doc/current/security/remember_me.html
|
||||
|
||||
<div class="checkbox mb-3">
|
||||
<input type="checkbox" name="_remember_me" id="_remember_me">
|
||||
<label for="_remember_me">Remember me</label>
|
||||
</div>
|
||||
#}
|
||||
|
||||
<button class="btn btn-lg btn-primary" type="submit">
|
||||
Sign in
|
||||
</button>
|
||||
</form>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user