From aeb96e4b68afb044b4482b5dbb5bcc3801b89c7a Mon Sep 17 00:00:00 2001 From: ragueneaul Date: Thu, 21 Nov 2024 16:31:49 +0100 Subject: [PATCH 1/2] templates --- .idea/dataSources.xml | 12 ++++ .idea/workspace.xml | 33 +++++++++-- src/Controller/FaultController.php | 46 ++++++++++++--- src/Controller/InterventionController.php | 43 ++++++++++++-- src/Controller/LoginController.php | 18 ------ src/Controller/SkillController.php | 2 +- src/Controller/StockController.php | 64 +++++++++++++++++++-- src/Controller/UserController.php | 70 +++++++++++++++++++++-- src/Controller/VehicleController.php | 2 +- src/Form/FaultType.php | 28 +++++++++ src/Form/StockType.php | 33 +++++++++++ src/Form/UserType.php | 35 ++++++++++++ templates/fault/add.html.twig | 10 ++++ templates/fault/index.html.twig | 20 ------- templates/fault/list.html.twig | 9 +++ templates/stock/add.html.twig | 10 ++++ templates/stock/index.html.twig | 20 ------- templates/stock/list.html.twig | 11 ++++ templates/user/add.html.twig | 10 ++++ templates/user/index.html.twig | 20 ------- templates/user/list.html.twig | 14 +++++ 21 files changed, 401 insertions(+), 109 deletions(-) create mode 100644 .idea/dataSources.xml delete mode 100644 src/Controller/LoginController.php create mode 100644 src/Form/FaultType.php create mode 100644 src/Form/StockType.php create mode 100644 src/Form/UserType.php create mode 100644 templates/fault/add.html.twig delete mode 100644 templates/fault/index.html.twig create mode 100644 templates/fault/list.html.twig create mode 100644 templates/stock/add.html.twig delete mode 100644 templates/stock/index.html.twig create mode 100644 templates/stock/list.html.twig create mode 100644 templates/user/add.html.twig delete mode 100644 templates/user/index.html.twig create mode 100644 templates/user/list.html.twig diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml new file mode 100644 index 0000000..08c0eb6 --- /dev/null +++ b/.idea/dataSources.xml @@ -0,0 +1,12 @@ + + + + + postgresql + true + org.postgresql.Driver + jdbc:postgresql://172.20.96.1:5432/chauffageproj + $ProjectFileDir$ + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d042e16..966b661 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,8 +5,18 @@ - + + + + + + + + + + + $PROJECT_DIR$/composer.json - + + + - + @@ -166,14 +178,20 @@ @@ -190,8 +208,8 @@ - @@ -206,6 +224,9 @@ + + + diff --git a/src/Controller/FaultController.php b/src/Controller/FaultController.php index 4267375..dc9d09a 100644 --- a/src/Controller/FaultController.php +++ b/src/Controller/FaultController.php @@ -2,17 +2,49 @@ namespace App\Controller; +use App\Entity\Fault; +use App\Form\FaultType; +use App\Repository\FaultRepository; +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; - +use Symfony\Component\Routing\Annotation\Route; class FaultController extends AbstractController { - #[Route('/fault', name: 'app_fault')] - public function index(): Response + public function __construct( + private readonly EntityManagerInterface $entityManager, + private readonly FaultRepository $faultRepository + ) { - return $this->render('fault/index.html.twig', [ - 'controller_name' => 'FaultController', + } + #[Route('/fault/add', name: 'fault_add')] + public function add(Request $request): Response + { + $fault = new Fault(); + $form = $this->createForm(FaultType::class, $fault); + $form->handleRequest($request); + + if($form->isSubmitted() && $form->isValid()) + { + $this->entityManager->persist($fault); + $this->entityManager->flush(); + + return $this->redirectToRoute("app_fault_list"); + } + + return $this->render('fault/add.html.twig', [ + 'form' => $form, ]); } -} + + #[Route('/fault/list', name: 'fault_list')] + public function list(): Response + { + $fault = $this->faultRepository->findAll(); + + return $this->render('fault/list.html.twig', [ + 'fault' => $fault, + ]); + } +} \ No newline at end of file diff --git a/src/Controller/InterventionController.php b/src/Controller/InterventionController.php index 1f752e6..4c9b0c6 100644 --- a/src/Controller/InterventionController.php +++ b/src/Controller/InterventionController.php @@ -2,17 +2,50 @@ namespace App\Controller; +use App\Entity\Intervention; +use App\Form\InterventionType; +use App\Repository\InterventionRepository; +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; class InterventionController extends AbstractController { - #[Route('/intervention', name: 'app_intervention')] - public function index(): Response + public function __construct( + private readonly EntityManagerInterface $entityManager, + private readonly InterventionRepository $interventionRepository + ) { - return $this->render('intervention/index.html.twig', [ - 'controller_name' => 'InterventionController', + } + #[\Symfony\Component\Routing\Annotation\Route('/intervention/add', name: 'fault_add')] + public function add(Request $request): Response + { + $fault = new Intervention(); + $form = $this->createForm(InterventionType::class, $fault); + $form->handleRequest($request); + + if($form->isSubmitted() && $form->isValid()) + { + $this->entityManager->persist($fault); + $this->entityManager->flush(); + + return $this->redirectToRoute("app_fault_list"); + } + + return $this->render('fault/add.html.twig', [ + 'form' => $form, ]); } -} + + #[Route('/fault/list', name: 'fault_list')] + public function list(): Response + { + $fault = $this->faultRepository->findAll(); + + return $this->render('fault/list.html.twig', [ + 'fault' => $fault, + ]); + } +} \ No newline at end of file diff --git a/src/Controller/LoginController.php b/src/Controller/LoginController.php deleted file mode 100644 index 4946695..0000000 --- a/src/Controller/LoginController.php +++ /dev/null @@ -1,18 +0,0 @@ -render('login/index.html.twig', [ - 'controller_name' => 'LoginController', - ]); - } -} diff --git a/src/Controller/SkillController.php b/src/Controller/SkillController.php index 810fb3c..c828d2a 100644 --- a/src/Controller/SkillController.php +++ b/src/Controller/SkillController.php @@ -11,7 +11,7 @@ class SkillController extends AbstractController #[Route('/skill', name: 'app_skill')] public function index(): Response { - return $this->render('skill/index.html.twig', [ + return $this->render('skill/add.html.twig', [ 'controller_name' => 'SkillController', ]); } diff --git a/src/Controller/StockController.php b/src/Controller/StockController.php index a0400ed..52df48c 100644 --- a/src/Controller/StockController.php +++ b/src/Controller/StockController.php @@ -2,17 +2,69 @@ namespace App\Controller; +use App\Entity\Stock; +use App\Form\StockType; +use App\Repository\StockRepository; +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; +use Symfony\Component\Routing\Annotation\Route; class StockController extends AbstractController { - #[Route('/stock', name: 'app_stock')] - public function index(): Response + public function __construct( + private readonly EntityManagerInterface $entityManager, + private readonly StockRepository $stockRepository + ) { - return $this->render('stock/index.html.twig', [ - 'controller_name' => 'StockController', + } + + #[Route('/stock/add', name: 'stock_add')] + public function add(Request $request): Response + { + $stock = new Stock(); + $form = $this->createForm(StockType::class, $stock); + $form->handleRequest($request); + + if($form->isSubmitted() && $form->isValid()) + { + $this->entityManager->persist($stock); + $this->entityManager->flush(); + } + + return $this->render('stock/add.html.twig', [ + 'form' => $form, ]); } -} + + #[Route('/stock/list', name: 'stock_list')] + public function list(): Response + { + $stocks = $this->stockRepository->findAll(); + + return $this->render('stock/list.html.twig', [ + 'stocks' => $stocks, + ]); + } + + #[Route('/stock/update/{id}', name: 'stock_update')] + public function update(int $id, Request $request): Response + { + $stock = $this->stockRepository->find($id); + $form = $this->createForm(StockType::class, $stock); + $form->handleRequest($request); + + if($form->isSubmitted() && $form->isValid()) + { + $this->entityManager->persist($stock); + $this->entityManager->flush(); + } + + return $this->render('stock/add.html.twig', [ + 'form' => $form, + ]); + } + + +} \ No newline at end of file diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 25942d8..70588d5 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -2,17 +2,77 @@ namespace App\Controller; +use App\Entity\User; +use App\Form\UserType; +use App\Repository\UserRepository; +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; +use Symfony\Component\Routing\Annotation\Route; class UserController extends AbstractController { - #[Route('/user', name: 'app_user')] - public function index(): Response + public function __construct( + private readonly EntityManagerInterface $entityManager, + private readonly UserRepository $userRepository + ) { - return $this->render('user/index.html.twig', [ - 'controller_name' => 'UserController', + } + + #[Route('/user/add', name: 'user_add')] + public function add(Request $request): Response + { + $user = new User(); + $form = $this->createForm(UserType::class, $user); + $form->handleRequest($request); + + if($form->isSubmitted() && $form->isValid()) + { + $this->entityManager->persist($user); + $this->entityManager->flush(); + } + + return $this->render('user/add.html.twig', [ + 'form' => $form, ]); } + + #[Route('/user/list', name: 'user_list')] + public function list(): Response + { + $users = $this->userRepository->findAll(); + + return $this->render('user/list.html.twig', [ + 'users' => $users, + ]); + } + + #[Route('/user/update/{id}', name: 'user_update')] + public function update(int $id, Request $request): Response + { + $user = $this->userRepository->find($id); + $form = $this->createForm(UserType::class, $user); + $form->handleRequest($request); + + if($form->isSubmitted() && $form->isValid()) + { + $this->entityManager->persist($user); + $this->entityManager->flush(); + } + + return $this->render('user/add.html.twig', [ + 'form' => $form, + ]); + } + + #[Route('/user/delete/{id}', name: '_delete')] + public function delete(int $id): Response + { + $user = $this->userRepository->find($id); + $this->entityManager->remove($user); + $this->entityManager->flush(); + + return $this->redirectToRoute('app_user_list'); + } } diff --git a/src/Controller/VehicleController.php b/src/Controller/VehicleController.php index 80068bd..ffc6bf0 100644 --- a/src/Controller/VehicleController.php +++ b/src/Controller/VehicleController.php @@ -11,7 +11,7 @@ class VehicleController extends AbstractController #[Route('/vehicle', name: 'app_vehicle')] public function index(): Response { - return $this->render('vehicle/index.html.twig', [ + return $this->render('vehicle/add.html.twig', [ 'controller_name' => 'VehicleController', ]); } diff --git a/src/Form/FaultType.php b/src/Form/FaultType.php new file mode 100644 index 0000000..9960312 --- /dev/null +++ b/src/Form/FaultType.php @@ -0,0 +1,28 @@ +add('Wording', TextType::class) + ->add('save', SubmitType::class) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + // Configure your form options here + ]); + } +} diff --git a/src/Form/StockType.php b/src/Form/StockType.php new file mode 100644 index 0000000..a8480f7 --- /dev/null +++ b/src/Form/StockType.php @@ -0,0 +1,33 @@ +add('Wording', TextType::class) + ->add('Description', TextType::class) + ->add('Quantity', IntegerType::class) + ->add('save', SubmitType::class) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Stock::class, + ]); + } +} diff --git a/src/Form/UserType.php b/src/Form/UserType.php new file mode 100644 index 0000000..7bef9c4 --- /dev/null +++ b/src/Form/UserType.php @@ -0,0 +1,35 @@ +add('FirstName', TextType::class) + ->add('LastName', TextType::class) + ->add('BirthDate', DateType::class) + ->add('Email', EmailType::class) + ->add('Phone', TextType::class) + ->add('Type', TextType::class) + ->add('Save', SubmitType::class) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => User::class, + ]); + } +} diff --git a/templates/fault/add.html.twig b/templates/fault/add.html.twig new file mode 100644 index 0000000..601e2ec --- /dev/null +++ b/templates/fault/add.html.twig @@ -0,0 +1,10 @@ +{% extends 'base.html.twig' %} + +{% block title %}Ajouter une panne{% endblock %} + +{% block body %} +

Ajouter une panne

+ + {{ form(form) }} + +{% endblock %} diff --git a/templates/fault/index.html.twig b/templates/fault/index.html.twig deleted file mode 100644 index d3b62c1..0000000 --- a/templates/fault/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello FaultController!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at E:/BTS/PhpStorm/HegreEtConfort/src/Controller/FaultController.php
  • -
  • Your template at E:/BTS/PhpStorm/HegreEtConfort/templates/fault/index.html.twig
  • -
-
-{% endblock %} diff --git a/templates/fault/list.html.twig b/templates/fault/list.html.twig new file mode 100644 index 0000000..1a84c39 --- /dev/null +++ b/templates/fault/list.html.twig @@ -0,0 +1,9 @@ +{% extends 'base.html.twig' %} + +{% block title %}Hello UserController!{% endblock %} + +{% block body %} + {% for user in users %} + {{ fault.Wording }} + {% endfor %} +{% endblock %} \ No newline at end of file diff --git a/templates/stock/add.html.twig b/templates/stock/add.html.twig new file mode 100644 index 0000000..0f684e5 --- /dev/null +++ b/templates/stock/add.html.twig @@ -0,0 +1,10 @@ +{% extends 'base.html.twig' %} + +{% block title %}Ajouter un utilisateur{% endblock %} + +{% block body %} +

Ajouter du stock

+ + {{ form(form) }} + +{% endblock %} diff --git a/templates/stock/index.html.twig b/templates/stock/index.html.twig deleted file mode 100644 index 72d4681..0000000 --- a/templates/stock/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello StockController!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at E:/BTS/PhpStorm/HegreEtConfort/src/Controller/StockController.php
  • -
  • Your template at E:/BTS/PhpStorm/HegreEtConfort/templates/stock/index.html.twig
  • -
-
-{% endblock %} diff --git a/templates/stock/list.html.twig b/templates/stock/list.html.twig new file mode 100644 index 0000000..4cd9c76 --- /dev/null +++ b/templates/stock/list.html.twig @@ -0,0 +1,11 @@ +{% extends 'base.html.twig' %} + +{% block title %}Hello StockController!{% endblock %} + +{% block body %} + {% for stock in stocks %} + {{ stock.Wording }} + {{ stock.Description }} + {{ stock.Quantity }} + {% endfor %} +{% endblock %} \ No newline at end of file diff --git a/templates/user/add.html.twig b/templates/user/add.html.twig new file mode 100644 index 0000000..3440b9d --- /dev/null +++ b/templates/user/add.html.twig @@ -0,0 +1,10 @@ +{# templates/user/add.html.twig #} +{% extends 'base.html.twig' %} + +{% block title %}Ajouter un utilisateur{% endblock %} + +{% block body %} +

Ajouter un utilisateur

+ + {{ form(form) }} +{% endblock %} diff --git a/templates/user/index.html.twig b/templates/user/index.html.twig deleted file mode 100644 index 1f43753..0000000 --- a/templates/user/index.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Hello UserController!{% endblock %} - -{% block body %} - - -
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at E:/BTS/PhpStorm/HegreEtConfort/src/Controller/UserController.php
  • -
  • Your template at E:/BTS/PhpStorm/HegreEtConfort/templates/user/index.html.twig
  • -
-
-{% endblock %} diff --git a/templates/user/list.html.twig b/templates/user/list.html.twig new file mode 100644 index 0000000..7477b1e --- /dev/null +++ b/templates/user/list.html.twig @@ -0,0 +1,14 @@ +{% extends 'base.html.twig' %} + +{% block title %}Hello UserController!{% endblock %} + +{% block body %} + {% for user in users %} + {{ user.FirstName }} + {{ user.LastName }} + {{ user.BirthDate|date("Y-m-d") }} + {{ user.Mail }} + {{ user.Phone }} + {{ user.Type }} + {% endfor %} +{% endblock %} \ No newline at end of file From ee236ff74aaac1882a825817d5ce8f692d3bdd0f Mon Sep 17 00:00:00 2001 From: ragueneaul Date: Thu, 21 Nov 2024 16:52:37 +0100 Subject: [PATCH 2/2] templates v2 --- .idea/dataSources.xml | 7 +++ .idea/workspace.xml | 43 +++++++---------- migrations/Version20241121154657.php | 70 ++++++++++++++++++++++++++++ templates/user/list.html.twig | 2 +- 4 files changed, 94 insertions(+), 28 deletions(-) create mode 100644 migrations/Version20241121154657.php diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 08c0eb6..9b096cc 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -8,5 +8,12 @@ jdbc:postgresql://172.20.96.1:5432/chauffageproj $ProjectFileDir$ + + postgresql + true + org.postgresql.Driver + jdbc:postgresql://172.20.96.1:5432/chauffageproj + $ProjectFileDir$ +
\ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 966b661..c33b8b6 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,18 +5,7 @@
- - - - - - - - - - - - { + "keyToString": { + "RunOnceActivity.ShowReadmeOnStart": "true", + "RunOnceActivity.git.unshallow": "true", + "git-widget-placeholder": "develop", + "last_opened_file_path": "/home/ragueneaul@stsio.lan/Documents/DecoMaison_Lucas_Ragueneau", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "vue.rearranger.settings.migration": "true" }, - "keyToStringList": { - "DatabaseDriversLRU": [ - "postgresql" + "keyToStringList": { + "DatabaseDriversLRU": [ + "postgresql" ] } -}]]> +} diff --git a/migrations/Version20241121154657.php b/migrations/Version20241121154657.php new file mode 100644 index 0000000..55567a9 --- /dev/null +++ b/migrations/Version20241121154657.php @@ -0,0 +1,70 @@ +addSql('CREATE SEQUENCE fault_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE intervention_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 SEQUENCE stock_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE "user_id_seq" INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE vehicle_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE fault (id INT NOT NULL, wording VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE intervention (id INT NOT NULL, wording VARCHAR(255) NOT NULL, timestamp TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, description VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL, status VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE skill (id INT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE stock (id INT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, quantity VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE "user" (id INT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, birth_date DATE NOT NULL, email VARCHAR(255) NOT NULL, phone VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE vehicle (id INT NOT NULL, license_plate VARCHAR(255) NOT NULL, brand VARCHAR(255) 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();'); + } + + 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 fault_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE intervention_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE skill_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE stock_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE "user_id_seq" CASCADE'); + $this->addSql('DROP SEQUENCE vehicle_id_seq CASCADE'); + $this->addSql('DROP TABLE fault'); + $this->addSql('DROP TABLE intervention'); + $this->addSql('DROP TABLE skill'); + $this->addSql('DROP TABLE stock'); + $this->addSql('DROP TABLE "user"'); + $this->addSql('DROP TABLE vehicle'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/templates/user/list.html.twig b/templates/user/list.html.twig index 7477b1e..e48b70b 100644 --- a/templates/user/list.html.twig +++ b/templates/user/list.html.twig @@ -7,7 +7,7 @@ {{ user.FirstName }} {{ user.LastName }} {{ user.BirthDate|date("Y-m-d") }} - {{ user.Mail }} + {{ user.Email }} {{ user.Phone }} {{ user.Type }} {% endfor %}