mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Add signer type differentiation for workflows
Added a method to determine if the signer is a 'person' or 'user'. Updated the signature template to handle both types accordingly, ensuring the correct entity type is displayed in workflow signatures.
This commit is contained in:
parent
669b967899
commit
1ddd283f26
@ -140,4 +140,16 @@ class EntityWorkflowStepSignature implements TrackCreationInterface, TrackUpdate
|
||||
{
|
||||
return EntityWorkflowSignatureStateEnum::SIGNED == $this->getState();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 'person'|'user'
|
||||
*/
|
||||
public function getSignerKind(): string
|
||||
{
|
||||
if ($this->personSigner instanceof Person) {
|
||||
return 'person';
|
||||
}
|
||||
|
||||
return 'user';
|
||||
}
|
||||
}
|
||||
|
@ -4,12 +4,20 @@
|
||||
{% for s in signatures %}
|
||||
<div class="row row-hover align-items-center">
|
||||
<div class="col-sm-12 col-md-8">
|
||||
{% if s.signerKind == 'person' %}
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'person', id: s.signer.id },
|
||||
buttonText: s.signer|chill_entity_render_string,
|
||||
isDead: s.signer.deathDate is not null
|
||||
} %}
|
||||
{% else %}
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'user', id: s.signer.id },
|
||||
buttonText: s.signer|chill_entity_render_string,
|
||||
} %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-4">
|
||||
{% if s.isSigned %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user