improve given / unseen display

This commit is contained in:
Dennis Eichhorn 2023-09-19 03:44:12 +00:00
parent 82072cfd65
commit 4397a93538
2 changed files with 17 additions and 2 deletions

View File

@ -112,6 +112,21 @@ final class BackendController extends Controller implements DashboardElementInte
$view->data['open'] = $open;
// given
// @todo: this should also include forwarded tasks
/** @var \Modules\Tasks\Models\Task[] $given */
$given = TaskMapper::getAll()
->with('createdBy')
->with('tags')
->with('tags/title')
->where('tags/title/language', $response->header->l11n->language)
->where('status', TaskStatus::OPEN)
->where('createdBy', $response->header->account, '=')
->sort('createdAt', OrderType::DESC)
->execute();
$view->data['given'] = $given;
/** @var \Modules\Tasks\Models\TaskSeen[] $unread */
$unread = TaskSeenMapper::getAll()
->where('task', \array_keys($open), 'in')

View File

@ -98,7 +98,7 @@ echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('OpenGiven'); ?> (<?= \count($open); ?>)<i class="lni lni-download download btn end-xs"></i></div>
<div class="portlet-head"><?= $this->getHtml('OpenGiven'); ?> (<?= \count($this->data['given']); ?>)<i class="lni lni-download download btn end-xs"></i></div>
<div class="slider">
<table id="taskList" class="default sticky">
<thead>
@ -111,7 +111,7 @@ echo $this->data['nav']->render(); ?>
<tbody>
<?php
$c = 0;
foreach ($open as $key => $task) : ++$c;
foreach ($this->data['given'] as $key => $task) : ++$c;
$url = UriFactory::build(empty($task->redirect)
? 'task/single?{?}&id=' . $task->id
: ('{/app}/' . $task->redirect),