diff --git a/migrations/Version20240131185423.php b/migrations/Version20240131185423.php new file mode 100644 index 0000000..395d6ce --- /dev/null +++ b/migrations/Version20240131185423.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE assignment ADD job_profile_info LONGTEXT DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE assignment DROP job_profile_info'); + } +} diff --git a/src/Entity/Assignment.php b/src/Entity/Assignment.php index 350b84a..16ea32c 100644 --- a/src/Entity/Assignment.php +++ b/src/Entity/Assignment.php @@ -41,6 +41,9 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa #[Assert\NotNull(message: 'Bitte gib das Jobprofil an')] private ?JobProfile $jobProfile = null; + #[ORM\Column(type: Types::TEXT, nullable: true)] + private ?string $jobProfileInfo = null; + #[ORM\Column(nullable: true)] #[Assert\Range(min: 1, minMessage: 'Die Mindestanzahl ist 1')] private ?int $availableDispositions = 1; @@ -119,10 +122,6 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa $instance->addFee($fee); }); - $assignment->getDocuments()->map(function (Upload $document) use ($instance) { - $instance->addDocument($document); - }); - return $instance; } @@ -160,6 +159,18 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa return $this; } + public function getJobProfileInfo(): ?string + { + return $this->jobProfileInfo; + } + + public function setJobProfileInfo(?string $jobProfileInfo): static + { + $this->jobProfileInfo = $jobProfileInfo; + + return $this; + } + public function getAvailableDispositions(): ?int { return $this->availableDispositions; diff --git a/src/Form/AssignmentType.php b/src/Form/AssignmentType.php index 44396c7..66039ff 100644 --- a/src/Form/AssignmentType.php +++ b/src/Form/AssignmentType.php @@ -66,6 +66,13 @@ class AssignmentType extends AbstractType ->where('job_profile.deletedAt IS NULL'); } ]) + ->add('jobProfileInfo', TextareaType::class, [ + 'label' => 'Jobprofil Zusatzinfo', + 'required' => false, + 'attr' => [ + 'rows' => 3, + ], + ]) // ->add('dateFrom', DatepickerType::class, [ // 'label' => 'abweichender Einsatztermin von', // 'required' => false, diff --git a/templates/_partials/_assignment_info.html.twig b/templates/_partials/_assignment_info.html.twig index 26f3215..d9ea47f 100644 --- a/templates/_partials/_assignment_info.html.twig +++ b/templates/_partials/_assignment_info.html.twig @@ -5,6 +5,11 @@