fix: only use destination's pickup values
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
import { Controller } from '@hotwired/stimulus'
|
||||||
|
import { useFetch } from '../mixins/use_fetch'
|
||||||
|
|
||||||
|
export default class extends Controller {
|
||||||
|
|
||||||
|
static targets = [ 'form', 'container', 'spinner' ]
|
||||||
|
static values = { url: String, loading: Boolean }
|
||||||
|
|
||||||
|
connect() {
|
||||||
|
useFetch(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
update() {
|
||||||
|
this.loadingValue = true
|
||||||
|
const formData = new FormData(this.formTarget)
|
||||||
|
fetch(this.urlValue, { method: 'POST', body: formData })
|
||||||
|
.then(this.checkStatus)
|
||||||
|
.then(this.parseHTML)
|
||||||
|
.then(response => {
|
||||||
|
this.containerTarget.innerHTML = response
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.loadingValue = false
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
loadingValueChanged(loading) {
|
||||||
|
if (this.hasSpinnerTarget) {
|
||||||
|
this.spinnerTarget.classList.toggle('hidden', false === loading)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,8 +7,23 @@ class Pickup
|
|||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
private ?int $busProId = null;
|
private ?int $busProId = null;
|
||||||
private ?string $code = null;
|
private ?string $code = null;
|
||||||
private ?string $city;
|
private ?string $city = null;
|
||||||
private ?string $street;
|
private ?string $street = null;
|
||||||
|
private ?string $time = null;
|
||||||
|
|
||||||
|
public static function fromArray(array $data): static
|
||||||
|
{
|
||||||
|
$instance = new static();
|
||||||
|
$instance
|
||||||
|
->setId($data['busProId'])
|
||||||
|
->setCode($data['code'] ?? null)
|
||||||
|
->setCity($data['city'])
|
||||||
|
->setStreet($data['street'])
|
||||||
|
->setTime($data['time'])
|
||||||
|
;
|
||||||
|
|
||||||
|
return $instance;
|
||||||
|
}
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
@@ -69,4 +84,16 @@ class Pickup
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getTime(): ?string
|
||||||
|
{
|
||||||
|
return $this->time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setTime(?string $time): static
|
||||||
|
{
|
||||||
|
$this->time = $time;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller\Admin\Assignment;
|
||||||
|
|
||||||
|
use App\Entity\Assignment;
|
||||||
|
use App\Form\AssignmentType;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||||
|
|
||||||
|
class PickupFormController extends AbstractController
|
||||||
|
{
|
||||||
|
#[Route('/admin/assignment/pickup-form', name: 'app_admin_assignment_pickup_form')]
|
||||||
|
#[IsGranted('ROLE_ADMINISTRATIVE')]
|
||||||
|
public function index(Request $request): Response
|
||||||
|
{
|
||||||
|
$assignment = new Assignment();
|
||||||
|
|
||||||
|
$form = $this->createForm(AssignmentType::class, $assignment);
|
||||||
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
return $this->render('admin/assignment/_form_pickup.html.twig', [
|
||||||
|
'form' => $form->createView(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Entity;
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\BusProNet\Model\Pickup;
|
||||||
use App\Entity\Traits\SoftDeletableEntity;
|
use App\Entity\Traits\SoftDeletableEntity;
|
||||||
use App\Entity\Traits\TimestampableEntity;
|
use App\Entity\Traits\TimestampableEntity;
|
||||||
use App\Repository\DestinationRepository;
|
use App\Repository\DestinationRepository;
|
||||||
@@ -171,6 +172,17 @@ class Destination implements TimestampableEntityInterface, SoftDeletableEntityIn
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPickup(int $id): ?Pickup
|
||||||
|
{
|
||||||
|
foreach ($this->getPickups() as $pickup) {
|
||||||
|
if ($id === $pickup['busProId']) {
|
||||||
|
return Pickup::fromArray($pickup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public function hasBusTransfer(): bool
|
public function hasBusTransfer(): bool
|
||||||
{
|
{
|
||||||
return 0 < count($this->getPickups());
|
return 0 < count($this->getPickups());
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf
|
|||||||
private ?Teamer $teamer;
|
private ?Teamer $teamer;
|
||||||
|
|
||||||
#[ORM\Column(nullable: true)]
|
#[ORM\Column(nullable: true)]
|
||||||
private ?int $pickup = null;
|
private ?int $pickup;
|
||||||
|
|
||||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||||
private ?string $remarks;
|
private ?string $remarks;
|
||||||
|
|||||||
@@ -8,18 +8,27 @@ use App\Entity\Fee;
|
|||||||
use App\Entity\JobProfile;
|
use App\Entity\JobProfile;
|
||||||
use App\Entity\Upload;
|
use App\Entity\Upload;
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Component\Form\FormEvent;
|
||||||
|
use Symfony\Component\Form\FormEvents;
|
||||||
|
use Symfony\Component\Form\FormInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
class AssignmentType extends AbstractType
|
class AssignmentType extends AbstractType
|
||||||
{
|
{
|
||||||
|
public function __construct(private readonly EntityManagerInterface $entityManager)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -37,6 +46,7 @@ class AssignmentType extends AbstractType
|
|||||||
'label_property' => 'product',
|
'label_property' => 'product',
|
||||||
'label_function' => fn(Destination $destination) => (string) $destination,
|
'label_function' => fn(Destination $destination) => (string) $destination,
|
||||||
'endpoint_route' => 'app_admin_autocomplete_destination',
|
'endpoint_route' => 'app_admin_autocomplete_destination',
|
||||||
|
'controller_action' => 'select->form-partial#update',
|
||||||
])
|
])
|
||||||
->add('jobProfile', EntityType::class, [
|
->add('jobProfile', EntityType::class, [
|
||||||
'label' => 'Jobprofil',
|
'label' => 'Jobprofil',
|
||||||
@@ -60,11 +70,6 @@ class AssignmentType extends AbstractType
|
|||||||
'label' => 'abweichender Zustieg bei Busbegleitung',
|
'label' => 'abweichender Zustieg bei Busbegleitung',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('pickup', BpnPickupType::class, [
|
|
||||||
'label' => 'Busbegleitung ab',
|
|
||||||
'required' => false,
|
|
||||||
'placeholder' => 'Keine Busbegleitung',
|
|
||||||
])
|
|
||||||
->add('benefits', TextareaType::class, [
|
->add('benefits', TextareaType::class, [
|
||||||
'label' => 'Benefits',
|
'label' => 'Benefits',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
@@ -133,9 +138,62 @@ class AssignmentType extends AbstractType
|
|||||||
'rows' => 3,
|
'rows' => 3,
|
||||||
],
|
],
|
||||||
])
|
])
|
||||||
|
->add('pickup', ChoiceType::class, [
|
||||||
|
'label' => 'Busbegleitung ab',
|
||||||
|
'required' => false,
|
||||||
|
'placeholder' => 'Keine Busbegleitung',
|
||||||
|
])
|
||||||
|
->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
|
||||||
|
$form = $event->getForm();
|
||||||
|
$data = $event->getData();
|
||||||
|
$destination = $data->getDestination();
|
||||||
|
|
||||||
|
if (null === $destination) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->addPickupField($destination, $form);
|
||||||
|
})
|
||||||
|
->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) {
|
||||||
|
$form = $event->getForm();
|
||||||
|
$data = $event->getData();
|
||||||
|
$destinationId = $data['destination'] ?? null;
|
||||||
|
|
||||||
|
if (null === $destinationId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$destination = $this
|
||||||
|
->entityManager
|
||||||
|
->getRepository(Destination::class)
|
||||||
|
->find($destinationId)
|
||||||
|
;
|
||||||
|
|
||||||
|
$this->addPickupField($destination, $form);
|
||||||
|
})
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function addPickupField(Destination $destination, FormInterface $form): void
|
||||||
|
{
|
||||||
|
$choices = [];
|
||||||
|
|
||||||
|
foreach ($destination->getPickups() as $pickup) {
|
||||||
|
$label = sprintf('%s, %s Uhr', trim($pickup['city']), trim($pickup['time']));
|
||||||
|
$choices[$label] = $pickup['busProId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove placeholder field first
|
||||||
|
$form->remove('pickup');
|
||||||
|
|
||||||
|
$form->add('pickup', ChoiceType::class, [
|
||||||
|
'label' => 'Busbegleitung ab',
|
||||||
|
'required' => false,
|
||||||
|
'placeholder' => 'Keine Busbegleitung',
|
||||||
|
'choices' => $choices,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver): void
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class AppRuntime implements RuntimeExtensionInterface
|
|||||||
return 'nationality' === $property ? $country->getNationality() : $country->getName();
|
return 'nationality' === $property ? $country->getNationality() : $country->getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bpnPickupLabel(?int $id): string
|
public function bpnPickupLabel(?int $id): ?string
|
||||||
{
|
{
|
||||||
if (null === $id) {
|
if (null === $id) {
|
||||||
return 'keine Busbegleitung';
|
return 'keine Busbegleitung';
|
||||||
@@ -59,7 +59,7 @@ class AppRuntime implements RuntimeExtensionInterface
|
|||||||
$pickup = $this->pickups->get($id);
|
$pickup = $this->pickups->get($id);
|
||||||
|
|
||||||
if (null === $pickup) {
|
if (null === $pickup) {
|
||||||
return 'unbekannt';
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'ab '.$pickup->getCity();
|
return 'ab '.$pickup->getCity();
|
||||||
|
|||||||
@@ -24,29 +24,28 @@
|
|||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{% if assignment.pickup %}
|
{% if assignment.pickup %}
|
||||||
|
{% set pickup = assignment.destination.pickup(assignment.pickup) %}
|
||||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||||
<dt class="text-sm font-bold leading-6 text-gray-900">
|
<dt class="text-sm font-bold leading-6 text-gray-900">
|
||||||
Busbegleitung
|
Busbegleitung
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
||||||
{{ assignment.pickup|bpn_pickup_label }}
|
ab {{ pickup.city }}, {{ pickup.street }}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{% if assignment.pickupDate %}
|
|
||||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
|
||||||
<dt class="text-sm font-bold leading-6 text-gray-900">
|
|
||||||
Busabfahrt
|
|
||||||
</dt>
|
|
||||||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
|
||||||
{{ assignment.pickupDate|date('d.m.Y') }}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% if application is defined and application.pickup is not null %}
|
|
||||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||||
<dt class="text-sm font-bold leading-6 text-gray-900">
|
<dt class="text-sm font-bold leading-6 text-gray-900">
|
||||||
Gwählter Zustieg
|
Busabfahrt
|
||||||
|
</dt>
|
||||||
|
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
||||||
|
{{ pickup.time }} Uhr
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% if application is defined and application is not null and application.pickup is not null %}
|
||||||
|
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||||
|
<dt class="text-sm font-bold leading-6 text-gray-900">
|
||||||
|
Gewählter Zustieg
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
||||||
{{ application.pickup|bpn_pickup_label }}
|
{{ application.pickup|bpn_pickup_label }}
|
||||||
|
|||||||
@@ -27,24 +27,23 @@
|
|||||||
</dl>
|
</dl>
|
||||||
<dl class="divide-y divide-gray-100">
|
<dl class="divide-y divide-gray-100">
|
||||||
{% if assignment.pickup %}
|
{% if assignment.pickup %}
|
||||||
|
{% set pickup = assignment.destination.pickup(assignment.pickup) %}
|
||||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||||
<dt class="text-sm font-bold leading-6 text-gray-900">
|
<dt class="text-sm font-bold leading-6 text-gray-900">
|
||||||
Busbegleitung
|
Busbegleitung
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
||||||
{{ assignment.pickup|bpn_pickup_label }}
|
{{ pickup.city }}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||||
|
<dt class="text-sm font-bold leading-6 text-gray-900">
|
||||||
|
Busabfahrt
|
||||||
|
</dt>
|
||||||
|
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
||||||
|
{{ pickup.time }} Uhr
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{% if assignment.pickupDate %}
|
|
||||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
|
||||||
<dt class="text-sm font-bold leading-6 text-gray-900">
|
|
||||||
Busabfahrt
|
|
||||||
</dt>
|
|
||||||
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
|
|
||||||
{{ assignment.pickupDate|date('d.m.Y') }}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||||
<dt class="text-sm font-bold leading-6 text-gray-900">
|
<dt class="text-sm font-bold leading-6 text-gray-900">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{% if assignment.pickup %}
|
{% if assignment.pickup %}
|
||||||
<li class="py-2">
|
<li class="py-2">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<span class="flex-1">Busbegleitung {{ assignment.pickup|bpn_pickup_label }} am {{ assignment.effectivePickupDate|date('d.m.Y') }}</span>
|
<span class="flex-1">Busbegleitung ab {{ assignment.destination.pickup(assignment.pickup).city }}</span>
|
||||||
{% if teamer.hasPickup(assignment.pickup) %}
|
{% if teamer.hasPickup(assignment.pickup) %}
|
||||||
{{ icon('check', 'w-5 h-5 text-green-500 shrink-0') }}
|
{{ icon('check', 'w-5 h-5 text-green-500 shrink-0') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
@@ -56,11 +56,16 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
{% if assignment.pickup %}
|
||||||
<span class="whitespace-nowrap">{{ assignment.pickup ? assignment.pickup|bpn_pickup_label : '-' }}</span>
|
{% set pickup = assignment.destination.pickup(assignment.pickup) %}
|
||||||
<br>
|
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
||||||
{{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }}
|
<span class="whitespace-nowrap">ab {{ pickup.city }}</span>
|
||||||
</a>
|
<br>
|
||||||
|
{{ pickup.time }} Uhr
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
-
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
||||||
|
|||||||
@@ -10,63 +10,69 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{{ form_start(form) }}
|
<div {{ stimulus_controller('form-partial', { 'url': path('app_admin_assignment_pickup_form') }) }}>
|
||||||
<div class="flex flex-col space-y-4 pb-8">
|
{{ form_start(form, { 'attr': { 'data-form-partial-target': 'form' } }) }}
|
||||||
<div class="grid lg:grid-cols-6 gap-x-4 gap-y-4">
|
<div class="flex flex-col space-y-4 pb-8">
|
||||||
<div class="lg:col-span-3">
|
<div class="grid lg:grid-cols-6 gap-x-4 gap-y-4">
|
||||||
{{ form_row(form.destination) }}
|
<div class="lg:col-span-3">
|
||||||
</div>
|
{{ form_row(form.destination) }}
|
||||||
{{ form_row(form.availableDispositions) }}
|
|
||||||
<div>
|
|
||||||
<h4 class="font-bold pb-2">
|
|
||||||
{{ form_label(form.showAvailableDispositions) }}
|
|
||||||
</h4>
|
|
||||||
{{ form_widget(form.showAvailableDispositions) }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
|
||||||
{{ form_row(form.dateFrom) }}
|
|
||||||
{{ form_row(form.dateTo) }}
|
|
||||||
</div>
|
|
||||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
|
||||||
{{ form_row(form.jobProfile) }}
|
|
||||||
{{ form_row(form.contact) }}
|
|
||||||
</div>
|
|
||||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
|
||||||
{{ form_row(form.pickup) }}
|
|
||||||
{{ form_row(form.pickupDate) }}
|
|
||||||
</div>
|
|
||||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
|
||||||
{{ form_row(form.benefits) }}
|
|
||||||
{{ form_row(form.fees) }}
|
|
||||||
</div>
|
|
||||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
|
||||||
{{ form_row(form.remarks) }}
|
|
||||||
<div {{ stimulus_controller('form-collection', { 'prototype': _self.collectionRow(form.documents.vars.prototype)|json_encode }) }}>
|
|
||||||
<h4 class="font-bold pb-2">
|
|
||||||
Dokumente
|
|
||||||
</h4>
|
|
||||||
<div {{ stimulus_target('form-collection', 'fields')}} class="flex flex-col space-y-4 mb-4">
|
|
||||||
{% do form.documents.setRendered %}
|
|
||||||
{%- for document in form.documents -%}{{- _self.collectionRow(document) -}}{%- endfor -%}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-end">
|
{{ form_row(form.availableDispositions) }}
|
||||||
<button type="button"
|
<div>
|
||||||
{{ stimulus_action('form-collection', 'addItem') }}
|
<h4 class="font-bold pb-2">
|
||||||
title="Dokument hinzufügen">
|
{{ form_label(form.showAvailableDispositions) }}
|
||||||
{{ icon('plus', 'w-4 h-4 pointer-events-none') }}
|
</h4>
|
||||||
</button>
|
{{ form_widget(form.showAvailableDispositions) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
||||||
|
{{ form_row(form.dateFrom) }}
|
||||||
|
{{ form_row(form.dateTo) }}
|
||||||
|
</div>
|
||||||
|
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
||||||
|
{{ form_row(form.jobProfile) }}
|
||||||
|
{{ form_row(form.contact) }}
|
||||||
|
</div>
|
||||||
|
<div class="relative">
|
||||||
|
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4" {{ stimulus_target('form-partial', 'container') }}>
|
||||||
|
{% include 'admin/assignment/_form_pickup.html.twig' %}
|
||||||
|
</div>
|
||||||
|
<div class="absolute top-0 left-0 inset-0 bg-white/90 flex items-center justify-center" {{ stimulus_target('form-partial', 'spinner') }}>
|
||||||
|
{% include '_partials/_spinner.html.twig' with { 'class': 'w-8 h-8'} %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
||||||
|
{{ form_row(form.benefits) }}
|
||||||
|
{{ form_row(form.fees) }}
|
||||||
|
</div>
|
||||||
|
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
||||||
|
{{ form_row(form.remarks) }}
|
||||||
|
<div {{ stimulus_controller('form-collection', { 'prototype': _self.collectionRow(form.documents.vars.prototype)|json_encode }) }}>
|
||||||
|
<h4 class="font-bold pb-2">
|
||||||
|
Dokumente
|
||||||
|
</h4>
|
||||||
|
<div {{ stimulus_target('form-collection', 'fields')}} class="flex flex-col space-y-4 mb-4">
|
||||||
|
{% do form.documents.setRendered %}
|
||||||
|
{%- for document in form.documents -%}{{- _self.collectionRow(document) -}}{%- endfor -%}
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-end">
|
||||||
|
<button type="button"
|
||||||
|
{{ stimulus_action('form-collection', 'addItem') }}
|
||||||
|
title="Dokument hinzufügen">
|
||||||
|
{{ icon('plus', 'w-4 h-4 pointer-events-none') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="flex items-center space-x-2">
|
||||||
<div class="flex items-center space-x-2">
|
<button type="submit" class="btn">
|
||||||
<button type="submit" class="btn">
|
Speichern
|
||||||
Speichern
|
</button>
|
||||||
</button>
|
<a href="{{ path('app_admin_assignment_index') }}" class="btn btn--secondary">
|
||||||
<a href="{{ path('app_admin_assignment_index') }}" class="btn btn--secondary">
|
Abbrechen
|
||||||
Abbrechen
|
</a>
|
||||||
</a>
|
</div>
|
||||||
</div>
|
{{ form_rest(form) }}
|
||||||
{{ form_rest(form) }}
|
{{ form_end(form) }}
|
||||||
{{ form_end(form) }}
|
</div>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
{{ form_row(form.pickup) }}
|
||||||
|
{{ form_row(form.pickupDate) }}
|
||||||
@@ -82,11 +82,16 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
{% if assignment.pickup %}
|
||||||
<span class="whitespace-nowrap">{{ assignment.pickup ? assignment.pickup|bpn_pickup_label : '-' }}</span>
|
{% set pickup = assignment.destination.pickup(assignment.pickup) %}
|
||||||
<br>
|
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
||||||
{{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }}
|
<span class="whitespace-nowrap">ab {{ pickup.city }}</span>
|
||||||
</a>
|
<br>
|
||||||
|
{{ pickup.time }} Uhr
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
-
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}" class="flex items-center space-x-2">
|
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}" class="flex items-center space-x-2">
|
||||||
|
|||||||
@@ -28,9 +28,10 @@
|
|||||||
<span class="flex-1">{{ assignment.destination.hotel }}</span>
|
<span class="flex-1">{{ assignment.destination.hotel }}</span>
|
||||||
</div>
|
</div>
|
||||||
{% if assignment.pickup %}
|
{% if assignment.pickup %}
|
||||||
|
{% set pickup = assignment.destination.pickup(assignment.pickup) %}
|
||||||
<div class="flex items-start space-x-2">
|
<div class="flex items-start space-x-2">
|
||||||
{{ icon('bus', 'w-5 h-5 shrink-0') }}
|
{{ icon('bus', 'w-5 h-5 shrink-0') }}
|
||||||
<span>{{ assignment.pickup|bpn_pickup_label|default('-') }} {{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }}</span>
|
<span>{{ pickup.city }}, {{ pickup.time }} Uhr</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -54,9 +54,10 @@
|
|||||||
<span class="flex-1">{{ assignment.destination.hotel }}</span>
|
<span class="flex-1">{{ assignment.destination.hotel }}</span>
|
||||||
</div>
|
</div>
|
||||||
{% if assignment.pickup %}
|
{% if assignment.pickup %}
|
||||||
|
{% set pickup = assignment.destination.pickup(assignment.pickup) %}
|
||||||
<div class="flex items-start space-x-2">
|
<div class="flex items-start space-x-2">
|
||||||
{{ icon('bus', 'w-5 h-5 shrink-0') }}
|
{{ icon('bus', 'w-5 h-5 shrink-0') }}
|
||||||
<span>{{ assignment.pickup|bpn_pickup_label|default('-') }} {{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }}</span>
|
<span>{{ pickup.city }}, {{ pickup.time }} Uhr</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -27,9 +27,10 @@
|
|||||||
<span class="flex-1">{{ assignment.destination.hotel }}</span>
|
<span class="flex-1">{{ assignment.destination.hotel }}</span>
|
||||||
</div>
|
</div>
|
||||||
{% if assignment.pickup %}
|
{% if assignment.pickup %}
|
||||||
|
{% set pickup = assignment.destination.pickup(assignment.pickup) %}
|
||||||
<div class="flex items-start space-x-2">
|
<div class="flex items-start space-x-2">
|
||||||
{{ icon('bus', 'w-5 h-5 shrink-0') }}
|
{{ icon('bus', 'w-5 h-5 shrink-0') }}
|
||||||
<span>{{ assignment.pickup|bpn_pickup_label|default('-') }} {{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }}</span>
|
<span>{{ pickup.city }}, {{ pickup.time }} Uhr</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,9 +20,10 @@
|
|||||||
<span class="flex-1">{{ assignment.destination.hotel }}</span>
|
<span class="flex-1">{{ assignment.destination.hotel }}</span>
|
||||||
</div>
|
</div>
|
||||||
{% if assignment.pickup %}
|
{% if assignment.pickup %}
|
||||||
|
{% set pickup = assignment.destination.pickup(assignment.pickup) %}
|
||||||
<div class="flex items-start space-x-2">
|
<div class="flex items-start space-x-2">
|
||||||
{{ icon('bus', 'w-5 h-5 shrink-0') }}
|
{{ icon('bus', 'w-5 h-5 shrink-0') }}
|
||||||
<span>{{ assignment.pickup|bpn_pickup_label|default('-') }} {{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }}</span>
|
<span>{{ pickup.city }}, {{ pickup.time }} Uhr</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user