From 19eb6f7ebb44091d25cd546e34796c06d89bfe1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 23 Oct 2024 01:10:39 +0200 Subject: [PATCH] Add suggested persons and third parties in form Integrated suggested persons and third parties into the WorkflowStepType form. This enhancement auto-populates suggestion fields for better user experience. It ensures that the suggestion data for persons and third parties is readily available in the form configuration. --- src/Bundle/ChillMainBundle/Form/WorkflowStepType.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 18afc5c58..222927b42 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -46,6 +46,8 @@ class WorkflowStepType extends AbstractType $place = $workflow->getMarking($entityWorkflow); $placeMetadata = $workflow->getMetadataStore()->getPlaceMetadata(array_keys($place->getPlaces())[0]); $suggestedUsers = $this->entityWorkflowManager->getSuggestedUsers($entityWorkflow); + $suggestedThirdParties = $this->entityWorkflowManager->getSuggestedThirdParties($entityWorkflow); + $suggestedPersons = $this->entityWorkflowManager->getSuggestedPersons($entityWorkflow); if (null === $options['entity_workflow']) { throw new \LogicException('if transition is true, entity_workflow should be defined'); @@ -155,6 +157,7 @@ class WorkflowStepType extends AbstractType 'label' => 'workflow.signature_zone.person signatures', 'multiple' => true, 'empty_data' => '[]', + 'suggested' => $suggestedPersons, ]) ->add('futureUserSignature', PickUserDynamicType::class, [ 'label' => 'workflow.signature_zone.user signature', @@ -196,6 +199,7 @@ class WorkflowStepType extends AbstractType 'help' => 'workflow.transition_destinee_third_party_help', 'multiple' => true, 'empty_data' => [], + 'suggested' => $suggestedThirdParties, ]); $builder