feat: categories for job profiles
addresses #8698w62ex
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20250430080623 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql(<<<'SQL'
|
||||||
|
ALTER TABLE job_profile ADD category VARCHAR(255) DEFAULT NULL
|
||||||
|
SQL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql(<<<'SQL'
|
||||||
|
ALTER TABLE job_profile DROP category
|
||||||
|
SQL);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,10 @@ class JobProfile implements BlameableEntityInterface, TimestampableEntityInterfa
|
|||||||
use TimestampableEntity;
|
use TimestampableEntity;
|
||||||
use SoftDeletableEntity;
|
use SoftDeletableEntity;
|
||||||
|
|
||||||
|
public const CATEGORY_GUIDE = 'guide';
|
||||||
|
public const CATEGORY_COURSE = 'course';
|
||||||
|
public const CATEGORY_SERVICE = 'service';
|
||||||
|
|
||||||
#[ORM\Id]
|
#[ORM\Id]
|
||||||
#[ORM\GeneratedValue]
|
#[ORM\GeneratedValue]
|
||||||
#[ORM\Column]
|
#[ORM\Column]
|
||||||
@@ -32,6 +36,10 @@ class JobProfile implements BlameableEntityInterface, TimestampableEntityInterfa
|
|||||||
#[Assert\NotBlank(message: 'Bitte gib die Bezeichnung an')]
|
#[Assert\NotBlank(message: 'Bitte gib die Bezeichnung an')]
|
||||||
private ?string $name = null;
|
private ?string $name = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
|
#[Assert\NotBlank(message: 'Bitte wähle die Kategorie')]
|
||||||
|
private ?string $category = null;
|
||||||
|
|
||||||
#[ORM\Column(type: Types::JSON)]
|
#[ORM\Column(type: Types::JSON)]
|
||||||
private array $requiredLicenses = [];
|
private array $requiredLicenses = [];
|
||||||
|
|
||||||
@@ -74,6 +82,28 @@ class JobProfile implements BlameableEntityInterface, TimestampableEntityInterfa
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCategory(): ?string
|
||||||
|
{
|
||||||
|
return $this->category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCategory(?string $category): static
|
||||||
|
{
|
||||||
|
$this->category = $category;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCategoryLabel(): ?string
|
||||||
|
{
|
||||||
|
return match ($this->category) {
|
||||||
|
static::CATEGORY_GUIDE => 'Reiseleitung',
|
||||||
|
static::CATEGORY_COURSE => 'Kursleitung',
|
||||||
|
static::CATEGORY_SERVICE => 'Serviceteam',
|
||||||
|
default => null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public function getRequiredLicenses(): array
|
public function getRequiredLicenses(): array
|
||||||
{
|
{
|
||||||
return $this->requiredLicenses;
|
return $this->requiredLicenses;
|
||||||
|
|||||||
@@ -22,6 +22,15 @@ class JobProfileType extends AbstractType
|
|||||||
->add('name', TextType::class, [
|
->add('name', TextType::class, [
|
||||||
'label' => 'Bezeichnung',
|
'label' => 'Bezeichnung',
|
||||||
])
|
])
|
||||||
|
->add('category', ChoiceType::class, [
|
||||||
|
'label' => 'Kategorie',
|
||||||
|
'placeholder' => 'bitte zuordnen...',
|
||||||
|
'choices' => [
|
||||||
|
'Reiseleitung' => JobProfile::CATEGORY_GUIDE,
|
||||||
|
'Kursleitung' => JobProfile::CATEGORY_COURSE,
|
||||||
|
'Serviceteam' => JobProfile::CATEGORY_SERVICE,
|
||||||
|
],
|
||||||
|
])
|
||||||
->add('requiredTrainings', EntityType::class, [
|
->add('requiredTrainings', EntityType::class, [
|
||||||
'label' => 'vorausgesetzte Fortbildung',
|
'label' => 'vorausgesetzte Fortbildung',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{{ form_start(form) }}
|
{{ form_start(form) }}
|
||||||
<div class="flex flex-col space-y-4 pb-8">
|
<div class="flex flex-col space-y-4 pb-8">
|
||||||
{{ form_row(form.name) }}
|
{{ form_row(form.name) }}
|
||||||
|
{{ form_row(form.category) }}
|
||||||
{{ form_row(form.feedbackSet) }}
|
{{ form_row(form.feedbackSet) }}
|
||||||
{{ form_row(form.requiredTrainings) }}
|
{{ form_row(form.requiredTrainings) }}
|
||||||
{{ form_row(form.requiredLicenses) }}
|
{{ form_row(form.requiredLicenses) }}
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
<th>
|
<th>
|
||||||
Bezeichnung
|
Bezeichnung
|
||||||
</th>
|
</th>
|
||||||
|
<th>
|
||||||
|
Kategorie
|
||||||
|
</th>
|
||||||
<th>
|
<th>
|
||||||
vorausg. Fortbildung(en)
|
vorausg. Fortbildung(en)
|
||||||
</th>
|
</th>
|
||||||
@@ -31,6 +34,11 @@
|
|||||||
{{ jobProfile.name }}
|
{{ jobProfile.name }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ path('app_admin_system_job_profile_edit', { 'id': jobProfile.id }) }}">
|
||||||
|
{{ jobProfile.categoryLabel | default('-') }}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<ul>
|
<ul>
|
||||||
{% for training in jobProfile.requiredTrainings %}
|
{% for training in jobProfile.requiredTrainings %}
|
||||||
|
|||||||
Reference in New Issue
Block a user