WIP: Improve assignment information display
This commit is contained in:
@@ -117,4 +117,30 @@ class Application implements TimestampableEntityInterface
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function matchesPickup(): bool
|
||||||
|
{
|
||||||
|
if (0 === $pickupId = (int) $this->getAssignment()->getPickup()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$teamer = $this->getTeamer();
|
||||||
|
|
||||||
|
return $teamer->hasPickup($pickupId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCompletedTrainingsCount(): int
|
||||||
|
{
|
||||||
|
$count = 0;
|
||||||
|
$requiredTrainings = $this->getAssignment()->getJobProfile()->getRequiredTrainings();
|
||||||
|
$teamer = $this->getTeamer();
|
||||||
|
|
||||||
|
foreach ($requiredTrainings as $requiredTraining) {
|
||||||
|
if ($teamer->getTrainingAttendance($requiredTraining)) {
|
||||||
|
++$count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTotalPeriod(): ?CarbonPeriod
|
public function getEffectivePeriod(): ?CarbonPeriod
|
||||||
{
|
{
|
||||||
if (null !== $destination = $this->getDestination()) {
|
if (null !== $destination = $this->getDestination()) {
|
||||||
$dateFrom = $this->getDateFrom() ?? $destination->getDateFrom();
|
$dateFrom = $this->getDateFrom() ?? $destination->getDateFrom();
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class DispositionWorkflowGuardSubscriber implements EventSubscriberInterface
|
|||||||
/** @var Disposition $disposition */
|
/** @var Disposition $disposition */
|
||||||
$disposition = $event->getSubject();
|
$disposition = $event->getSubject();
|
||||||
$assignment = $disposition->getAssignment();
|
$assignment = $disposition->getAssignment();
|
||||||
$assignmentPeriod = $assignment->getTotalPeriod();
|
$assignmentPeriod = $assignment->getEffectivePeriod();
|
||||||
$today = new \DateTimeImmutable();
|
$today = new \DateTimeImmutable();
|
||||||
|
|
||||||
$dueDateFrom = $disposition->getCreatedAt()->modify('+ 7days');
|
$dueDateFrom = $disposition->getCreatedAt()->modify('+ 7days');
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ class ContractRenderer extends AbstractPdfRenderer
|
|||||||
$pdf->Text(21,104.5, utf8_decode($assignment->getJobProfile()->getName()));
|
$pdf->Text(21,104.5, utf8_decode($assignment->getJobProfile()->getName()));
|
||||||
|
|
||||||
// Period
|
// Period
|
||||||
$dateFrom = $assignment->getTotalPeriod()->start->format('d.m.Y');
|
$dateFrom = $assignment->getEffectivePeriod()->start->format('d.m.Y');
|
||||||
$dateTo = $assignment->getTotalPeriod()->end->format('d.m.Y');
|
$dateTo = $assignment->getEffectivePeriod()->end->format('d.m.Y');
|
||||||
$period = sprintf('%s - %s', $dateFrom, $dateTo);
|
$period = sprintf('%s - %s', $dateFrom, $dateTo);
|
||||||
$pdf->Text(57,113, $period);
|
$pdf->Text(57,113, $period);
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class InvoiceRenderer extends AbstractPdfRenderer
|
|||||||
|
|
||||||
// Invoice number
|
// Invoice number
|
||||||
$pdf->SetFont('Arial', '', 12);
|
$pdf->SetFont('Arial', '', 12);
|
||||||
$number = $assignment->getTotalPeriod()->start->format('d/m/Y');
|
$number = $assignment->getEffectivePeriod()->start->format('d/m/Y');
|
||||||
$pdf->Text(85,116, $number);
|
$pdf->Text(85,116, $number);
|
||||||
|
|
||||||
$pdf->SetFont('Arial', '', 10);
|
$pdf->SetFont('Arial', '', 10);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class AppRuntime implements RuntimeExtensionInterface
|
|||||||
return 'unbekannt';
|
return 'unbekannt';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $pickup->getCity();
|
return 'ab '.$pickup->getCity();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fileIconFilter(Environment $environment, string $mimeType, ?string $classes = 'w-4 h-4'): string
|
public function fileIconFilter(Environment $environment, string $mimeType, ?string $classes = 'w-4 h-4'): string
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
Einsatztermin
|
Einsatztermin
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{ assignment.totalPeriod.start|date('d.m.Y') }} - {{ assignment.totalPeriod.end|date('d.m.Y') }}
|
{{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }}
|
||||||
</div>
|
</div>
|
||||||
{% if assignment.pickup and assignment.pickupDate %}
|
{% if assignment.pickup and assignment.pickupDate %}
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
Einsatztermin
|
Einsatztermin
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{ assignment.totalPeriod.start|date('d.m.Y') }} - {{ assignment.totalPeriod.end|date('d.m.Y') }}
|
{{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-2 gap-x-4 gap-y-3">
|
<div class="grid grid-cols-2 gap-x-4 gap-y-3">
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<ul class="list-disc pl-4 pb-4">
|
<ul class="list-disc pl-4 pb-4">
|
||||||
{% if assignment.pickup and assignment.pickupDate %}
|
{% if assignment.pickup and assignment.effectivePickupDate %}
|
||||||
<li>
|
<li>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<span>Busbegleitung ab {{ assignment.pickup|bpn_pickup_label }} am {{ assignment.pickupDate|date('d.m.Y') }}</span>
|
<span>Busbegleitung ab {{ assignment.pickup|bpn_pickup_label }} am {{ assignment.effectivePickupDate|date('d.m.Y') }}</span>
|
||||||
{% if teamer.hasPickup(assignment.pickup) %}
|
{% if teamer.hasPickup(assignment.pickup) %}
|
||||||
{{ icon('check', 'w-5 h-5 text-emerald-500') }}
|
{{ icon('check', 'w-5 h-5 text-emerald-500') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
@@ -12,10 +12,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
{{ knp_pagination_sortable(pagination, 'Einsatzbeginn', 'destination.dateFrom') }}
|
{{ knp_pagination_sortable(pagination, 'Einsatz­zeitraum', 'destination.dateFrom') }}
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
{{ knp_pagination_sortable(pagination, 'Einsatzende', 'destination.dateTo') }}
|
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'job_profile.name') }}
|
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'job_profile.name') }}
|
||||||
@@ -24,7 +21,7 @@
|
|||||||
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.product') }}
|
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.product') }}
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
{{ knp_pagination_sortable(pagination, 'Busbegleitung ab', 'destination.pickup') }}
|
{{ knp_pagination_sortable(pagination, 'Bus', 'destination.pickup') }}
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
{{ knp_pagination_sortable(pagination, 'Bewerber*in', 'teamer.lastName') }}
|
{{ knp_pagination_sortable(pagination, 'Bewerber*in', 'teamer.lastName') }}
|
||||||
@@ -37,34 +34,54 @@
|
|||||||
{% set assignment = application.assignment %}
|
{% set assignment = application.assignment %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{{ assignment.destination.dateFrom|date('d.m.Y') }}
|
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid }) }}">
|
||||||
</td>
|
{{ assignment.effectivePeriod.start|date('d.m.Y') }} -
|
||||||
<td>
|
{{ assignment.effectivePeriod.end|date('d.m.Y') }}
|
||||||
{{ assignment.destination.dateTo|date('d.m.Y') }}
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid }) }}">
|
||||||
{{ assignment.jobProfile.name }}
|
{{ assignment.jobProfile.name }}
|
||||||
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid }) }}">
|
||||||
{{ assignment.destination.product }}
|
{{ assignment.destination.product }}
|
||||||
<br>
|
<br>
|
||||||
{{ assignment.destination.hotel }}
|
{{ assignment.destination.hotel }}
|
||||||
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid }) }}">
|
||||||
{{ assignment.pickup ? assignment.pickup|bpn_pickup_label : '-' }}
|
{{ assignment.pickup ? assignment.pickup|bpn_pickup_label : '-' }}
|
||||||
|
<br>
|
||||||
|
{{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }}
|
||||||
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid }) }}">
|
||||||
{{ application.teamer }}
|
{{ application.teamer }}
|
||||||
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button type="button" class="btn">
|
<div class="flex items-center justify-end space-x-1">
|
||||||
Welche Funktion?
|
{% if assignment.pickup %}
|
||||||
</button>
|
{% if application.matchesPickup %}
|
||||||
|
{{ icon('bus', 'w-5 h-5 text-green-500 shrink-0') }}
|
||||||
|
{% else %}
|
||||||
|
{{ icon('bus', 'w-5 h-5 text-red-500 shrink-0') }}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% set requiredTrainingsCount = assignment.jobProfile.requiredTrainings|length %}
|
||||||
|
{% if requiredTrainingsCount > 0 %}
|
||||||
|
<span>{{ application.completedTrainingsCount }}/{{ requiredTrainingsCount }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7">
|
<td colspan="6">
|
||||||
Keine Daten...
|
Keine Daten...
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
'title': 'Bewerbungsstatus bearbeiten',
|
'title': 'Bewerbungsstatus bearbeiten',
|
||||||
'url': path('app_admin_application_status', { 'uuid': application.uuid })
|
'url': path('app_admin_application_status', { 'uuid': application.uuid })
|
||||||
}) }}>
|
}) }}>
|
||||||
Status ändern
|
Status
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if is_granted('DELETE', application) %}
|
{% if is_granted('DELETE', application) %}
|
||||||
|
|||||||
@@ -12,10 +12,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
{{ knp_pagination_sortable(pagination, 'Einsatz­beginn', 'assignment.dateFrom') }}
|
{{ knp_pagination_sortable(pagination, 'Einsatz­zeitraum', 'assignment.dateFrom') }}
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
{{ knp_pagination_sortable(pagination, 'Einsatz­ende', 'assignment.dateTo') }}
|
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }}
|
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }}
|
||||||
@@ -36,15 +33,10 @@
|
|||||||
{% for assignment in pagination %}
|
{% for assignment in pagination %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{% set dateFrom = assignment.dateFrom ? assignment.dateFrom : assignment.destination.dateFrom %}
|
|
||||||
<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() }) }}">
|
||||||
{{ dateFrom|date('d.m.Y') }}
|
{{ assignment.effectivePeriod.start|date('d.m.Y') }} -
|
||||||
</a>
|
<br>
|
||||||
</td>
|
{{ assignment.effectivePeriod.end|date('d.m.Y') }}
|
||||||
<td>
|
|
||||||
{% set dateTo = assignment.dateTo ? assignment.dateTo : assignment.destination.dateTo %}
|
|
||||||
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
|
||||||
{{ dateTo|date('d.m.Y') }}
|
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -72,7 +72,6 @@
|
|||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{{ path('app_common_download', { 'uuid': upload.uuid }) }}"
|
<a href="{{ path('app_common_download', { 'uuid': upload.uuid }) }}"
|
||||||
target="_blank"
|
|
||||||
title="Download">
|
title="Download">
|
||||||
{{ icon('download') }}
|
{{ icon('download') }}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -23,10 +23,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
{{ knp_pagination_sortable(pagination, 'Einsatz­beginn', 'assignment.dateFrom') }}
|
{{ knp_pagination_sortable(pagination, 'Einsatz­zeitraum', 'assignment.dateFrom') }}
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
{{ knp_pagination_sortable(pagination, 'Einsatz­ende', 'assignment.dateTo') }}
|
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }}
|
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }}
|
||||||
@@ -35,7 +32,7 @@
|
|||||||
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.dateFrom') }}
|
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.dateFrom') }}
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
{{ knp_pagination_sortable(pagination, 'Busbegleitung ab', 'assignment.pickup') }}
|
{{ knp_pagination_sortable(pagination, 'Bus', 'assignment.pickup') }}
|
||||||
</th>
|
</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -44,12 +41,9 @@
|
|||||||
{% for assignment in pagination %}
|
{% for assignment in pagination %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{% set dateFrom = assignment.dateFrom ? assignment.dateFrom : assignment.destination.dateFrom %}
|
{{ assignment.effectivePeriod.start|date('d.m.Y') }} -
|
||||||
{{ dateFrom|date('d.m.Y') }}
|
<br>
|
||||||
</td>
|
{{ assignment.effectivePeriod.end|date('d.m.Y') }}
|
||||||
<td>
|
|
||||||
{% set dateTo = assignment.dateTo ? assignment.dateTo : assignment.destination.dateTo %}
|
|
||||||
{{ dateTo|date('d.m.Y') }}
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ assignment.jobProfile.name }}
|
{{ assignment.jobProfile.name }}
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ label:
|
|||||||
disposition:
|
disposition:
|
||||||
status:
|
status:
|
||||||
new: neu
|
new: neu
|
||||||
pending: in Prüfung
|
checking_contract: in Bearbeitung
|
||||||
|
checking_invoice: in Bearbeitung
|
||||||
confirmed: bestätigt
|
confirmed: bestätigt
|
||||||
document:
|
document:
|
||||||
type:
|
type:
|
||||||
|
|||||||
Reference in New Issue
Block a user