Skip to content

Commit

Permalink
convert variables to bool #3267
Browse files Browse the repository at this point in the history
  • Loading branch information
emilschn committed Jan 16, 2025
1 parent b977485 commit 7d7c2c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Controller/Back/SignalementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ public function viewSignalement(
);

$canAnswerAssignment = $canCancelRefusedAssignment = false;
$isAssignmentRefused = $isAssignmentAccepted = $isClosedForMe = null;
$isAssignmentRefused = $isAssignmentAccepted = $isClosedForMe = false;
$partner = $user->getPartnerInTerritoryOrFirstOne($signalement->getTerritory());
if ($affectation = $signalement->getAffectations()->filter(function (Affectation $affectation) use ($partner) {
return $affectation->getPartner() === $partner;
})->first()) {
switch ($affectation->getStatut()) {
case Affectation::STATUS_ACCEPTED:
$isAssignmentAccepted = $affectation;
$isAssignmentAccepted = true;
break;
case Affectation::STATUS_REFUSED:
$isAssignmentRefused = $affectation;
$isAssignmentRefused = true;
$canCancelRefusedAssignment = $this->isGranted(AssignmentVoter::ANSWER, $affectation);
break;
case Affectation::STATUS_CLOSED:
Expand Down
2 changes: 1 addition & 1 deletion templates/back/signalement/view/header.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
</div>

{% elseif canCancelRefusedAssignment %}
<form method="POST" action="{{ path('back_signalement_affectation_response',{signalement:signalement.id,user:app.user.id,affectation:isAssignmentRefused.id}) }}">
<form method="POST" action="{{ path('back_signalement_affectation_response',{signalement:signalement.id,user:app.user.id,affectation:affectation.id}) }}">
<button class="fr-btn fr-btn--sm fr-btn--icon-left fr-icon-checkbox-circle-fill reaffect fr-mb-3v"
name="signalement-affectation-response[accept]" value="1"
>
Expand Down

0 comments on commit 7d7c2c4

Please sign in to comment.