Added UserSelectType and allow to set owner of a storage location

This commit is contained in:
Jan Böhmer 2023-04-02 21:50:22 +02:00
parent f101e1b184
commit 5f5541ca12
8 changed files with 142 additions and 36 deletions

View file

@ -24,7 +24,9 @@ namespace App\Form\AdminPages;
use App\Entity\Base\AbstractNamedDBElement;
use App\Entity\Parts\MeasurementUnit;
use App\Entity\UserSystem\User;
use App\Form\Type\StructuralEntityType;
use App\Form\Type\UserSelectType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\FormBuilderInterface;
@ -63,5 +65,16 @@ class StorelocationAdminForm extends BaseEntityAdminForm
'disable_not_selectable' => true,
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
]);
$builder->add('owner', UserSelectType::class, [
'required' => false,
'label' => 'storelocation.owner.label',
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
]);
$builder->add('part_owner_must_match', CheckboxType::class, [
'required' => false,
'label' => 'storelocation.part_owner_must_match.label',
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
]);
}
}