diff --git a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php index d25d20d6a..f68dc7b7e 100644 --- a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php +++ b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php @@ -454,10 +454,6 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface $newStep->addDestUser($transitionContextDTO->futureUserSignature); } - foreach ($transitionContextDTO->futureDestEmails as $email) { - $newStep->addDestEmail($email); - } - if (null !== $transitionContextDTO->futureUserSignature) { new EntityWorkflowStepSignature($newStep, $transitionContextDTO->futureUserSignature); } else { diff --git a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStep.php b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStep.php index b64d61b71..3daacd49d 100644 --- a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStep.php +++ b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStep.php @@ -132,6 +132,9 @@ class EntityWorkflowStep return $this; } + /** + * @deprecated + */ public function addDestEmail(string $email): self { if (!\in_array($email, $this->destEmail, true)) { @@ -242,6 +245,11 @@ class EntityWorkflowStep return $this->currentStep; } + /** + * @return array + * + * @deprecated + */ public function getDestEmail(): array { return $this->destEmail; diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 8ab17e1e1..e55b1896d 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -12,7 +12,6 @@ declare(strict_types=1); namespace Chill\MainBundle\Form; use Chill\MainBundle\Entity\Workflow\EntityWorkflow; -use Chill\MainBundle\Form\Type\ChillCollectionType; use Chill\MainBundle\Form\Type\ChillTextareaType; use Chill\MainBundle\Form\Type\PickUserDynamicType; use Chill\MainBundle\Form\Type\PickUserGroupOrUserDynamicType; @@ -21,12 +20,9 @@ use Chill\MainBundle\Workflow\WorkflowTransitionContextDTO; use Chill\PersonBundle\Form\Type\PickPersonDynamicType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; -use Symfony\Component\Form\Extension\Core\Type\EmailType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Validator\Constraints\Callback; -use Symfony\Component\Validator\Constraints\Email; -use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Workflow\Registry; @@ -170,21 +166,6 @@ class WorkflowStepType extends AbstractType 'suggested' => $options['suggested_users'], 'empty_data' => '[]', 'attr' => ['class' => 'future-cc-users'], - ]) - ->add('futureDestEmails', ChillCollectionType::class, [ - 'label' => 'workflow.dest by email', - 'help' => 'workflow.dest by email help', - 'allow_add' => true, - 'entry_type' => EmailType::class, - 'button_add_label' => 'workflow.Add an email', - 'button_remove_label' => 'workflow.Remove an email', - 'empty_collection_explain' => 'workflow.Any email', - 'entry_options' => [ - 'constraints' => [ - new NotNull(), new NotBlank(), new Email(), - ], - 'label' => 'Email', - ], ]); $builder @@ -223,9 +204,8 @@ class WorkflowStepType extends AbstractType } } $destUsers = $step->futureDestUsers; - $destEmails = $step->futureDestEmails; - if (!$toFinal && [] === $destUsers && [] === $destEmails) { + if (!$toFinal && [] === $destUsers) { $context ->buildViolation('workflow.You must add at least one dest user or email') ->atPath('future_dest_users') diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig index 4f43c4dad..575e7cb22 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig @@ -82,10 +82,6 @@ {{ form_row(transition_form.futureCcUsers) }} {{ form_errors(transition_form.futureCcUsers) }} -
- {{ form_row(transition_form.futureDestEmails) }} - {{ form_errors(transition_form.futureDestEmails) }} -

{{ form_label(transition_form.comment) }}

@@ -115,15 +111,6 @@ {% endif %} - {% if entity_workflow.currentStep.destEmail|length > 0 %} -

{{ 'workflow.An access key was also sent to those addresses'|trans }} :

- - {% endif %} - {% if entity_workflow.currentStep.destUserByAccessKey|length > 0 %}

{{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }} :