fix: assign correct status colors, link items in timeline
This commit is contained in:
+25
-15
@@ -10,7 +10,8 @@ class TimelineItem
|
|||||||
public const TYPE_ASSIGNMENT = 'assignment';
|
public const TYPE_ASSIGNMENT = 'assignment';
|
||||||
public const TYPE_DISPOSITION = 'disposition';
|
public const TYPE_DISPOSITION = 'disposition';
|
||||||
|
|
||||||
private ?int $dispositionId = null;
|
private ?string $assignmentUuid = null;
|
||||||
|
private ?string $dispositionUuid = null;
|
||||||
private ?\DateTimeImmutable $dateFrom = null;
|
private ?\DateTimeImmutable $dateFrom = null;
|
||||||
private ?\DateTimeImmutable $dateTo = null;
|
private ?\DateTimeImmutable $dateTo = null;
|
||||||
private ?string $status = null;
|
private ?string $status = null;
|
||||||
@@ -19,7 +20,7 @@ class TimelineItem
|
|||||||
private ?string $teamerName = null;
|
private ?string $teamerName = null;
|
||||||
private ?string $teamerUuid = null;
|
private ?string $teamerUuid = null;
|
||||||
|
|
||||||
public function __construct(private readonly int $assignmentId, private readonly string $type)
|
public function __construct(private readonly string $type)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,12 +29,13 @@ class TimelineItem
|
|||||||
$dateFrom = $assignment->getDestination()->getDateFrom();
|
$dateFrom = $assignment->getDestination()->getDateFrom();
|
||||||
$dateTo = $assignment->getDestination()->getDateTo();
|
$dateTo = $assignment->getDestination()->getDateTo();
|
||||||
|
|
||||||
return (new static($assignment->getId(), static::TYPE_ASSIGNMENT))
|
return (new static(static::TYPE_ASSIGNMENT))
|
||||||
|
->setAssignmentUuid($assignment->getUuid())
|
||||||
->setDateFrom($dateFrom)
|
->setDateFrom($dateFrom)
|
||||||
->setDateTo($dateTo)
|
->setDateTo($dateTo)
|
||||||
->setJobProfile($assignment->getJobProfile()->getName())
|
->setJobProfile($assignment->getJobProfile()->getName())
|
||||||
->setDateRange(sprintf('%s - %s', $dateFrom->format('d.m.Y'), $dateTo->format('d.m.Y')))
|
->setDateRange(sprintf('%s - %s', $dateFrom->format('d.m.Y'), $dateTo->format('d.m.Y')))
|
||||||
->setStatus($assignment->getStatus());
|
->setStatus($assignment->getStatus())
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,8 +46,9 @@ class TimelineItem
|
|||||||
$dateFrom = $assignment->getDestination()->getDateFrom();
|
$dateFrom = $assignment->getDestination()->getDateFrom();
|
||||||
$dateTo = $assignment->getDestination()->getDateTo();
|
$dateTo = $assignment->getDestination()->getDateTo();
|
||||||
|
|
||||||
return (new static($assignment->getId(), static::TYPE_DISPOSITION))
|
return (new static(static::TYPE_DISPOSITION))
|
||||||
->setDispositionId($disposition->getId())
|
->setAssignmentUuid($assignment->getUuid())
|
||||||
|
->setDispositionUuid($disposition->getUuid())
|
||||||
->setDateFrom($dateFrom)
|
->setDateFrom($dateFrom)
|
||||||
->setDateTo($dateTo)
|
->setDateTo($dateTo)
|
||||||
->setJobProfile($assignment->getJobProfile()->getName())
|
->setJobProfile($assignment->getJobProfile()->getName())
|
||||||
@@ -56,24 +59,31 @@ class TimelineItem
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAssignmentId(): int
|
|
||||||
{
|
|
||||||
return $this->assignmentId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getType(): ?string
|
public function getType(): ?string
|
||||||
{
|
{
|
||||||
return $this->type;
|
return $this->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDispositionId(): ?int
|
public function getAssignmentUuid(): ?string
|
||||||
{
|
{
|
||||||
return $this->dispositionId;
|
return $this->assignmentUuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDispositionId(?int $dispositionId): static
|
public function setAssignmentUuid(?string $assignmentUuid): static
|
||||||
{
|
{
|
||||||
$this->dispositionId = $dispositionId;
|
$this->assignmentUuid = $assignmentUuid;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDispositionUuid(): ?string
|
||||||
|
{
|
||||||
|
return $this->dispositionUuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDispositionUuid(?string $dispositionUuid): static
|
||||||
|
{
|
||||||
|
$this->dispositionUuid = $dispositionUuid;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,22 +5,29 @@
|
|||||||
{% macro cell(item, colspan) %}
|
{% macro cell(item, colspan) %}
|
||||||
<td class="{{ html_classes('border border-gray-700', {
|
<td class="{{ html_classes('border border-gray-700', {
|
||||||
'bg-gray-100': item.type == 'assignment',
|
'bg-gray-100': item.type == 'assignment',
|
||||||
'bg-blue-500 text-gray-50': item.type == 'disposition' and item.status != 'confirmed',
|
'bg-blue-500 text-gray-50': item.type == 'disposition' and item.status in ['new', 'checking_contract'],
|
||||||
'bg-green-500 text-gray-50': item.type == 'disposition' and (item.status == 'confirmed' or item.status == 'ended' or item.status == 'completed'),
|
'bg-green-500 text-gray-50': item.type == 'disposition' and item.status in ['confirmed', 'ended', 'checking_invoice', 'completed'],
|
||||||
}) }}" colspan="{{ colspan }}">
|
}) }}" colspan="{{ colspan }}">
|
||||||
{% if item.type == 'disposition' %}
|
{% if item.type == 'disposition' %}
|
||||||
<button type="button"
|
<div class="flex items-center space-x-2">
|
||||||
class="flex items-center space-x-2"
|
<a href="{{ path('app_administrative_assignment_detail', { 'uuid': item.assignmentUuid, 'r': return_url() }) }}"
|
||||||
title="Teamer:inneninfo {{ item.teamerName }}"
|
class="inline-block text-xs font-semibold">
|
||||||
hx-get="{{ path('app_administrative_teamer_info', { 'uuid': item.teamerUuid }) }}"
|
{{ item.jobProfile }}
|
||||||
hx-target="body"
|
</a>
|
||||||
hx-swap="beforeend">
|
<button type="button"
|
||||||
<span class="text-xs font-semibold">{{ item.jobProfile }}</span>
|
class="flex items-center space-x-2"
|
||||||
<span class="text-xs">{{ item.teamerName | raw }}</span>
|
title="Teamer:inneninfo {{ item.teamerName }}"
|
||||||
{{ icon('info', 'w-4 h-4') }}
|
hx-get="{{ path('app_administrative_teamer_info', { 'uuid': item.teamerUuid }) }}"
|
||||||
</button>
|
hx-target="body"
|
||||||
|
hx-swap="beforeend">
|
||||||
|
<span class="text-xs font-semibold">{{ item.teamerName | raw }}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="text-xs font-semibold">{{ item.jobProfile }}</span>
|
<a href="{{ path('app_administrative_assignment_edit', { 'uuid': item.assignmentUuid, 'r': return_url() }) }}"
|
||||||
|
class="text-xs font-semibold">
|
||||||
|
{{ item.jobProfile }}
|
||||||
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|||||||
Reference in New Issue
Block a user