feat: additional jobprofile infotext

This commit is contained in:
Björn Fromme
2024-01-31 20:09:38 +01:00
parent 9ae2988c1a
commit 2a9e1232ec
6 changed files with 65 additions and 5 deletions
+31
View File
@@ -0,0 +1,31 @@
<?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 Version20240131185423 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('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');
}
}
+15 -4
View File
@@ -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;
+7
View File
@@ -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,
@@ -5,6 +5,11 @@
</dt>
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
{{ assignment.jobProfile.name }}
{% if assignment.jobProfileInfo %}
<div class="pt-2">
{{ assignment.jobProfileInfo|nl2br }}
</div>
{% endif %}
</dd>
</div>
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
@@ -6,6 +6,11 @@
</dt>
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
{{ assignment.jobProfile.name }}
{% if assignment.jobProfileInfo %}
<div class="pt-2">
{{ assignment.jobProfileInfo|nl2br }}
</div>
{% endif %}
</dd>
</div>
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
+2 -1
View File
@@ -28,6 +28,8 @@
</div>
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
{{ form_row(form.jobProfile) }}
{{ form_row(form.jobProfileInfo) }}
{{ form_row(form.benefits) }}
{{ form_row(form.contact) }}
</div>
<div class="relative">
@@ -39,7 +41,6 @@
</div>
</div>
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
{{ form_row(form.benefits) }}
{{ form_row(form.fees) }}
{{ form_row(form.remarks) }}
</div>