File: /var/www/dvpis2026/dvpis.kaunokolegija.lt/src/Form/LecturerAgreementType.php
<?php
namespace App\Form;
use App\Entity\LecturerAgreement;
use App\Entity\LecturerAgreementType as LCT;
use App\Entity\LecturerPosition;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class LecturerAgreementType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('lecturerPosition', EntityType::class, [
'class' => LecturerPosition::class,
'choice_label' => 'name',
'label' => 'Pareigybė',
])
->add('contractFrom', null, [
'label' => 'Sutartis nuo',
'widget' => 'single_text',
'html5' => false,
'attr' => [
'class' => 'calendar'
],
'required' => true,
])
->add('contractTo', null, [
'label' => 'Sutartis iki',
'widget' => 'single_text',
'html5' => false,
'attr' => [
'class' => 'calendar'
],
'required' => false,
])
->add('postSize', null, ['label' => 'Užimamas etatas'])
->add('lecturerAgreementType', EntityType::class, [
'class' => LCT::class,
'choice_label' => 'name',
'label' => 'Sutarties tipas',
'required' => false,
])
->add('notes', null, ['label' => 'Pastabos'])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => LecturerAgreement::class,
]);
}
}