mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 22:35:01 +00:00
Refactor user suggestion logic in workflow
Removed duplicate user suggestion handling from `WorkflowController` and centralized it in `WorkflowStepType`. This change simplifies the controller and makes user suggestion logic more maintainable.
This commit is contained in:
@@ -300,19 +300,12 @@ class WorkflowController extends AbstractController
|
||||
if (\count($workflow->getEnabledTransitions($entityWorkflow)) > 0) {
|
||||
// possible transition
|
||||
$stepDTO = new WorkflowTransitionContextDTO($entityWorkflow);
|
||||
$usersInvolved = $entityWorkflow->getUsersInvolved();
|
||||
$currentUserFound = array_search($this->security->getUser(), $usersInvolved, true);
|
||||
|
||||
if (false !== $currentUserFound) {
|
||||
unset($usersInvolved[$currentUserFound]);
|
||||
}
|
||||
|
||||
$transitionForm = $this->createForm(
|
||||
WorkflowStepType::class,
|
||||
$stepDTO,
|
||||
[
|
||||
'entity_workflow' => $entityWorkflow,
|
||||
'suggested_users' => $usersInvolved,
|
||||
]
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user