Skip to content

Commit

Permalink
Correctif: calcul du numéro de dossier
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrelemee committed Jan 3, 2025
1 parent df12fdc commit df93642
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
3 changes: 1 addition & 2 deletions assets/react/components/User.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ const User = function () {

<div className="fr-col-lg-6 fr-col-12">
<Input
label="Complément d'adresse"
hintText={"Facultatif"}
label="Complément d'adresse (facultatif)"
nativeInputProps={{
value: dossier.requerant.adresse.ligne2 || "",
placeholder: "Étage, escalier",
Expand Down
11 changes: 5 additions & 6 deletions src/Event/PrejudiceListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Event;

use App\Entity\BasePrejudice;
use App\Entity\BrisPorte;
use Doctrine\Bundle\DoctrineBundle\Attribute\AsDoctrineListener;
use Doctrine\ORM\Event\PreUpdateEventArgs;
Expand All @@ -25,11 +24,11 @@ public function preUpdate(PreUpdateEventArgs $args): void
$entityManager = $args->getObjectManager();
$conn = $entityManager->getConnection();

$sql = "
SELECT count(*)+1 cpt
FROM public.bris_porte p
WHERE date_declaration = '".$entity->getDateDeclaration()->format('Y-m-d')."'";
$req = $conn->executeQuery($sql);
$req = $conn->executeQuery(<<<SQL
SELECT count(p.id) + 1 cpt
FROM bris_porte p
INNER JOIN public.dossier_etats ed ON ed.id = p.etat_actuel_id AND ed.etat <> 'DOSSIER_INITIE'
SQL);

$cpt = $req->fetchOne() ?? 1;

Expand Down
8 changes: 3 additions & 5 deletions templates/requerant/default/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@
{{ parent() }}
{% set flash = app.flashes('dossier')|first %}
{% if flash %}
<dialog aria-labelledby="fr-modal-flash-success" role="dialog" id="fr-modal-flash-success"
class="fr-modal fr-modal--opened">
<dialog aria-labelledby="fr-modal-flash-dossier--title" role="dialog" id="fr-modal-flash-dossier" class="fr-modal fr-modal--opened">
<div class="fr-container fr-container--fluid fr-container-md">
<div class="fr-grid-row fr-grid-row--center">
<div class="fr-col-12 fr-col-md-8 fr-col-lg-6">
<div class="fr-modal__body">
<div class="fr-modal__header">
<button class="fr-btn--close fr-btn" title="Fermer la fenêtre modale" aria-controls="fr-modal-flash-success">Fermer
</button>
<button class="fr-btn--close fr-btn" title="Fermer la fenêtre modale" aria-controls="fr-modal-flash-dossier">Fermer</button>
</div>
<div class="fr-modal__content">
<div class="fr-alert fr-alert--success">
<h3 class="fr-alert__title">
<h3 class="fr-alert__title" id="fr-modal-flash-dossier--title">
Votre dossier {{ flash.dossier.reference }} a bien été déposé
</h3>
<p>
Expand Down

0 comments on commit df93642

Please sign in to comment.