Skip to content

Commit

Permalink
Merge pull request #3361 from MTES-MCT/feature/3358-limit-notificatio…
Browse files Browse the repository at this point in the history
…ns-on-missing-doc

[BO - Signalement] Suivi auto Document manquant
  • Loading branch information
numew authored Dec 5, 2024
2 parents b0a0a66 + 6a82bfc commit 89b5e7f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Controller/Back/AffectationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public function affectationResponseSignalement(
'type' => Suivi::TYPE_AUTO,
],
isPublic: true,
context: Suivi::CONTEXT_NOTIFY_USAGER_ONLY,
flush: true
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Suivi.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Suivi implements EntityHistoryInterface
public const TYPE_PARTNER = 3;
public const TYPE_TECHNICAL = 4;
public const TYPE_USAGER_POST_CLOTURE = 5;

public const string CONTEXT_NOTIFY_USAGER_ONLY = 'notifyUsagerOnly';
public const CONTEXT_INTERVENTION = 'intervention';
public const CONTEXT_SCHS = 'schs';

Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/ActivityListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function onFlush(OnFlushEventArgs $args): void
continue;
}

$notifyAdminsAndPartners = $entity->getDescription() != $this->parameterBag->get('suivi_message')['first_accepted_affectation'];
$notifyAdminsAndPartners = Suivi::CONTEXT_NOTIFY_USAGER_ONLY !== $entity->getContext();
if ($notifyAdminsAndPartners) {
$this->tos->clear();
$this->notifyAdmins($entity, Notification::TYPE_SUIVI, $entity->getSignalement()->getTerritory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ private function createSuivi(Signalement $signalement, string $documents, string
'description' => $this->description,
],
isPublic: true,
flush: true
context: Suivi::CONTEXT_NOTIFY_USAGER_ONLY,
flush: true,
);
}
}

0 comments on commit 89b5e7f

Please sign in to comment.