diff --git a/migrations/Version20231021133634.php b/migrations/Version20231021133634.php
new file mode 100644
index 0000000..c0bb06d
--- /dev/null
+++ b/migrations/Version20231021133634.php
@@ -0,0 +1,35 @@
+addSql('ALTER TABLE application ADD remarks_by_id INT DEFAULT NULL');
+ $this->addSql('ALTER TABLE application ADD CONSTRAINT FK_A45BDDC1DF01D017 FOREIGN KEY (remarks_by_id) REFERENCES user (id)');
+ $this->addSql('CREATE INDEX IDX_A45BDDC1DF01D017 ON application (remarks_by_id)');
+ }
+
+ public function down(Schema $schema): void
+ {
+ // this down() migration is auto-generated, please modify it to your needs
+ $this->addSql('ALTER TABLE application DROP FOREIGN KEY FK_A45BDDC1DF01D017');
+ $this->addSql('DROP INDEX IDX_A45BDDC1DF01D017 ON application');
+ $this->addSql('ALTER TABLE application DROP remarks_by_id');
+ }
+}
diff --git a/src/Entity/Application.php b/src/Entity/Application.php
index 3b342d7..801d8a2 100644
--- a/src/Entity/Application.php
+++ b/src/Entity/Application.php
@@ -40,6 +40,9 @@ class Application implements TimestampableEntityInterface
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $remarks = null;
+ #[ORM\ManyToOne]
+ private ?User $remarksBy = null;
+
public function __construct(Assignment $assignment, Teamer $teamer)
{
$this->uuid = Uuid::v4();
@@ -143,4 +146,16 @@ class Application implements TimestampableEntityInterface
return $count === $requiredTrainings->count();
}
+
+ public function getRemarksBy(): ?User
+ {
+ return $this->remarksBy;
+ }
+
+ public function setRemarksBy(?User $remarksBy): static
+ {
+ $this->remarksBy = $remarksBy;
+
+ return $this;
+ }
}
diff --git a/src/Repository/AssignmentRepository.php b/src/Repository/AssignmentRepository.php
index 4244686..543f407 100644
--- a/src/Repository/AssignmentRepository.php
+++ b/src/Repository/AssignmentRepository.php
@@ -2,6 +2,7 @@
namespace App\Repository;
+use App\Entity\Application;
use App\Entity\Assignment;
use App\Entity\Teamer;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
@@ -37,14 +38,15 @@ class AssignmentRepository extends ServiceEntityRepository
if (null !== $teamer) {
$qb
- ->leftJoin('assignment.applications', 'application', Join::WITH, 'application.teamer = :teamer')
- ->leftJoin('assignment.dispositions', 'disposition', Join::WITH, 'disposition.teamer = :teamer')
+ ->leftJoin('assignment.applications', 'application', Join::WITH, $qb->expr()->eq('application.teamer', ':teamer'))
+ ->leftJoin('assignment.dispositions', 'disposition', Join::WITH, $qb->expr()->eq('disposition.teamer', ':teamer'))
->setParameter('teamer', $teamer)
;
} else {
$qb
- ->leftJoin('assignment.applications', 'application')
+ ->leftJoin('assignment.applications', 'application', Join::WITH, $qb->expr()->neq('application.status', ':status'))
->leftJoin('assignment.dispositions', 'disposition')
+ ->setParameter('status', Application::STATUS_REJECTED)
;
}
@@ -59,9 +61,9 @@ class AssignmentRepository extends ServiceEntityRepository
->select('assignment', 'destination', 'job_profile', 'application', 'disposition')
->innerJoin('assignment.destination', 'destination')
->innerJoin('assignment.jobProfile', 'job_profile')
- ->innerJoin('assignment.teamers', 'teamer', Join::WITH, 'teamer = :teamer')
- ->leftJoin('assignment.applications', 'application', Join::WITH, 'application.teamer = :teamer')
- ->leftJoin('assignment.dispositions', 'disposition', Join::WITH, 'disposition.teamer = :teamer')
+ ->innerJoin('assignment.teamers', 'teamer', Join::WITH, $qb->expr()->eq('teamer', ':teamer'))
+ ->leftJoin('assignment.applications', 'application', Join::WITH, $qb->expr()->eq('application.teamer', ':teamer'))
+ ->leftJoin('assignment.dispositions', 'disposition', Join::WITH, $qb->expr()->eq('disposition.teamer', ':teamer'))
->where($qb->expr()->isNull('assignment.deletedAt'))
->setParameter('teamer', $teamer)
;
diff --git a/templates/_partials/_assignment_info.html.twig b/templates/_partials/_assignment_info.html.twig
index 76078bb..ed4f2d4 100644
--- a/templates/_partials/_assignment_info.html.twig
+++ b/templates/_partials/_assignment_info.html.twig
@@ -1,52 +1,76 @@
-
-
- Jobprofil
+
+
+
+ Jobprofil
+
+
+ {{ assignment.jobProfile.name }}
+
-
- {{ assignment.jobProfile.name }}
+
+
+ Destination
+
+
+ {{ assignment.destination.product }}, {{ assignment.destination.hotel }}
+
-
- Destination
-
-
- {{ assignment.destination.product }}
-
- {{ assignment.destination.hotel }}
-
-
- Einsatztermin
-
-
- {{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }}
+
+
+ Einsatztermin
+
+
+ {{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }}
+
{% if assignment.pickup and assignment.pickupDate %}
-
- Busabfahrt
+
+
+ Busabfahrt
+
+
+ {{ assignment.pickupDate|date('d.m.Y') }}
+
-
- {{ assignment.pickupDate|date('d.m.Y') }}
-
-
- Busbegleitung
-
-
- {{ assignment.pickup|bpn_pickup_label }}
+
+
+ Busbegleitung
+
+
+ {{ assignment.pickup|bpn_pickup_label }}
+
{% endif %}
-
- Du bekommst
-
-
- {{ assignment.benefits|nl2list }}
+
+
+ Du bekommst
+
+
+ {{ assignment.benefits|nl2list }}
+
{% if assignment.fees|length %}
-
- Honorar
-
-
- {% for fee in assignment.fees %}
- {{ fee.name }} {{ fee.value|format_money }}
- {% endfor %}
+
+
+ Honorar
+
+
+ {% for fee in assignment.fees %}
+ {{ fee.name }} {{ fee.value|format_money }}
+ {% endfor %}
+
{% endif %}
-
+ {% if additional is defined %}
+ {% for item in additional %}
+
+
+ {{ item.type }}
+
+
+ {{ item.description|raw }}
+
+
+ {% endfor %}
+ {% endif %}
+
diff --git a/templates/_partials/_assignment_info_compact.html.twig b/templates/_partials/_assignment_info_compact.html.twig
index cb17070..32f8474 100644
--- a/templates/_partials/_assignment_info_compact.html.twig
+++ b/templates/_partials/_assignment_info_compact.html.twig
@@ -1,49 +1,62 @@
-
- Jobprofil {{ assignment.jobProfile.name }}
-
-
-
- Destination
+
+
+
+ Jobprofil
+
+
+ {{ assignment.jobProfile.name }}
+
-
- {{ assignment.destination.product }}
-
- {{ assignment.destination.hotel }}
+
+
+ Destination
+
+
+ {{ assignment.destination.product }}, {{ assignment.destination.hotel }}
+
-
- Einsatztermin
+
+
+ Einsatztermin
+
+
+ {{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }}
+
-
- {{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }}
-
-
-
+
+
{% if assignment.pickup and assignment.pickupDate %}
-
- Busabfahrt
+
+
+ Busabfahrt
+
+
+ {{ assignment.pickupDate|date('d.m.Y') }}
+
-
- {{ assignment.pickupDate|date('d.m.Y') }}
-
-
- Busbegleitung
-
-
- {{ assignment.pickup|bpn_pickup_label }}
+
+
+ Busbegleitung
+
+
+ {{ assignment.pickup|bpn_pickup_label }}
+
{% endif %}
-
- Honorar
+
+
+ Honorar
+
+
+ {% if assignment.fees|length %}
+ {% for fee in assignment.fees %}
+ {{ fee.name }} {{ fee.value|format_money }}
+ {% endfor %}
+ {% else %}
+ -
+ {% endif %}
+
-
- {% if assignment.fees|length %}
- {% for fee in assignment.fees %}
- {{ fee.name }} {{ fee.value|format_money }}
- {% endfor %}
- {% else %}
- -
- {% endif %}
-
-
+
diff --git a/templates/_partials/_assignment_requirements_info.html.twig b/templates/_partials/_assignment_requirements_info.html.twig
index 472fc99..c72f046 100644
--- a/templates/_partials/_assignment_requirements_info.html.twig
+++ b/templates/_partials/_assignment_requirements_info.html.twig
@@ -1,5 +1,5 @@
-{% if assignment.pickup and assignment.effectivePickupDate %}
+ {% if assignment.pickup and assignment.effectivePickupDate %}
Busbegleitung {{ assignment.pickup|bpn_pickup_label }} am {{ assignment.effectivePickupDate|date('d.m.Y') }}
diff --git a/templates/_partials/_description_list.html.twig b/templates/_partials/_description_list.html.twig
new file mode 100644
index 0000000..64700b8
--- /dev/null
+++ b/templates/_partials/_description_list.html.twig
@@ -0,0 +1,12 @@
+
+ {% for item in items %}
+
+
+ {{ item.type }}
+
+
+ {{ item.description }}
+
+
+ {% endfor %}
+
\ No newline at end of file
diff --git a/templates/_partials/_errorbox.html.twig b/templates/_partials/_errorbox.html.twig
new file mode 100644
index 0000000..034b426
--- /dev/null
+++ b/templates/_partials/_errorbox.html.twig
@@ -0,0 +1,4 @@
+
+ {{ icon('alert', 'w-6 h-6 shrink-0') }}
+ {{ message }}
+
diff --git a/templates/_partials/_infobox.html.twig b/templates/_partials/_infobox.html.twig
new file mode 100644
index 0000000..886633d
--- /dev/null
+++ b/templates/_partials/_infobox.html.twig
@@ -0,0 +1,4 @@
+
+ {{ icon('info', 'w-6 h-6 shrink-0') }}
+ {{ message }}
+
diff --git a/templates/admin/assignment/detail.html.twig b/templates/admin/assignment/detail.html.twig
index af0eac7..53fb2b3 100644
--- a/templates/admin/assignment/detail.html.twig
+++ b/templates/admin/assignment/detail.html.twig
@@ -6,7 +6,7 @@
Einsatzübersicht
-
+
{% include '_partials/_assignment_info_compact.html.twig' %}
@@ -22,7 +22,7 @@
Name
- Anmerkungen
+ Wünsche
Status
diff --git a/templates/teamer/application/index.html.twig b/templates/teamer/application/index.html.twig
index d150187..5d62a75 100644
--- a/templates/teamer/application/index.html.twig
+++ b/templates/teamer/application/index.html.twig
@@ -35,25 +35,22 @@
{% endif %}
-
- {{ icon('info', 'w-4 h-4 shrink-0') }}
- Details
-
- {% if is_granted('DELETE', application) %}
-
- {{ icon('delete', 'w-4 h-4 shrink-0') }}
- Löschen
-
+ {% if application.status == constant('App\\Entity\\Application::STATUS_REJECTED') %}
+ {% set icon = 'close' %}
+ {% set class = 'bg-gray-100 text-gray-800 hover:bg-gray-50' %}
+ {% set url = path('app_teamer_assignment', { 'uuid': assignment.uuid, 'r': return_url() }) %}
+ {% set label = 'Bewerbung abgelehnt' %}
+ {% else %}
+ {% set icon = 'hourglass' %}
+ {% set class = 'bg-yellow-100 text-yellow-800 hover:bg-yellow-50' %}
+ {% set url = path('app_teamer_assignment', { 'uuid': assignment.uuid, 'r': return_url() }) %}
+ {% set label = 'in Bearbeitung' %}
{% endif %}
+
+ {{ icon(icon, 'w-4 h-4 shrink-0') }}
+ {{ label }}
+
{% if teamer.bookmarks.contains(assignment) %}
{{ icon('star', 'w-5 h-5 text-yellow-500 absolute top-0 right-0 mt-2 mr-2') }}
diff --git a/templates/teamer/assignment/index.html.twig b/templates/teamer/assignment/index.html.twig
index c92a2c7..6aa8fb7 100644
--- a/templates/teamer/assignment/index.html.twig
+++ b/templates/teamer/assignment/index.html.twig
@@ -7,9 +7,7 @@
Einsatzübersicht
-
- {% include '_partials/_assignment_info.html.twig' %}
-
+ {% include '_partials/_assignment_info.html.twig' %}