handle hidden users in teams (#1841)
* allow to add disabled users to team * allow to include disabled users in user-select * include disabled users when editing team members ONLY if they are already part of team
This commit is contained in:
@@ -23,6 +23,9 @@ class TeamEditForm extends AbstractType
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
/** @var Team|null $team */
|
||||
$team = $options['data'] ?? null;
|
||||
|
||||
$builder
|
||||
->add('name', TextType::class, [
|
||||
'label' => 'label.name',
|
||||
@@ -55,6 +58,8 @@ class TeamEditForm extends AbstractType
|
||||
'title' => 'Team member',
|
||||
'description' => 'Array of team member IDs',
|
||||
],
|
||||
// make sure that disabled users show up in the result list
|
||||
'include_users' => (null !== $team && $team->getUsers()->count() > 0 ? $team->getUsers()->toArray() : [])
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user