mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-16 07:59:30 +00:00
Added UserSelectType and allow to set owner of a storage location
This commit is contained in:
parent
f101e1b184
commit
5f5541ca12
8 changed files with 142 additions and 36 deletions
|
|
@ -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),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue