diff --git a/migrations/Version20231012132143.php b/migrations/Version20231012132143.php new file mode 100644 index 0000000..0e894b8 --- /dev/null +++ b/migrations/Version20231012132143.php @@ -0,0 +1,36 @@ +addSql('ALTER TABLE disposition ADD status VARCHAR(64) NOT NULL'); + } + + public function postUp(Schema $schema): void + { + $this->connection->executeQuery('UPDATE disposition SET status=\'new\''); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE disposition DROP status'); + } +} diff --git a/src/Controller/Admin/Assignment/DetailController.php b/src/Controller/Admin/Assignment/DetailController.php index 2925fbd..a070847 100644 --- a/src/Controller/Admin/Assignment/DetailController.php +++ b/src/Controller/Admin/Assignment/DetailController.php @@ -5,6 +5,7 @@ namespace App\Controller\Admin\Assignment; use App\Controller\Traits\ReturnUrlTrait; use App\Entity\Assignment; use App\Repository\ApplicationRepository; +use App\Repository\DispositionRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -15,8 +16,11 @@ class DetailController extends AbstractController { use ReturnUrlTrait; - public function __construct(private readonly ApplicationRepository $applicationRepository) - {} + public function __construct( + private readonly ApplicationRepository $applicationRepository, + private readonly DispositionRepository $dispositionRepository + ) { + } #[Route('/admin/assignment/detail/{uuid}', name: 'app_admin_assignment_detail')] #[IsGranted('ROLE_ADMINISTRATIVE')] @@ -26,9 +30,14 @@ class DetailController extends AbstractController 'assignment' => $assignment, ]); + $dispositions = $this->dispositionRepository->findBy([ + 'assignment' => $assignment, + ]); + return $this->render('admin/assignment/detail.html.twig', [ 'assignment' => $assignment, 'applications' => $applications, + 'dispositions' => $dispositions, 'returnUrl' => $this->getReturnUrl($request, 'app_admin_assignment_index'), ]); } diff --git a/src/Entity/Disposition.php b/src/Entity/Disposition.php index 5dd5b78..e1079f1 100644 --- a/src/Entity/Disposition.php +++ b/src/Entity/Disposition.php @@ -15,6 +15,10 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf use BlameableEntity; use TimestampableEntity; + public const STATUS_NEW = 'new'; + public const STATUS_PENDING = 'pending'; + public const STATUS_CONFIRMED = 'confirmed'; + #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] @@ -23,6 +27,9 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf #[ORM\Column(type: 'string', length: 36, unique: true)] private string $uuid; + #[ORM\Column(length: 64)] + private ?string $status; + #[ORM\ManyToOne(inversedBy: 'dispositions')] private ?Assignment $assignment; @@ -41,6 +48,7 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf public function __construct(Application $application) { $this->uuid = Uuid::v4(); + $this->status = static::STATUS_NEW; $this->assignment = $application->getAssignment(); $this->teamer = $application->getTeamer(); $this->remarks = $application->getRemarks(); @@ -56,6 +64,18 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf return $this->uuid; } + public function getStatus(): ?string + { + return $this->status; + } + + public function setStatus(string $status): static + { + $this->status = $status; + + return $this; + } + public function getAssignment(): ?Assignment { return $this->assignment; diff --git a/src/Form/TeamerJobProfileType.php b/src/Form/TeamerJobProfileType.php index 46d4960..182584c 100644 --- a/src/Form/TeamerJobProfileType.php +++ b/src/Form/TeamerJobProfileType.php @@ -31,7 +31,7 @@ class TeamerJobProfileType extends AbstractType $requirements[] = $training->getName(); } foreach ($choice->getRequiredLicenses() as $license) { - $requirements[] = sprintf('Offizielle %slehrer*innenlizenz', ucfirst(strtolower($license))); + $requirements[] = sprintf('Offizielle %slehrer:innenlizenz', ucfirst(strtolower($license))); } if ($requirements) { diff --git a/src/Twig/AppRuntime.php b/src/Twig/AppRuntime.php index 566b82a..cc490a1 100644 --- a/src/Twig/AppRuntime.php +++ b/src/Twig/AppRuntime.php @@ -33,7 +33,7 @@ class AppRuntime implements RuntimeExtensionInterface public function licenseLabel(string $type): string { - return sprintf('Offizielle %slehrer*innenlizenz', ucfirst(strtolower($type))); + return sprintf('Offizielle %slehrer:innenlizenz', ucfirst(strtolower($type))); } public function bpnCountryLabel(?string $token, string $property = 'name'): string diff --git a/templates/_partials/_assignment_info_compact.html.twig b/templates/_partials/_assignment_info_compact.html.twig new file mode 100644 index 0000000..c0fa15b --- /dev/null +++ b/templates/_partials/_assignment_info_compact.html.twig @@ -0,0 +1,49 @@ +
+
+ Jobprofil {{ assignment.jobProfile.name }} +
+
+
+ Destination +
+
+ {{ assignment.destination.product }} +
+ {{ assignment.destination.hotel }} +
+
+ Einsatztermin +
+
+ {{ assignment.totalPeriod.start|date('d.m.Y') }} - {{ assignment.totalPeriod.end|date('d.m.Y') }} +
+
+
+ {% if assignment.pickup and assignment.pickupDate %} +
+ Busabfahrt +
+
+ {{ assignment.pickupDate|date('d.m.Y') }} +
+
+ Busbegleitung +
+
+ ab {{ assignment.pickup|bpn_pickup_label }} +
+ {% endif %} +
+ Honorar +
+
+ {% if assignment.fees|length %} + {% for fee in assignment.fees %} + {{ fee.name }} {{ fee.value|format_money }} + {% endfor %} + {% else %} + - + {% endif %} +
+
+
diff --git a/templates/admin/assignment/detail.html.twig b/templates/admin/assignment/detail.html.twig index 8dda3e6..0f94bab 100644 --- a/templates/admin/assignment/detail.html.twig +++ b/templates/admin/assignment/detail.html.twig @@ -6,98 +6,146 @@

Einsatzübersicht

-
-
- {% include '_partials/_assignment_info.html.twig' %} -
-
-

- Bewerbungen -

-
-
- - +
+ {% include '_partials/_assignment_info_compact.html.twig' %} +
+
+

+ Bewerbungen +

+
+
+
+ + + + + + + + + + {% for application in applications %} - - - - + + + + - - - {% for application in applications %} - - - - - - - {% else %} - - - - {% endfor %} - -
+ Name + + Anmerkungen + + Status +
- Name - - Anmerkungen - - Status - + + {{ application.teamer }} + + + {{ application.requests|nl2br|default('-') }} + + {{ ('label.application.status.' ~ application.status)|trans }} + +
+ {% if is_granted('DISPOSE', application) %} + + {% endif %} + {% if is_granted('REJECT', application) %} + + {% endif %} + {% if is_granted('DELETE', application) %} + + {% endif %} +
+
- - {{ application.teamer }} - - - {{ application.requests|nl2br|default('-') }} - - {{ ('label.application.status.' ~ application.status)|trans }} - -
- {% if is_granted('DISPOSE', application) %} - - {% endif %} - {% if is_granted('REJECT', application) %} - - {% endif %} - {% if is_granted('DELETE', application) %} - - {% endif %} -
-
- Bisher liegen keine Bewerbungen vor... -
-
+ {% else %} + + + Es liegen keine Bewerbungen vor... + + + {% endfor %} + +
- - zurück -
+

+ Einteilungen +

+
+
+ + + + + + + + + + + {% for disposition in dispositions %} + + + + + + + {% else %} + + + + {% endfor %} + +
+ Name + + Anmerkungen + + Status +
+ + {{ disposition.teamer }} + + + {{ disposition.remarks|nl2br|default('-') }} + + {{ ('label.disposition.status.' ~ disposition.status)|trans }} + +
+
+
+ Es gibt noch keine Einteilungen... +
+
+
+ + zurück +
{% endblock %} \ No newline at end of file diff --git a/translations/messages.de.yaml b/translations/messages.de.yaml index e8ae59a..ea45d5e 100644 --- a/translations/messages.de.yaml +++ b/translations/messages.de.yaml @@ -4,6 +4,11 @@ label: new: neu pending: in Bearbeitung rejected: abgelehnt + disposition: + status: + new: neu + pending: in Prüfung + confirmed: bestätigt document: type: invoice: Honorarnote