diff --git a/assets/images/icons.svg b/assets/images/icons.svg index d5c059b..cc4265b 100644 --- a/assets/images/icons.svg +++ b/assets/images/icons.svg @@ -75,6 +75,12 @@ + + + + + + @@ -161,6 +167,11 @@ + + + + + diff --git a/migrations/Version20231020102814.php b/migrations/Version20231020102814.php new file mode 100644 index 0000000..ea3b612 --- /dev/null +++ b/migrations/Version20231020102814.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE destination ADD country VARCHAR(2) DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE destination DROP country'); + } +} diff --git a/src/BusProNet/Model/Hotel.php b/src/BusProNet/Model/Hotel.php index 3729150..3b5e087 100644 --- a/src/BusProNet/Model/Hotel.php +++ b/src/BusProNet/Model/Hotel.php @@ -12,6 +12,7 @@ class Hotel private ?string $street = null; private ?string $phone = null; private ?string $type = null; + private ?string $country = null; public function getId(): ?int { @@ -109,4 +110,15 @@ class Hotel return $this; } + public function getCountry(): ?string + { + return $this->country; + } + + public function setCountry(?string $country): static + { + $this->country = $country; + + return $this; + } } \ No newline at end of file diff --git a/src/BusProNet/ResponseParser.php b/src/BusProNet/ResponseParser.php index 04b56d2..5ef256d 100644 --- a/src/BusProNet/ResponseParser.php +++ b/src/BusProNet/ResponseParser.php @@ -227,6 +227,7 @@ class ResponseParser ->setBusProId($busProId) ->setCode((string) $item->attributes()['code']) ->setName($item->xpath('name') ? (string) $item->xpath('name')[0] : null) + ->setCountry($item->xpath('land') ? strtolower((string) $item->xpath('land')[0]) : null) ->setCity($item->xpath('ort') ? (string) $item->xpath('ort')[0] : null) ->setStreet($item->xpath('strasse') ? (string) $item->xpath('strasse')[0] : null) ->setPhone($item->xpath('telefon') ? (string) $item->xpath('telefon')[0] : null) diff --git a/src/Command/BpnImportCommand.php b/src/Command/BpnImportCommand.php index 24f4f18..450855c 100644 --- a/src/Command/BpnImportCommand.php +++ b/src/Command/BpnImportCommand.php @@ -93,6 +93,7 @@ class BpnImportCommand extends Command 'date_to' => $dateTo->format('Y-m-d'), 'product' => $product, 'pickups' => json_encode($datePickups), + 'country' => $hotel->getCountry(), ], [ 'id' => $id, 'hotel_bus_pro_id' => $hotelBusProId, @@ -112,6 +113,7 @@ class BpnImportCommand extends Command 'hotel_code' => $hotel->getCode(), 'hotel_bus_pro_id' => $hotelBusProId, 'pickups' => json_encode($datePickups), + 'country' => $hotel->getCountry(), ]) ; ++$addedCount; diff --git a/src/Entity/Destination.php b/src/Entity/Destination.php index 2e89e1f..f226a2b 100644 --- a/src/Entity/Destination.php +++ b/src/Entity/Destination.php @@ -41,6 +41,9 @@ class Destination #[ORM\Column] private array $pickups = []; + #[ORM\Column(length: 2, nullable: true)] + private ?string $country = null; + public function __toString(): string { return sprintf('%s - %s: %s, %s', @@ -168,4 +171,16 @@ class Destination { return 0 < count($this->getPickups()); } + + public function getCountry(): ?string + { + return $this->country; + } + + public function setCountry(?string $country): static + { + $this->country = $country; + + return $this; + } } diff --git a/templates/base.html.twig b/templates/base.html.twig index 644defd..6e76d1f 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -2,6 +2,7 @@ + {% block title %}MyE&P Team{% endblock %} diff --git a/templates/teamer/index.html.twig b/templates/teamer/index.html.twig index de39d35..567d5d5 100644 --- a/templates/teamer/index.html.twig +++ b/templates/teamer/index.html.twig @@ -17,80 +17,59 @@ {% endif %} -
-
- - - - - - - - - - - - {% for assignment in pagination %} - - - - - - - - {% else %} - - - - {% endfor %} - -
- {{ knp_pagination_sortable(pagination, 'Einsatz­zeitraum', 'assignment.dateFrom') }} - - {{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }} - - {{ knp_pagination_sortable(pagination, 'Destination', 'destination.dateFrom') }} - - {{ knp_pagination_sortable(pagination, 'Bus', 'assignment.pickup') }} -
- {{ assignment.effectivePeriod.start|date('d.m.Y') }} - -
- {{ assignment.effectivePeriod.end|date('d.m.Y') }} -
- {{ assignment.jobProfile.name }} - - {{ assignment.destination.product }} -
- {{ assignment.destination.hotel }} -
- {{ assignment.pickup ? assignment.pickup|bpn_pickup_label|default('-') : '-' }} -
- {{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }} -
- {% if assignment.applications|length %} - {% 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() }) %} - {% elseif assignment.dispositions|length %} - {% set icon = 'check' %} - {% set class = 'bg-green-100 text-green-700 hover:bg-green-50' %} - {% set url = path('app_teamer_disposition_detail', { 'uuid': assignment.dispositions[0].uuid }) %} - {% else %} - {% set icon = 'info' %} - {% set class = 'btn--info' %} - {% set url = path('app_teamer_assignment', { 'uuid': assignment.uuid, 'r': return_url() }) %} - {% endif %} - - {{ icon(icon, 'w-4 h-4') }} - -
- Keine Daten... -
- {{ knp_pagination_render(pagination) }} -
+ +
+ {% for assignment in pagination %} +
+
+
+ {{ icon('flag-' ~ assignment.destination.country, 'w-5 h-5 shrink-0') }} + {{ assignment.destination.product }} +
+
+ {{ icon('calendar', 'w-5 h-5 shrink-0') }} + {{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }} +
+
+ {{ icon('profile', 'w-5 h-5 shrink-0') }} + {{ assignment.jobProfile.name }} +
+
+ {{ icon('house', 'w-5 h-5 shrink-0') }} + {{ assignment.destination.hotel }} +
+ {% if assignment.pickup %} +
+ {{ icon('bus', 'w-5 h-5 shrink-0') }} + {{ assignment.pickup|bpn_pickup_label|default('-') }} {{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }} +
+ {% endif %} +
+
+ {% if assignment.applications|length %} + {% 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' %} + {% elseif assignment.dispositions|length %} + {% set icon = 'check' %} + {% set class = 'bg-green-100 text-green-700 hover:bg-green-50' %} + {% set url = path('app_teamer_disposition_detail', { 'uuid': assignment.dispositions[0].uuid }) %} + {% set label = 'eingeteilt' %} + {% else %} + {% set icon = 'info' %} + {% set class = 'btn--info' %} + {% set url = path('app_teamer_assignment', { 'uuid': assignment.uuid, 'r': return_url() }) %} + {% set label = 'bewerben' %} + {% endif %} + + {{ icon(icon, 'w-4 h-4') }} + {{ label }} + +
+
+ {% endfor %}
- - Neu - + {{ knp_pagination_render(pagination) }} {% endblock %} \ No newline at end of file