mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
Add label to workflow listing and history to indicate whether it's on hold
This commit is contained in:
parent
42471269db
commit
15eaf648df
@ -480,4 +480,9 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
|
|
||||||
return $this->steps->get($this->steps->count() - 2);
|
return $this->steps->get($this->steps->count() - 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isOnHoldAtCurrentStep(): bool
|
||||||
|
{
|
||||||
|
return $this->getCurrentStep()->getHoldsOnStep()->count() > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,12 +98,16 @@ class EntityWorkflowStep
|
|||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
|
||||||
private ?string $transitionByEmail = null;
|
private ?string $transitionByEmail = null;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(mappedBy: 'step', targetEntity: EntityWorkflowStepHold::class)]
|
||||||
|
private Collection $holdsOnStep;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->ccUser = new ArrayCollection();
|
$this->ccUser = new ArrayCollection();
|
||||||
$this->destUser = new ArrayCollection();
|
$this->destUser = new ArrayCollection();
|
||||||
$this->destUserByAccessKey = new ArrayCollection();
|
$this->destUserByAccessKey = new ArrayCollection();
|
||||||
$this->signatures = new ArrayCollection();
|
$this->signatures = new ArrayCollection();
|
||||||
|
$this->holdsOnStep = new ArrayCollection();
|
||||||
$this->accessKey = bin2hex(openssl_random_pseudo_bytes(32));
|
$this->accessKey = bin2hex(openssl_random_pseudo_bytes(32));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,6 +417,11 @@ class EntityWorkflowStep
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getHoldsOnStep(): Collection
|
||||||
|
{
|
||||||
|
return $this->holdsOnStep;
|
||||||
|
}
|
||||||
|
|
||||||
#[Assert\Callback]
|
#[Assert\Callback]
|
||||||
public function validateOnCreation(ExecutionContextInterface $context, mixed $payload): void
|
public function validateOnCreation(ExecutionContextInterface $context, mixed $payload): void
|
||||||
{
|
{
|
||||||
|
@ -76,7 +76,11 @@
|
|||||||
<p><b>{{ 'workflow.Users allowed to apply transition'|trans }} : </b></p>
|
<p><b>{{ 'workflow.Users allowed to apply transition'|trans }} : </b></p>
|
||||||
<ul>
|
<ul>
|
||||||
{% for u in step.destUser %}
|
{% for u in step.destUser %}
|
||||||
<li>{{ u|chill_entity_render_box({'at_date': step.previous.transitionAt}) }}</li>
|
<li>{{ u|chill_entity_render_box({'at_date': step.previous.transitionAt}) }}
|
||||||
|
{% if entity_workflow.isOnHoldAtCurrentStep %}
|
||||||
|
<span class="badge bg-success rounded-pill" title="{{ 'workflow.On hold'|trans|escape('html_attr') }}">{{ 'workflow.On hold'|trans }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -69,6 +69,9 @@
|
|||||||
</button>
|
</button>
|
||||||
<div>
|
<div>
|
||||||
{{ macro.breadcrumb(l) }}
|
{{ macro.breadcrumb(l) }}
|
||||||
|
{% if l.entity_workflow.isOnHoldAtCurrentStep %}
|
||||||
|
<span class="badge bg-success rounded-pill" title="{{ 'workflow.On hold'|trans|escape('html_attr') }}">{{ 'workflow.On hold'|trans }}</span>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -529,6 +529,7 @@ workflow:
|
|||||||
The workflow may be accssed through this link: Une transition peut être appliquée sur ce workflow grâce au lien d'accès suivant
|
The workflow may be accssed through this link: Une transition peut être appliquée sur ce workflow grâce au lien d'accès suivant
|
||||||
Put on hold: Mettre en attente
|
Put on hold: Mettre en attente
|
||||||
Remove hold: Enlever la mise en attente
|
Remove hold: Enlever la mise en attente
|
||||||
|
On hold: En attente
|
||||||
|
|
||||||
signature_zone:
|
signature_zone:
|
||||||
title: Appliquer les signatures électroniques
|
title: Appliquer les signatures électroniques
|
||||||
|
Loading…
x
Reference in New Issue
Block a user