Create isSigned method in EntityWorkflowStepSignature.php

Refactorization and ease of use in template and workflow controller
This commit is contained in:
Julie Lenaerts 2024-08-07 14:18:16 +02:00 committed by Julien Fastré
parent 3e6d764b9b
commit ee6edba206
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 6 additions and 1 deletions

View File

@ -135,4 +135,9 @@ class EntityWorkflowStepSignature implements TrackCreationInterface, TrackUpdate
return $this;
}
public function isSigned(): bool
{
return EntityWorkflowSignatureStateEnum::SIGNED == $this->getState();
}
}

View File

@ -6,7 +6,7 @@
<div class="col-sm-12 col-md-8"><span>{{ s.signer|chill_entity_render_box }}</span></div>
<div class="col-sm-12 col-md-4">
<ul class="record_actions">
{% if s.state.value == 'signed' %}
{% if s.isSigned %}
<p>{{ 'workflow.signature_zone.has_signed_statement'|trans( { '%datetime%' : s.stateDate|date('j M Y à H:i:s') } ) }}</p>
{% else %}
<li>