From 2b3d7f34fc433f744626fa53325658f1311b05cd Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 21 Mar 2023 16:08:26 +0100 Subject: [PATCH] Feature: Add new field ccuser in workflow step form --- .../ChillMainBundle/Controller/WorkflowController.php | 1 + .../ChillMainBundle/Entity/Workflow/EntityWorkflow.php | 7 +++++++ src/Bundle/ChillMainBundle/Form/WorkflowStepType.php | 5 +++++ .../Resources/views/Workflow/_decision.html.twig | 2 ++ src/Bundle/ChillMainBundle/translations/messages.fr.yml | 1 + src/Bundle/ChillMainBundle/translations/messages.nl.yml | 1 + 6 files changed, 17 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php index 0f00a177f..0de77b81e 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php @@ -330,6 +330,7 @@ class WorkflowController extends AbstractController } // TODO symfony 5: add those "future" on context ($workflow->apply($entityWorkflow, $transition, $context) + $entityWorkflow->futureCcUsers = $transitionForm['future_cc_users']->getData(); $entityWorkflow->futureDestUsers = $transitionForm['future_dest_users']->getData(); $entityWorkflow->futureDestEmails = $transitionForm['future_dest_emails']->getData(); diff --git a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php index e4683f24b..73f4c2b04 100644 --- a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php +++ b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php @@ -41,6 +41,13 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface use TrackUpdateTrait; + /** + * a list of future cc users for the next steps. + * + * @var array|User[] + */ + public array $futureCcUsers = []; + /** * a list of future dest emails for the next steps. * diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 1b18b3ef8..7019eeaf4 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -156,6 +156,11 @@ class WorkflowStepType extends AbstractType 'mapped' => false, 'suggested' => $options['suggested_users'], ]) + ->add('future_cc_users', PickUserDynamicType::class, [ + 'label' => 'workflow.cc for next steps', + 'multiple' => true, + 'mapped' => false, + ]) ->add('future_dest_emails', ChillCollectionType::class, [ 'label' => 'workflow.dest by email', 'help' => 'workflow.dest by email help', diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig index bd9274739..021b7e933 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig @@ -65,6 +65,8 @@
{{ form_row(transition_form.future_dest_users) }} + {{ form_row(transition_form.future_cc_users) }} + {{ form_row(transition_form.future_dest_emails) }}
diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index f01976e87..5eb6c1d49 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -447,6 +447,7 @@ workflow: Created by: Créé par My decision: Ma décision Next step: Prochaine étape + cc for next steps: Utilisateurs en copie dest for next steps: Utilisateurs qui valideront la prochaine étape Freeze: Geler Freezed: Gelé diff --git a/src/Bundle/ChillMainBundle/translations/messages.nl.yml b/src/Bundle/ChillMainBundle/translations/messages.nl.yml index 97341dd3c..b585c3822 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.nl.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.nl.yml @@ -373,6 +373,7 @@ workflow: Created by: Créé par My decision: Ma décision Next step: Prochaine étape + cc for next steps: Utilisateurs en copie dest for next steps: Utilisateurs qui valideront la prochaine étape Freeze: Geler Freezed: Gelé