mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
Add reject functionality for workflow signatures
Implemented the ability to reject workflow signatures by adding necessary templates, routes, and authorization checks. Updated the `WorkflowSignatureCancelController` to handle rejection and modified existing templates and translations to support the new feature.
This commit is contained in:
@@ -34,11 +34,29 @@ class SignatureStepStateChanger
|
||||
$signature
|
||||
->setState(EntityWorkflowSignatureStateEnum::SIGNED)
|
||||
->setZoneSignatureIndex($atIndex)
|
||||
->setStateDate($this->clock->now())
|
||||
;
|
||||
|
||||
->setStateDate($this->clock->now());
|
||||
$this->logger->info(self::LOG_PREFIX.'Mark signature entity as signed', ['signatureId' => $signature->getId(), 'index' => (string) $atIndex]);
|
||||
$this->onPostMark($signature);
|
||||
}
|
||||
|
||||
public function markSignatureAsCanceled(EntityWorkflowStepSignature $signature): void
|
||||
{
|
||||
$signature
|
||||
->setState(EntityWorkflowSignatureStateEnum::CANCELED)
|
||||
->setStateDate($this->clock->now());
|
||||
$this->logger->info(self::LOG_PREFIX.'Mark signature entity as canceled', ['signatureId' => $signature->getId()]);
|
||||
}
|
||||
|
||||
public function markSignatureAsRejected(EntityWorkflowStepSignature $signature): void
|
||||
{
|
||||
$signature
|
||||
->setState(EntityWorkflowSignatureStateEnum::REJECTED)
|
||||
->setStateDate($this->clock->now());
|
||||
$this->logger->info(self::LOG_PREFIX.'Mark signature entity as rejected', ['signatureId' => $signature->getId()]);
|
||||
}
|
||||
|
||||
private function onPostMark(EntityWorkflowStepSignature $signature): void
|
||||
{
|
||||
if (!EntityWorkflowStepSignature::isAllSignatureNotPendingForStep($signature->getStep())) {
|
||||
$this->logger->info(self::LOG_PREFIX.'This is not the last signature, skipping transition to another place', ['signatureId' => $signature->getId()]);
|
||||
|
||||
@@ -89,13 +107,6 @@ class SignatureStepStateChanger
|
||||
$this->logger->info(self::LOG_PREFIX.'Transition automatically applied', ['signatureId' => $signature->getId()]);
|
||||
}
|
||||
|
||||
public function markSignatureAsCanceled(EntityWorkflowStepSignature $signature): void
|
||||
{
|
||||
$signature
|
||||
->setState(EntityWorkflowSignatureStateEnum::CANCELED)
|
||||
->setStateDate($this->clock->now());
|
||||
}
|
||||
|
||||
private function getPreviousSender(EntityWorkflowStep $entityWorkflowStep): ?User
|
||||
{
|
||||
$stepsChained = $entityWorkflowStep->getEntityWorkflow()->getStepsChained();
|
||||
|
Reference in New Issue
Block a user