feat: overdue feedbacks on admin dashboard
This commit is contained in:
@@ -45,6 +45,7 @@ class IndexController extends AbstractController
|
|||||||
$dispositionRepository = $this->entityManager->getRepository(Disposition::class);
|
$dispositionRepository = $this->entityManager->getRepository(Disposition::class);
|
||||||
$overdueContracts = $dispositionRepository->findOverdueContracts();
|
$overdueContracts = $dispositionRepository->findOverdueContracts();
|
||||||
$newDispositions = $dispositionRepository->getNew();
|
$newDispositions = $dispositionRepository->getNew();
|
||||||
|
$overdueFeedbacks = $dispositionRepository->findDispositionsWithOverdueFeedback(7);
|
||||||
|
|
||||||
return $this->render('admin/index.html.twig', [
|
return $this->render('admin/index.html.twig', [
|
||||||
'applications' => $applications,
|
'applications' => $applications,
|
||||||
@@ -59,6 +60,7 @@ class IndexController extends AbstractController
|
|||||||
'pendingDocumentsCount' => $pendingDocumentsCount,
|
'pendingDocumentsCount' => $pendingDocumentsCount,
|
||||||
'overdueContracts' => $overdueContracts,
|
'overdueContracts' => $overdueContracts,
|
||||||
'newDispositions' => $newDispositions,
|
'newDispositions' => $newDispositions,
|
||||||
|
'overdueFeedbacks' => $overdueFeedbacks,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,7 +170,7 @@ class DispositionRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDispositionsWithPendingFeedbackQuery(?string $hotelCode = null): Query
|
public function getDispositionsWithPendingFeedbackQuery(?string $hotelCode = null, ?int $offsetDays = null): Query
|
||||||
{
|
{
|
||||||
$qb = $this->createQueryBuilder('disposition');
|
$qb = $this->createQueryBuilder('disposition');
|
||||||
|
|
||||||
@@ -191,9 +191,14 @@ class DispositionRepository extends ServiceEntityRepository
|
|||||||
$qb->expr()->isNull('feedback')
|
$qb->expr()->isNull('feedback')
|
||||||
))
|
))
|
||||||
->setParameter('status', [Assignment::STATUS_CALLED_OFF, Assignment::STATUS_DELETED])
|
->setParameter('status', [Assignment::STATUS_CALLED_OFF, Assignment::STATUS_DELETED])
|
||||||
->setParameter('dateTo', new \DateTimeImmutable())
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
$dateTo = new \DateTimeImmutable();
|
||||||
|
if (null !== $offsetDays) {
|
||||||
|
$dateTo = $dateTo->modify('-'.$offsetDays.' days');
|
||||||
|
}
|
||||||
|
$qb->setParameter('dateTo', $dateTo);
|
||||||
|
|
||||||
if (null !== $hotelCode) {
|
if (null !== $hotelCode) {
|
||||||
$qb
|
$qb
|
||||||
->andWhere($qb->expr()->like('destination.hotelCode', ':hotelCode'))
|
->andWhere($qb->expr()->like('destination.hotelCode', ':hotelCode'))
|
||||||
@@ -204,10 +209,10 @@ class DispositionRepository extends ServiceEntityRepository
|
|||||||
return $qb->getQuery();
|
return $qb->getQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function findDispositionsWithPendingFeedback(): array
|
public function findDispositionsWithOverdueFeedback(?int $offsetDays = null): array
|
||||||
{
|
{
|
||||||
return $this
|
return $this
|
||||||
->getDispositionsWithPendingFeedbackQuery()
|
->getDispositionsWithPendingFeedbackQuery(null, $offsetDays)
|
||||||
->getResult()
|
->getResult()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class FeedbackReminderService
|
|||||||
public function sendFeedbackReminders(): string
|
public function sendFeedbackReminders(): string
|
||||||
{
|
{
|
||||||
/** @var Disposition[] $dispositionsWithPendingFeedbacks */
|
/** @var Disposition[] $dispositionsWithPendingFeedbacks */
|
||||||
$dispositionsWithPendingFeedbacks = $this->dispositionRepository->findDispositionsWithPendingFeedback();
|
$dispositionsWithPendingFeedbacks = $this->dispositionRepository->findDispositionsWithOverdueFeedback();
|
||||||
|
|
||||||
$sortedFeedbacks = [];
|
$sortedFeedbacks = [];
|
||||||
|
|
||||||
|
|||||||
@@ -171,6 +171,37 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="bg-gray-100 border border-gray-200 rounded-md px-4 py-2">
|
||||||
|
<h2 class="font-bold text-lg pb-2">
|
||||||
|
überfällige Feedbacks
|
||||||
|
</h2>
|
||||||
|
<ul class="divide-y divide-gray-200">
|
||||||
|
{% for disposition in overdueFeedbacks %}
|
||||||
|
{% set assignment = disposition.assignment %}
|
||||||
|
<li class="py-2 first:pt-0 last:pb-0">
|
||||||
|
<a href="{{ path('app_administrative_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
||||||
|
<span class="flex items-center space-x-1">
|
||||||
|
{{ icon('feedback', 'w-4 h-4 shrink-0') }}
|
||||||
|
<div class="flex items-center space-x-1 truncate">
|
||||||
|
<span class="whitespace-nowrap">{{ disposition.teamer }}</span>
|
||||||
|
{% if assignment.destination %}
|
||||||
|
{% include '_partials/_dot.html.twig' %}
|
||||||
|
<span class="whitespace-nowrap">{{ assignment.destination }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
{% if assignment.jobProfile %}
|
||||||
|
<span class="pl-5 whitespace-nowrap">{{ assignment.jobProfile.name }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="py-2 first:pt-0 last:pb-0">
|
||||||
|
-
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<div class="bg-gray-100 border border-gray-200 rounded-md px-4 py-2">
|
<div class="bg-gray-100 border border-gray-200 rounded-md px-4 py-2">
|
||||||
<h2 class="font-bold text-lg pb-2">
|
<h2 class="font-bold text-lg pb-2">
|
||||||
Überfällige Honorarverträge
|
Überfällige Honorarverträge
|
||||||
|
|||||||
Reference in New Issue
Block a user