feat: show due documents on teamer dashboard
This commit is contained in:
@@ -45,6 +45,12 @@ class IndexController extends AbstractController
|
|||||||
->getPendingForTeamer($teamer)
|
->getPendingForTeamer($teamer)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
$currentDispositions = $this
|
||||||
|
->entityManager
|
||||||
|
->getRepository(Disposition::class)
|
||||||
|
->findCurrentDispositionsByTeamer($teamer)
|
||||||
|
;
|
||||||
|
|
||||||
$upcomingDispositions = $this
|
$upcomingDispositions = $this
|
||||||
->entityManager
|
->entityManager
|
||||||
->getRepository(Disposition::class)
|
->getRepository(Disposition::class)
|
||||||
@@ -55,6 +61,7 @@ class IndexController extends AbstractController
|
|||||||
'matchingAssignments' => $matchingAssignments,
|
'matchingAssignments' => $matchingAssignments,
|
||||||
'recentFeedback' => $recentFeedback,
|
'recentFeedback' => $recentFeedback,
|
||||||
'pendingApplications' => $pendingApplications,
|
'pendingApplications' => $pendingApplications,
|
||||||
|
'currentDispositions' => $currentDispositions,
|
||||||
'upcomingDispositions' => $upcomingDispositions,
|
'upcomingDispositions' => $upcomingDispositions,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ use App\Entity\Traits\BlameableEntity;
|
|||||||
use App\Entity\Traits\SoftDeletableEntity;
|
use App\Entity\Traits\SoftDeletableEntity;
|
||||||
use App\Entity\Traits\TimestampableEntity;
|
use App\Entity\Traits\TimestampableEntity;
|
||||||
use App\Repository\DispositionRepository;
|
use App\Repository\DispositionRepository;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Carbon\CarbonPeriod;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\DBAL\Types\Types;
|
use Doctrine\DBAL\Types\Types;
|
||||||
@@ -187,4 +189,34 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isContractDue(): bool
|
||||||
|
{
|
||||||
|
if (null !== $this->getDocumentByType(Upload::TYPE_CONTRACT)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$assignment = $this->getAssignment();
|
||||||
|
$assignmentPeriod = $assignment->getEffectivePeriod();
|
||||||
|
$dueDateFrom = $this->getCreatedAt()->modify('+ 7days');
|
||||||
|
$dueDateTo = $assignmentPeriod->end->modify('-1 day');
|
||||||
|
|
||||||
|
$period = CarbonPeriod::create($dueDateFrom, $dueDateTo);
|
||||||
|
|
||||||
|
return $period->isStarted();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isInvoiceDue(): bool
|
||||||
|
{
|
||||||
|
if (null !== $this->getDocumentByType(Upload::TYPE_INVOICE)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$assignment = $this->getAssignment();
|
||||||
|
$assignmentPeriod = $assignment->getEffectivePeriod();
|
||||||
|
|
||||||
|
$period = CarbonPeriod::create($assignmentPeriod->getEndDate(), $assignmentPeriod->getEndDate()->modify('+14 days'));
|
||||||
|
|
||||||
|
return $period->isStarted();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,6 +124,29 @@ class DispositionRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function findCurrentDispositionsByTeamer(Teamer $teamer): array
|
||||||
|
{
|
||||||
|
$qb = $this->createQueryBuilder('disposition');
|
||||||
|
|
||||||
|
return $qb
|
||||||
|
->select('disposition', 'assignment', 'destination')
|
||||||
|
->innerJoin('disposition.assignment', 'assignment')
|
||||||
|
->innerJoin('assignment.destination', 'destination')
|
||||||
|
->where($qb->expr()->andX(
|
||||||
|
$qb->expr()->eq('disposition.teamer', ':teamer'),
|
||||||
|
$qb->expr()->in('disposition.status', ':status')
|
||||||
|
))
|
||||||
|
->setParameter('teamer', $teamer)
|
||||||
|
->setParameter('status', [
|
||||||
|
Disposition::STATUS_NEW,
|
||||||
|
Disposition::STATUS_CONFIRMED,
|
||||||
|
])
|
||||||
|
->orderBy('destination.dateFrom', 'ASC')
|
||||||
|
->getQuery()
|
||||||
|
->getResult()
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
public function findNewDispositionsByHotelBusProIds(array $hotelBusProIds): array
|
public function findNewDispositionsByHotelBusProIds(array $hotelBusProIds): array
|
||||||
{
|
{
|
||||||
$qb = $this->createQueryBuilder('disposition');
|
$qb = $this->createQueryBuilder('disposition');
|
||||||
|
|||||||
@@ -15,15 +15,18 @@
|
|||||||
{% for application in applications %}
|
{% for application in applications %}
|
||||||
{% set assignment = application.assignment %}
|
{% set assignment = application.assignment %}
|
||||||
<li class="py-2 first:pt-0 last:pb-0">
|
<li class="py-2 first:pt-0 last:pb-0">
|
||||||
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}" class="flex items-center space-x-1 truncate">
|
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
||||||
{{ icon('hand', 'w-4 h-4 shrink-0') }}
|
<div class="flex items-center space-x-1">
|
||||||
<span class="whitespace-nowrap">{{ application.teamer.fullName(true) }}</span>
|
{{ icon('hand', 'w-4 h-4 shrink-0') }}
|
||||||
{% include '_partials/_dot.html.twig' %}
|
<div class="flex items-center space-x-1 truncate">
|
||||||
<span class="whitespace-nowrap">{{ assignment.effectivePeriod.start|date('d.m.y') }} - {{ assignment.effectivePeriod.end|date('d.m.y') }}</span>
|
<span class="whitespace-nowrap">{{ application.teamer.fullName(true) }}</span>
|
||||||
{% include '_partials/_dot.html.twig' %}
|
{% include '_partials/_dot.html.twig' %}
|
||||||
<span class="whitespace-nowrap">{{ assignment.destination.hotel }}</span>
|
<span class="whitespace-nowrap">{{ assignment.effectivePeriod.start|date('d.m.y') }} - {{ assignment.effectivePeriod.end|date('d.m.y') }}</span>
|
||||||
{% include '_partials/_dot.html.twig' %}
|
{% include '_partials/_dot.html.twig' %}
|
||||||
<span class="whitespace-nowrap">{{ assignment.jobProfile.name }}</span>
|
<span class="whitespace-nowrap">{{ assignment.destination.hotel }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pl-5 whitespace-nowrap">{{ assignment.jobProfile.name }}</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -71,13 +74,16 @@
|
|||||||
<ul class="divide-y divide-gray-200">
|
<ul class="divide-y divide-gray-200">
|
||||||
{% for assignment in assignments %}
|
{% for assignment in assignments %}
|
||||||
<li class="py-2 first:pt-0 last:pb-0">
|
<li class="py-2 first:pt-0 last:pb-0">
|
||||||
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}" class="flex items-center space-x-1 truncate">
|
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
||||||
{{ icon('calendar', 'w-4 h-4 shrink-0') }}
|
<div class="flex items-center space-x-1">
|
||||||
<span class="whitespace-nowrap">{{ assignment.effectivePeriod.start|date('d.m.y') }} - {{ assignment.effectivePeriod.end|date('d.m.y') }}</span>
|
{{ icon('calendar', 'w-4 h-4 shrink-0') }}
|
||||||
{% include '_partials/_dot.html.twig' %}
|
<div class="flex items-center space-x-1 truncate">
|
||||||
<span class="whitespace-nowrap">{{ assignment.jobProfile.name }}</span>
|
<span class="whitespace-nowrap">{{ assignment.effectivePeriod.start|date('d.m.y') }} - {{ assignment.effectivePeriod.end|date('d.m.y') }}</span>
|
||||||
{% include '_partials/_dot.html.twig' %}
|
{% include '_partials/_dot.html.twig' %}
|
||||||
<span class="whitespace-nowrap">{{ assignment.owner.fullName(true) }}</span>
|
<span class="whitespace-nowrap">{{ assignment.jobProfile.name }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pl-5 whitespace-nowrap">{{ assignment.owner.fullName(true) }}</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -121,18 +127,20 @@
|
|||||||
{% for feedback in feedbacks %}
|
{% for feedback in feedbacks %}
|
||||||
<li class="py-2 first:pt-0 last:pb-0">
|
<li class="py-2 first:pt-0 last:pb-0">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="flex items-center space-x-1 truncate"
|
|
||||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||||
'title': 'Feedback freigeben',
|
'title': 'Feedback freigeben',
|
||||||
'url': path('app_admin_feedback_approve', { 'uuid': feedback.uuid })
|
'url': path('app_admin_feedback_approve', { 'uuid': feedback.uuid })
|
||||||
}) }}>
|
}) }}>
|
||||||
{{ icon('feedback', 'w-4 h-4 shrink-0') }}
|
<div class="flex items-center space-x-1">
|
||||||
<span class="whitespace-nowrap">{{ feedback.teamer }}</span>
|
{{ icon('feedback', 'w-4 h-4 shrink-0') }}
|
||||||
{% include '_partials/_dot.html.twig' %}
|
<div class="flex items-center space-x-1 truncate">
|
||||||
<span class="whitespace-nowrap">{{ feedback.destinationName }}</span>
|
<span class="whitespace-nowrap">{{ feedback.teamer }}</span>
|
||||||
{% include '_partials/_dot.html.twig' %}
|
{% include '_partials/_dot.html.twig' %}
|
||||||
<span class="whitespace-nowrap">{{ feedback.jobProfileName }}</span>
|
<span class="whitespace-nowrap">{{ feedback.destinationName }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pl-5 whitespace-nowrap">{{ feedback.jobProfileName }}</div>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
@@ -17,13 +17,16 @@
|
|||||||
{% for application in pendingApplications %}
|
{% for application in pendingApplications %}
|
||||||
{% set assignment = application.assignment %}
|
{% set assignment = application.assignment %}
|
||||||
<li class="py-2 first:pt-0 last:pb-0">
|
<li class="py-2 first:pt-0 last:pb-0">
|
||||||
<a href="{{ path('app_teamer_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}" class="flex items-center space-x-1 truncate">
|
<a href="{{ path('app_teamer_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
||||||
{{ icon('hand', 'w-4 h-4 shrink-0') }}
|
<div class="flex items-center space-x-1">
|
||||||
<span class="whitespace-nowrap">{{ assignment.effectivePeriod.start|date('d.m.y') }} - {{ assignment.effectivePeriod.end|date('d.m.y') }}</span>
|
{{ icon('hand', 'w-4 h-4 shrink-0') }}
|
||||||
{% include '_partials/_dot.html.twig' %}
|
<div class="flex items-center space-x-1 truncate">
|
||||||
<span class="whitespace-nowrap">{{ assignment.destination.hotel }}</span>
|
<span class="whitespace-nowrap">{{ assignment.effectivePeriod.start|date('d.m.y') }} - {{ assignment.effectivePeriod.end|date('d.m.y') }}</span>
|
||||||
{% include '_partials/_dot.html.twig' %}
|
{% include '_partials/_dot.html.twig' %}
|
||||||
<span class="whitespace-nowrap">{{ assignment.jobProfile.name }}</span>
|
<span class="whitespace-nowrap">{{ assignment.destination.hotel }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pl-5 whitespace-nowrap">{{ assignment.jobProfile.name }}</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -38,17 +41,23 @@
|
|||||||
Meine Dokumente
|
Meine Dokumente
|
||||||
</h2>
|
</h2>
|
||||||
<ul class="divide-y divide-gray-200">
|
<ul class="divide-y divide-gray-200">
|
||||||
{% for disposition in upcomingDispositions %}
|
{% for disposition in currentDispositions %}
|
||||||
{% for document in disposition.assignment.documents %}
|
{% set assignment = disposition.assignment %}
|
||||||
{% if is_granted('DOWNLOAD', document) %}
|
{% if disposition.contractDue or disposition.invoiceDue %}
|
||||||
<li class="py-2 first:pt-0 last:pb-0">
|
<li class="py-2 first:pt-0 last:pb-0">
|
||||||
<a href="{{ path('app_common_download', { 'uuid': document.uuid }) }}" class="flex items-center space-x-1 truncate" target="_blank">
|
<a href="{{ path('app_teamer_disposition_detail', { 'uuid': disposition.uuid }) }}">
|
||||||
{{ icon('download', 'w-4 h-4 shrink-0') }}
|
<div class="flex items-center space-x-1">
|
||||||
<span class="whitespace-nowrap">{{ document.displayName|default(document.originalFilename) }}</span>
|
{{ icon('alert', 'w-4 h-4 shrink-0') }}
|
||||||
</a>
|
<div class="flex items-center space-x-1 truncate">
|
||||||
</li>
|
<span class="whitespace-nowrap">{{ assignment.effectivePeriod.start|date('d.m.y') }} - {{ assignment.effectivePeriod.end|date('d.m.y') }}</span>
|
||||||
{% endif %}
|
{% include '_partials/_dot.html.twig' %}
|
||||||
{% endfor %}
|
<span class="whitespace-nowrap">{{ assignment.destination.hotel }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pl-5 whitespace-nowrap">{% if disposition.contractDue %}Honorarvertrag{% else %}Honorarnote{% endif %} fällig</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<li class="py-2 first:pt-0 last:pb-0">
|
<li class="py-2 first:pt-0 last:pb-0">
|
||||||
-
|
-
|
||||||
@@ -63,20 +72,23 @@
|
|||||||
<ul class="divide-y divide-gray-200">
|
<ul class="divide-y divide-gray-200">
|
||||||
{% for feedback in recentFeedback %}
|
{% for feedback in recentFeedback %}
|
||||||
<li class="py-2 first:pt-0 last:pb-0">
|
<li class="py-2 first:pt-0 last:pb-0">
|
||||||
<button type="button" class="flex items-center space-x-1 truncate"
|
<button type="button"
|
||||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||||
'title': feedback.destinationName ~ ' ' ~ feedback.assignmentDate|date('m.Y'),
|
'title': feedback.destinationName ~ ' ' ~ feedback.assignmentDate|date('m.Y'),
|
||||||
'url': path('app_teamer_feedback', { 'uuid': feedback.uuid })
|
'url': path('app_teamer_feedback', { 'uuid': feedback.uuid })
|
||||||
}) }}>
|
}) }}>
|
||||||
{{ icon('feedback', 'w-4 h-4 shrink-0') }}
|
<div class="flex items-center space-x-1">
|
||||||
<span class="whitespace-nowrap">{{ feedback.createdAt|date('d.m.y') }}</span>
|
{{ icon('feedback', 'w-4 h-4 shrink-0') }}
|
||||||
{% include '_partials/_dot.html.twig' %}
|
<div class="flex items-center space-x-1 truncate">
|
||||||
<span class="whitespace-nowrap">{{ feedback.author }}</span>
|
<span class="whitespace-nowrap">{{ feedback.createdAt|date('d.m.y') }}</span>
|
||||||
{% include '_partials/_dot.html.twig' %}
|
{% include '_partials/_dot.html.twig' %}
|
||||||
<span class="whitespace-nowrap">{{ feedback.averageRating|format_rating }}</span>
|
<span class="whitespace-nowrap">{{ feedback.author }}</span>
|
||||||
{% include '_partials/_dot.html.twig' %}
|
{% include '_partials/_dot.html.twig' %}
|
||||||
<span>{{ feedback.comment }}</span>
|
<span class="whitespace-nowrap">{{ feedback.averageRating|format_rating }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pl-5">{{ feedback.comment }}</div>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -94,13 +106,16 @@
|
|||||||
{% for disposition in upcomingDispositions %}
|
{% for disposition in upcomingDispositions %}
|
||||||
{% set assignment = disposition.assignment %}
|
{% set assignment = disposition.assignment %}
|
||||||
<li class="py-2 first:pt-0 last:pb-0">
|
<li class="py-2 first:pt-0 last:pb-0">
|
||||||
<a href="{{ path('app_teamer_disposition_detail', { 'uuid': disposition.uuid }) }}" class="flex items-center space-x-1 truncate">
|
<a href="{{ path('app_teamer_disposition_detail', { 'uuid': disposition.uuid }) }}">
|
||||||
{{ icon('hand', 'w-4 h-4 shrink-0') }}
|
<div class="flex items-center space-x-1">
|
||||||
<span class="whitespace-nowrap">{{ assignment.effectivePeriod.start|date('d.m.y') }} - {{ assignment.effectivePeriod.end|date('d.m.y') }}</span>
|
{{ icon('check', 'w-4 h-4 shrink-0') }}
|
||||||
{% include '_partials/_dot.html.twig' %}
|
<div class="flex items-center space-x-1 truncate">
|
||||||
<span class="whitespace-nowrap">{{ assignment.destination.hotel }}</span>
|
<span class="whitespace-nowrap">{{ assignment.effectivePeriod.start|date('d.m.y') }} - {{ assignment.effectivePeriod.end|date('d.m.y') }}</span>
|
||||||
{% include '_partials/_dot.html.twig' %}
|
{% include '_partials/_dot.html.twig' %}
|
||||||
<span class="whitespace-nowrap">{{ assignment.jobProfile.name }}</span>
|
<span class="whitespace-nowrap">{{ assignment.destination.hotel }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pl-5 whitespace-nowrap">{{ assignment.jobProfile.name }}</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -117,13 +132,14 @@
|
|||||||
<ul class="divide-y divide-gray-200">
|
<ul class="divide-y divide-gray-200">
|
||||||
{% for assignment in matchingAssignments %}
|
{% for assignment in matchingAssignments %}
|
||||||
<li class="py-2 first:pt-0 last:pb-0">
|
<li class="py-2 first:pt-0 last:pb-0">
|
||||||
<a href="{{ path('app_teamer_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}" class="flex items-center space-x-1 truncate">
|
<a href="{{ path('app_teamer_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
||||||
{{ icon('calendar', 'w-4 h-4 shrink-0') }}
|
<div class="flex items-center space-x-1 truncate">
|
||||||
<span class="whitespace-nowrap">{{ assignment.effectivePeriod.start|date('d.m.y') }} - {{ assignment.effectivePeriod.end|date('d.m.y') }}</span>
|
{{ icon('calendar', 'w-4 h-4 shrink-0') }}
|
||||||
{% include '_partials/_dot.html.twig' %}
|
<span class="whitespace-nowrap">{{ assignment.effectivePeriod.start|date('d.m.y') }} - {{ assignment.effectivePeriod.end|date('d.m.y') }}</span>
|
||||||
<span class="whitespace-nowrap">{{ assignment.destination.hotel }}</span>
|
{% include '_partials/_dot.html.twig' %}
|
||||||
{% include '_partials/_dot.html.twig' %}
|
<span class="whitespace-nowrap">{{ assignment.destination.hotel }}</span>
|
||||||
<span class="whitespace-nowrap">{{ assignment.jobProfile.name }}</span>
|
</div>
|
||||||
|
<div class="pl-5 whitespace-nowrap">{{ assignment.jobProfile.name }}</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
Reference in New Issue
Block a user