controller nickel et ke reste aussi

This commit is contained in:
ragueneaul 2024-12-20 10:07:22 +01:00
parent af50b4bd60
commit b3e3f41003
60 changed files with 947 additions and 341 deletions

View File

@ -9,42 +9,73 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class FaultController extends AbstractController
use Symfony\Component\Routing\Attribute\Route;
#[Route('/fault')]
final class FaultController extends AbstractController
{
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly FaultRepository $faultRepository
)
#[Route(name: 'app_fault_index', methods: ['GET'])]
public function index(FaultRepository $faultRepository): Response
{
return $this->render('fault/index.html.twig', [
'faults' => $faultRepository->findAll(),
]);
}
#[Route('/fault/add', name: 'fault_add')]
public function add(Request $request): Response
#[Route('/new', name: 'app_fault_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): 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();
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($fault);
$entityManager->flush();
return $this->redirectToRoute("fault_list");
return $this->redirectToRoute('app_fault_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('fault/add.html.twig', [
return $this->render('fault/new.html.twig', [
'fault' => $fault,
'form' => $form,
]);
}
#[Route('/fault/list', name: 'fault_list')]
public function list(): Response
#[Route('/{id}', name: 'app_fault_show', methods: ['GET'])]
public function show(Fault $fault): Response
{
$faults = $this->faultRepository->findAll();
return $this->render('fault/list.html.twig', [
'faults' => $faults,
return $this->render('fault/show.html.twig', [
'fault' => $fault,
]);
}
}
#[Route('/{id}/edit', name: 'app_fault_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Fault $fault, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(FaultType::class, $fault);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_fault_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('fault/edit.html.twig', [
'fault' => $fault,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_fault_delete', methods: ['POST'])]
public function delete(Request $request, Fault $fault, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$fault->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($fault);
$entityManager->flush();
}
return $this->redirectToRoute('app_fault_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -11,41 +11,71 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class InterventionController extends AbstractController
#[Route('/intervention')]
final class InterventionController extends AbstractController
{
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly InterventionRepository $interventionRepository
)
#[Route(name: 'app_intervention_index', methods: ['GET'])]
public function index(InterventionRepository $interventionRepository): Response
{
return $this->render('intervention/index.html.twig', [
'interventions' => $interventionRepository->findAll(),
]);
}
#[Route('/intervention/add', name: 'intervention_add')]
public function add(Request $request): Response
#[Route('/new', name: 'app_intervention_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$intervention = new Intervention();
$form = $this->createForm(InterventionType::class, $intervention);
$form->handleRequest($request);
if($form->isSubmitted() && $form->isValid())
{
$this->entityManager->persist($intervention);
$this->entityManager->flush();
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($intervention);
$entityManager->flush();
return $this->redirectToRoute("intervention_list");
return $this->redirectToRoute('app_intervention_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('intervention/add.html.twig', [
return $this->render('intervention/new.html.twig', [
'intervention' => $intervention,
'form' => $form,
]);
}
#[Route('/intervention/list', name: 'intervention_list')]
public function list(): Response
#[Route('/{id}', name: 'app_intervention_show', methods: ['GET'])]
public function show(Intervention $intervention): Response
{
$interventions = $this->interventionRepository->findAll();
return $this->render('intervention/list.html.twig', [
'interventions' => $interventions,
return $this->render('intervention/show.html.twig', [
'intervention' => $intervention,
]);
}
}
#[Route('/{id}/edit', name: 'app_intervention_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Intervention $intervention, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(InterventionType::class, $intervention);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_intervention_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('intervention/edit.html.twig', [
'intervention' => $intervention,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_intervention_delete', methods: ['POST'])]
public function delete(Request $request, Intervention $intervention, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$intervention->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($intervention);
$entityManager->flush();
}
return $this->redirectToRoute('app_intervention_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -9,42 +9,73 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
class SkillController extends AbstractController
#[Route('/skill')]
final class SkillController extends AbstractController
{
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly SkillRepository $skillRepository
)
#[Route(name: 'app_skill_index', methods: ['GET'])]
public function index(SkillRepository $skillRepository): Response
{
return $this->render('skill/index.html.twig', [
'skills' => $skillRepository->findAll(),
]);
}
#[Route('/skill/add', name: 'skill_add')]
public function add(Request $request): Response
#[Route('/new', name: 'app_skill_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$skill = new Skill();
$form = $this->createForm(SkillType::class, $skill);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->entityManager->persist($skill);
$this->entityManager->flush();
$entityManager->persist($skill);
$entityManager->flush();
return $this->redirectToRoute('app_skill_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('skill/add.html.twig', [
return $this->render('skill/new.html.twig', [
'skill' => $skill,
'form' => $form,
]);
}
#[Route('/skill/list', name: 'skill_list')]
public function list(): Response
#[Route('/{id}', name: 'app_skill_show', methods: ['GET'])]
public function show(Skill $skill): Response
{
$skills = $this->skillRepository->findAll();
return $this->render('skill/list.html.twig', [
'skills' => $skills,
return $this->render('skill/show.html.twig', [
'skill' => $skill,
]);
}
}
#[Route('/{id}/edit', name: 'app_skill_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Skill $skill, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(SkillType::class, $skill);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_skill_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('skill/edit.html.twig', [
'skill' => $skill,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_skill_delete', methods: ['POST'])]
public function delete(Request $request, Skill $skill, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$skill->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($skill);
$entityManager->flush();
}
return $this->redirectToRoute('app_skill_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -9,62 +9,73 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
class StockController extends AbstractController
#[Route('/stock')]
final class StockController extends AbstractController
{
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly StockRepository $stockRepository
)
#[Route(name: 'app_stock_index', methods: ['GET'])]
public function index(StockRepository $stockRepository): Response
{
return $this->render('stock/index.html.twig', [
'stocks' => $stockRepository->findAll(),
]);
}
#[Route('/stock/add', name: 'stock_add')]
public function add(Request $request): Response
#[Route('/new', name: 'app_stock_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): 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();
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($stock);
$entityManager->flush();
return $this->redirectToRoute('app_stock_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('stock/add.html.twig', [
return $this->render('stock/new.html.twig', [
'stock' => $stock,
'form' => $form,
]);
}
#[Route('/stock/list', name: 'stock_list')]
public function list(): Response
#[Route('/{id}', name: 'app_stock_show', methods: ['GET'])]
public function show(Stock $stock): Response
{
$stocks = $this->stockRepository->findAll();
return $this->render('stock/list.html.twig', [
'stocks' => $stocks,
return $this->render('stock/show.html.twig', [
'stock' => $stock,
]);
}
#[Route('/stock/update/{id}', name: 'stock_update')]
public function update(int $id, Request $request): Response
#[Route('/{id}/edit', name: 'app_stock_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Stock $stock, EntityManagerInterface $entityManager): 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();
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_stock_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('stock/add.html.twig', [
return $this->render('stock/edit.html.twig', [
'stock' => $stock,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_stock_delete', methods: ['POST'])]
public function delete(Request $request, Stock $stock, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$stock->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($stock);
$entityManager->flush();
}
}
return $this->redirectToRoute('app_stock_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -9,70 +9,73 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
class UserController extends AbstractController
#[Route('/user')]
final class UserController extends AbstractController
{
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly UserRepository $userRepository
)
#[Route(name: 'app_user_index', methods: ['GET'])]
public function index(UserRepository $userRepository): Response
{
return $this->render('user/index.html.twig', [
'users' => $userRepository->findAll(),
]);
}
#[Route('/user/add', name: 'user_add')]
public function add(Request $request): Response
#[Route('/new', name: 'app_user_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): 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();
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($user);
$entityManager->flush();
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('user/add.html.twig', [
return $this->render('user/new.html.twig', [
'user' => $user,
'form' => $form,
]);
}
#[Route('/user/list', name: 'user_list')]
public function list(): Response
#[Route('/{id}', name: 'app_user_show', methods: ['GET'])]
public function show(User $user): Response
{
$users = $this->userRepository->findAll();
return $this->render('user/list.html.twig', [
'users' => $users,
return $this->render('user/show.html.twig', [
'user' => $user,
]);
}
#[Route('/user/update/{id}', name: 'user_update')]
public function update(int $id, Request $request): Response
#[Route('/{id}/edit', name: 'app_user_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, User $user, EntityManagerInterface $entityManager): 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();
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('user/add.html.twig', [
return $this->render('user/edit.html.twig', [
'user' => $user,
'form' => $form,
]);
}
#[Route('/user/delete/{id}', name: '_delete')]
public function delete(int $id): Response
#[Route('/{id}', name: 'app_user_delete', methods: ['POST'])]
public function delete(Request $request, User $user, EntityManagerInterface $entityManager): Response
{
$user = $this->userRepository->find($id);
$this->entityManager->remove($user);
$this->entityManager->flush();
if ($this->isCsrfTokenValid('delete'.$user->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($user);
$entityManager->flush();
}
return $this->redirectToRoute('app_user_list');
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -11,41 +11,71 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class VehicleController extends AbstractController
#[Route('/vehicle')]
final class VehicleController extends AbstractController
{
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly VehicleRepository $vehicleRepository
)
#[Route(name: 'app_vehicle_index', methods: ['GET'])]
public function index(VehicleRepository $vehicleRepository): Response
{
return $this->render('vehicle/index.html.twig', [
'vehicles' => $vehicleRepository->findAll(),
]);
}
#[\Symfony\Component\Routing\Annotation\Route('/vehicle/add', name: 'vehicle_add')]
public function add(Request $request): Response
#[Route('/new', name: 'app_vehicle_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$vehicle = new Vehicle();
$form = $this->createForm(VehicleType::class, $vehicle);
$form->handleRequest($request);
if($form->isSubmitted() && $form->isValid())
{
$this->entityManager->persist($vehicle);
$this->entityManager->flush();
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($vehicle);
$entityManager->flush();
return $this->redirectToRoute("vehicle_list");
return $this->redirectToRoute('app_vehicle_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('vehicle/add.html.twig', [
return $this->render('vehicle/new.html.twig', [
'vehicle' => $vehicle,
'form' => $form,
]);
}
#[Route('/vehicle/list', name: 'vehicle_list')]
public function list(): Response
#[Route('/{id}', name: 'app_vehicle_show', methods: ['GET'])]
public function show(Vehicle $vehicle): Response
{
$vehicles = $this->vehicleRepository->findAll();
return $this->render('vehicle/list.html.twig', [
'vehicles' => $vehicles,
return $this->render('vehicle/show.html.twig', [
'vehicle' => $vehicle,
]);
}
}
#[Route('/{id}/edit', name: 'app_vehicle_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Vehicle $vehicle, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(VehicleType::class, $vehicle);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_vehicle_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('vehicle/edit.html.twig', [
'vehicle' => $vehicle,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_vehicle_delete', methods: ['POST'])]
public function delete(Request $request, Vehicle $vehicle, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$vehicle->getId(), $request->getPayload()->getString('_token'))) {
$entityManager->remove($vehicle);
$entityManager->flush();
}
return $this->redirectToRoute('app_vehicle_index', [], Response::HTTP_SEE_OTHER);
}
}

View File

@ -2,9 +2,8 @@
namespace App\Form;
use App\Entity\Fault;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
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;
@ -15,14 +14,13 @@ class FaultType extends AbstractType
{
$builder
->add('Wording', TextType::class)
->add('save', SubmitType::class)
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
// Configure your form options here
'data_class' => Fault::class,
]);
}
}

View File

@ -2,12 +2,9 @@
namespace App\Form;
use DateTime;
use App\Entity\Intervention;
use Doctrine\DBAL\Types\TextType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@ -17,18 +14,19 @@ class InterventionType extends AbstractType
{
$builder
->add('Wording', TextType::class)
->add('Timestamp', DateType::class)
->add('description', TextAreaType::class)
->add('address', TextType::class)
->add('Timestamp', \DateTime::class, [
'widget' => 'single_text',
])
->add('Description', TextType::class)
->add('Address', TextType::class)
->add('Status', TextType::class)
->add('save', SubmitType::class)
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
// Configure your form options here
'data_class' => Intervention::class,
]);
}
}

View File

@ -2,10 +2,9 @@
namespace App\Form;
use App\Entity\Skill;
use Doctrine\DBAL\Types\TextType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@ -14,17 +13,15 @@ class SkillType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('Wording', TextType::class)
->add('description', TextAreaType::class)
->add('Save', SubmitType::class)
->add('Wording',TextType::class)
->add('Description', TextType::class)
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
// Configure your form options here
'data_class' => Skill::class,
]);
}
}

View File

@ -3,13 +3,9 @@
namespace App\Form;
use App\Entity\Stock;
use Doctrine\DBAL\Types\IntegerType;
use Doctrine\DBAL\Types\TextType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@ -19,9 +15,8 @@ class StockType extends AbstractType
{
$builder
->add('Wording', TextType::class)
->add('description', TextAreaType::class)
->add('Description', TextType::class)
->add('Quantity', IntegerType::class)
->add('save', SubmitType::class)
;
}

View File

@ -3,11 +3,8 @@
namespace App\Form;
use App\Entity\User;
use Doctrine\DBAL\Types\TextType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
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;
@ -16,13 +13,15 @@ class UserType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('email', TextType::class)
->add('FirstName', TextType::class)
->add('LastName', TextType::class)
->add('BirthDate', DateType::class)
->add('Email', EmailType::class)
->add('BirthDate', \DateTime::class, [
'widget' => 'single_text',
])
->add('Phone', TextType::class)
->add('Type', TextType::class)
->add('Save', SubmitType::class)
->add('roles', TextType::class)
->add('password', TextType::class)
;
}

View File

@ -2,10 +2,9 @@
namespace App\Form;
use App\Entity\Vehicle;
use Doctrine\DBAL\Types\TextType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
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;
@ -15,16 +14,14 @@ class VehicleType extends AbstractType
{
$builder
->add('LicensePlate', TextType::class)
->add('Brand', IntegerType::class)
->add('Save', SubmitType::class)
->add('Brand', TextType::class)
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
// Configure your form options here
'data_class' => Vehicle::class,
]);
}
}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_fault_delete', {'id': fault.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ fault.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View File

@ -1,10 +0,0 @@
{% extends 'base.html.twig' %}
{% block title %}Ajouter une panne{% endblock %}
{% block body %}
<h1>Ajouter une panne</h1>
{{ form(form) }}
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Fault{% endblock %}
{% block body %}
<h1>Edit Fault</h1>
{{ include('fault/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_fault_index') }}">back to list</a>
{{ include('fault/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,35 @@
{% extends 'base.html.twig' %}
{% block title %}Fault index{% endblock %}
{% block body %}
<h1>Fault index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Wording</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for fault in faults %}
<tr>
<td>{{ fault.id }}</td>
<td>{{ fault.Wording }}</td>
<td>
<a href="{{ path('app_fault_show', {'id': fault.id}) }}">show</a>
<a href="{{ path('app_fault_edit', {'id': fault.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="3">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_fault_new') }}">Create new</a>
{% endblock %}

View File

@ -1,9 +0,0 @@
{% extends 'base.html.twig' %}
{% block title %}Hello UserController!{% endblock %}
{% block body %}
{% for fault in faults %}
{{ fault.Wording }}
{% endfor %}
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New Fault{% endblock %}
{% block body %}
<h1>Create new Fault</h1>
{{ include('fault/_form.html.twig') }}
<a href="{{ path('app_fault_index') }}">back to list</a>
{% endblock %}

View File

@ -0,0 +1,26 @@
{% extends 'base.html.twig' %}
{% block title %}Fault{% endblock %}
{% block body %}
<h1>Fault</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ fault.id }}</td>
</tr>
<tr>
<th>Wording</th>
<td>{{ fault.Wording }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_fault_index') }}">back to list</a>
<a href="{{ path('app_fault_edit', {'id': fault.id}) }}">edit</a>
{{ include('fault/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_intervention_delete', {'id': intervention.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ intervention.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View File

@ -1,39 +0,0 @@
<!DOCTYPE html>
<html lang="fr, en">
<head>
<meta charset="UTF-8">
<title>Créer Une Intervention</title>
<link href="{{ asset('styles/css/intervention.css') }}" rel='stylesheet'>
<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">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% block stylesheets %}
{% endblock %}
</head>
<body>
<div class="background"></div>
<img class="logoCalendar" src="{{ asset('styles/image/calendar.png') }}" alt="Logo Calendrier">
<h1 class="titre">Créer Une Intervention</h1>
<div class="background-intervention">
<input required id="nom" placeholder="Nom de l'intervention">
<input required id="echecs" placeholder="Liste des échecs">
<input required id="employesCompetences" placeholder="Liste des employés et de leurs compétences">
<input id="piece" placeholder="Pièce affecter">
<p id="vehicule">Véhicule nécessaire</p>
<input type="checkbox" name="vehicule1" id="vehicule1">
<label for=”vehicule1” id="oui"> Oui </label>
<input type="checkbox" name="vehicule2" id="vehicule2">
<label for=”vehicule2” id="non"> Non </label>
<p id="date">Jour de l'intervention</p>
<input type="date" id="calendar">
<div class="from"> {{ form(form) }} </div>
</div>
</body>
</html>

View File

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Intervention{% endblock %}
{% block body %}
<h1>Edit Intervention</h1>
{{ include('intervention/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_intervention_index') }}">back to list</a>
{{ include('intervention/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,43 @@
{% extends 'base.html.twig' %}
{% block title %}Intervention index{% endblock %}
{% block body %}
<h1>Intervention index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Wording</th>
<th>Timestamp</th>
<th>Description</th>
<th>Address</th>
<th>Status</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for intervention in interventions %}
<tr>
<td>{{ intervention.id }}</td>
<td>{{ intervention.Wording }}</td>
<td>{{ intervention.Timestamp ? intervention.Timestamp|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ intervention.Description }}</td>
<td>{{ intervention.Address }}</td>
<td>{{ intervention.Status }}</td>
<td>
<a href="{{ path('app_intervention_show', {'id': intervention.id}) }}">show</a>
<a href="{{ path('app_intervention_edit', {'id': intervention.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="7">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_intervention_new') }}">Create new</a>
{% endblock %}

View File

@ -1,13 +0,0 @@
{% extends 'base.html.twig' %}
{% block title %}Hello InterventionController!{% endblock %}
{% block body %}
{% for intervention in interventions %}
{{ intervention.Wording }}
{{ intervention.Timestamp|date('Y-m-d H:i:s') }} {{ intervention.Description }}
{{ intervention.Address }}
{{ intervention.Status }}
{% endfor %}
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New Intervention{% endblock %}
{% block body %}
<h1>Create new Intervention</h1>
{{ include('intervention/_form.html.twig') }}
<a href="{{ path('app_intervention_index') }}">back to list</a>
{% endblock %}

View File

@ -0,0 +1,42 @@
{% extends 'base.html.twig' %}
{% block title %}Intervention{% endblock %}
{% block body %}
<h1>Intervention</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ intervention.id }}</td>
</tr>
<tr>
<th>Wording</th>
<td>{{ intervention.Wording }}</td>
</tr>
<tr>
<th>Timestamp</th>
<td>{{ intervention.Timestamp ? intervention.Timestamp|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>Description</th>
<td>{{ intervention.Description }}</td>
</tr>
<tr>
<th>Address</th>
<td>{{ intervention.Address }}</td>
</tr>
<tr>
<th>Status</th>
<td>{{ intervention.Status }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_intervention_index') }}">back to list</a>
<a href="{{ path('app_intervention_edit', {'id': intervention.id}) }}">edit</a>
{{ include('intervention/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_skill_delete', {'id': skill.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ skill.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View File

@ -1,10 +0,0 @@
{# templates/user/add.html.twig #}
{% extends 'base.html.twig' %}
{% block title %}Ajouter une intervention {% endblock %}
{% block body %}
<h1>Ajouter une compétence</h1>
{{ form(form) }}
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Skill{% endblock %}
{% block body %}
<h1>Edit Skill</h1>
{{ include('skill/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_skill_index') }}">back to list</a>
{{ include('skill/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,37 @@
{% extends 'base.html.twig' %}
{% block title %}Skill index{% endblock %}
{% block body %}
<h1>Skill index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Wording</th>
<th>Description</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for skill in skills %}
<tr>
<td>{{ skill.id }}</td>
<td>{{ skill.Wording }}</td>
<td>{{ skill.Description }}</td>
<td>
<a href="{{ path('app_skill_show', {'id': skill.id}) }}">show</a>
<a href="{{ path('app_skill_edit', {'id': skill.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_skill_new') }}">Create new</a>
{% endblock %}

View File

@ -1,10 +0,0 @@
{% extends 'base.html.twig' %}
{% block title %}Hello InterventionController!{% endblock %}
{% block body %}
{% for skill in skills %}
{{ skill.Wording }}
{{ skill.Description }}
{% endfor %}
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New Skill{% endblock %}
{% block body %}
<h1>Create new Skill</h1>
{{ include('skill/_form.html.twig') }}
<a href="{{ path('app_skill_index') }}">back to list</a>
{% endblock %}

View File

@ -0,0 +1,30 @@
{% extends 'base.html.twig' %}
{% block title %}Skill{% endblock %}
{% block body %}
<h1>Skill</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ skill.id }}</td>
</tr>
<tr>
<th>Wording</th>
<td>{{ skill.Wording }}</td>
</tr>
<tr>
<th>Description</th>
<td>{{ skill.Description }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_skill_index') }}">back to list</a>
<a href="{{ path('app_skill_edit', {'id': skill.id}) }}">edit</a>
{{ include('skill/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_stock_delete', {'id': stock.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ stock.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View File

@ -1,10 +0,0 @@
{% extends 'base.html.twig' %}
{% block title %}Ajouter un utilisateur{% endblock %}
{% block body %}
<h1>Ajouter du stock</h1>
{{ form(form) }}
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Stock{% endblock %}
{% block body %}
<h1>Edit Stock</h1>
{{ include('stock/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_stock_index') }}">back to list</a>
{{ include('stock/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,39 @@
{% extends 'base.html.twig' %}
{% block title %}Stock index{% endblock %}
{% block body %}
<h1>Stock index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Wording</th>
<th>Description</th>
<th>Quantity</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for stock in stocks %}
<tr>
<td>{{ stock.id }}</td>
<td>{{ stock.Wording }}</td>
<td>{{ stock.Description }}</td>
<td>{{ stock.Quantity }}</td>
<td>
<a href="{{ path('app_stock_show', {'id': stock.id}) }}">show</a>
<a href="{{ path('app_stock_edit', {'id': stock.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="5">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_stock_new') }}">Create new</a>
{% endblock %}

View File

@ -1,11 +0,0 @@
{% extends 'base.html.twig' %}
{% block title %}Hello StockController!{% endblock %}
{% block body %}
{% for stock in stocks %}
{{ stock.Wording }}
{{ stock.Description }}
{{ stock.Quantity }}
{% endfor %}
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New Stock{% endblock %}
{% block body %}
<h1>Create new Stock</h1>
{{ include('stock/_form.html.twig') }}
<a href="{{ path('app_stock_index') }}">back to list</a>
{% endblock %}

View File

@ -0,0 +1,34 @@
{% extends 'base.html.twig' %}
{% block title %}Stock{% endblock %}
{% block body %}
<h1>Stock</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ stock.id }}</td>
</tr>
<tr>
<th>Wording</th>
<td>{{ stock.Wording }}</td>
</tr>
<tr>
<th>Description</th>
<td>{{ stock.Description }}</td>
</tr>
<tr>
<th>Quantity</th>
<td>{{ stock.Quantity }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_stock_index') }}">back to list</a>
<a href="{{ path('app_stock_edit', {'id': stock.id}) }}">edit</a>
{{ include('stock/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_user_delete', {'id': user.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ user.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View File

@ -1,10 +0,0 @@
{# templates/user/add.html.twig #}
{% extends 'base.html.twig' %}
{% block title %}Ajouter un utilisateur{% endblock %}
{% block body %}
<h1>Ajouter un utilisateur</h1>
{{ form(form) }}
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit User{% endblock %}
{% block body %}
<h1>Edit User</h1>
{{ include('user/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_user_index') }}">back to list</a>
{{ include('user/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,47 @@
{% extends 'base.html.twig' %}
{% block title %}User index{% endblock %}
{% block body %}
<h1>User index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Email</th>
<th>FirstName</th>
<th>LastName</th>
<th>BirthDate</th>
<th>Phone</th>
<th>Roles</th>
<th>Password</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user.id }}</td>
<td>{{ user.email }}</td>
<td>{{ user.FirstName }}</td>
<td>{{ user.LastName }}</td>
<td>{{ user.BirthDate ? user.BirthDate|date('Y-m-d') : '' }}</td>
<td>{{ user.Phone }}</td>
<td>{{ user.roles ? user.roles|json_encode : '' }}</td>
<td>{{ user.password }}</td>
<td>
<a href="{{ path('app_user_show', {'id': user.id}) }}">show</a>
<a href="{{ path('app_user_edit', {'id': user.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="9">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_user_new') }}">Create new</a>
{% endblock %}

View File

@ -1,14 +0,0 @@
{% 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.Email }}
{{ user.Phone }}
{{ user.Type }}
{% endfor %}
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New User{% endblock %}
{% block body %}
<h1>Create new User</h1>
{{ include('user/_form.html.twig') }}
<a href="{{ path('app_user_index') }}">back to list</a>
{% endblock %}

View File

@ -0,0 +1,50 @@
{% extends 'base.html.twig' %}
{% block title %}User{% endblock %}
{% block body %}
<h1>User</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ user.id }}</td>
</tr>
<tr>
<th>Email</th>
<td>{{ user.email }}</td>
</tr>
<tr>
<th>FirstName</th>
<td>{{ user.FirstName }}</td>
</tr>
<tr>
<th>LastName</th>
<td>{{ user.LastName }}</td>
</tr>
<tr>
<th>BirthDate</th>
<td>{{ user.BirthDate ? user.BirthDate|date('Y-m-d') : '' }}</td>
</tr>
<tr>
<th>Phone</th>
<td>{{ user.Phone }}</td>
</tr>
<tr>
<th>Roles</th>
<td>{{ user.roles ? user.roles|json_encode : '' }}</td>
</tr>
<tr>
<th>Password</th>
<td>{{ user.password }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_user_index') }}">back to list</a>
<a href="{{ path('app_user_edit', {'id': user.id}) }}">edit</a>
{{ include('user/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_vehicle_delete', {'id': vehicle.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ vehicle.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View File

@ -1,10 +0,0 @@
{# templates/user/add.html.twig #}
{% extends 'base.html.twig' %}
{% block title %}Ajouter un utilisateur{% endblock %}
{% block body %}
<h1>Ajouter un utilisateur</h1>
{{ form(form) }}
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Vehicle{% endblock %}
{% block body %}
<h1>Edit Vehicle</h1>
{{ include('vehicle/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_vehicle_index') }}">back to list</a>
{{ include('vehicle/_delete_form.html.twig') }}
{% endblock %}

View File

@ -0,0 +1,37 @@
{% extends 'base.html.twig' %}
{% block title %}Vehicle index{% endblock %}
{% block body %}
<h1>Vehicle index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>LicensePlate</th>
<th>Brand</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for vehicle in vehicles %}
<tr>
<td>{{ vehicle.id }}</td>
<td>{{ vehicle.LicensePlate }}</td>
<td>{{ vehicle.Brand }}</td>
<td>
<a href="{{ path('app_vehicle_show', {'id': vehicle.id}) }}">show</a>
<a href="{{ path('app_vehicle_edit', {'id': vehicle.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_vehicle_new') }}">Create new</a>
{% endblock %}

View File

@ -1,10 +0,0 @@
{% extends 'base.html.twig' %}
{% block title %}Hello UserController!{% endblock %}
{% block body %}
{% for vehicle in vehicles %}
{{ vehicle.LicensePlate }}
{{ vehicle.Brand }}
{% endfor %}
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New Vehicle{% endblock %}
{% block body %}
<h1>Create new Vehicle</h1>
{{ include('vehicle/_form.html.twig') }}
<a href="{{ path('app_vehicle_index') }}">back to list</a>
{% endblock %}

View File

@ -0,0 +1,30 @@
{% extends 'base.html.twig' %}
{% block title %}Vehicle{% endblock %}
{% block body %}
<h1>Vehicle</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ vehicle.id }}</td>
</tr>
<tr>
<th>LicensePlate</th>
<td>{{ vehicle.LicensePlate }}</td>
</tr>
<tr>
<th>Brand</th>
<td>{{ vehicle.Brand }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_vehicle_index') }}">back to list</a>
<a href="{{ path('app_vehicle_edit', {'id': vehicle.id}) }}">edit</a>
{{ include('vehicle/_delete_form.html.twig') }}
{% endblock %}