WIP: Adjust model, remove manager branch in navigation
This commit is contained in:
@@ -30,6 +30,9 @@ class AssignmentType extends AbstractType
|
||||
'label' => 'Destination',
|
||||
'class' => BpnDate::class,
|
||||
'label_property' => 'product',
|
||||
'label_function' => function (BpnDate $date) {
|
||||
return (string) $date;
|
||||
},
|
||||
'endpoint_route' => 'app_admin_autocomplete_bpndate',
|
||||
])
|
||||
->add('jobProfile', EntityType::class, [
|
||||
@@ -39,10 +42,12 @@ class AssignmentType extends AbstractType
|
||||
'placeholder' => 'Bitte auswählen',
|
||||
])
|
||||
->add('dateFrom', DatepickerType::class, [
|
||||
'label' => 'Einsatztermin von',
|
||||
'label' => 'abweichender Einsatztermin von',
|
||||
'required' => false,
|
||||
])
|
||||
->add('dateTo', DatepickerType::class, [
|
||||
'label' => 'Einsatztermin bis',
|
||||
'label' => 'abweichender Einsatztermin bis',
|
||||
'required' => false,
|
||||
])
|
||||
->add('pickupDate', DatepickerType::class, [
|
||||
'label' => 'Busabfahrt',
|
||||
|
||||
@@ -21,12 +21,14 @@ class JobProfileType extends AbstractType
|
||||
->add('name', TextType::class, [
|
||||
'label' => 'Bezeichnung',
|
||||
])
|
||||
->add('requiredTraining', EntityType::class, [
|
||||
->add('requiredTrainings', EntityType::class, [
|
||||
'label' => 'vorausgesetzte Fortbildung',
|
||||
'required' => false,
|
||||
'placeholder' => 'keine',
|
||||
'class' => Training::class,
|
||||
'choice_label' => 'name',
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'query_builder' => function (EntityRepository $repository) {
|
||||
return $repository->createQueryBuilder('job_profile')
|
||||
->orderBy('job_profile.name', 'ASC')
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Form;
|
||||
|
||||
use App\Entity\JobProfile;
|
||||
use App\Entity\Teamer;
|
||||
use App\Entity\Training;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
@@ -23,10 +24,11 @@ class TeamerJobProfileType extends AbstractType
|
||||
'class' => JobProfile::class,
|
||||
// Append potential training or license requirements to profile labels
|
||||
'choice_label' => function($choice, string $key, mixed $value): TranslatableMessage|string {
|
||||
/** @var JobProfile $choice */
|
||||
$label = $choice->getName();
|
||||
$requirements = [];
|
||||
if (null !== $training = $choice->getRequiredTraining()) {
|
||||
$requirements[].= $training->getName();
|
||||
foreach ($choice->getRequiredTrainings() as $training) {
|
||||
$requirements[] = $training->getName();
|
||||
}
|
||||
foreach ($choice->getRequiredLicenses() as $license) {
|
||||
$requirements[] = sprintf('Offizielle %slehrer*innenlizenz', ucfirst(strtolower($license)));
|
||||
|
||||
Reference in New Issue
Block a user