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