mirror of
https://github.com/Karaka-Management/oms-Tasks.git
synced 2026-01-11 15:38:40 +00:00
Dashboard fix
This commit is contained in:
parent
232285d447
commit
3773d9eb40
|
|
@ -105,14 +105,14 @@ final class BackendController extends Controller implements DashboardElementInte
|
|||
$view->setTemplate('/Modules/Tasks/Theme/Backend/dashboard-task');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001101001, $request, $response));
|
||||
|
||||
$taskListView = new \Modules\Tasks\Theme\Backend\Components\Tasks\ListView($this->app->l11nManager, $request, $response);
|
||||
$taskListView->setTemplate('/Modules/Tasks/Theme/Backend/Components/Tasks/list');
|
||||
$view->addData('tasklist', $taskListView);
|
||||
|
||||
$tasks = TaskMapper::getAnyRelatedToUser($request->header->account)
|
||||
->where('id', 0, '>')
|
||||
->with('tags')
|
||||
->with('tags/title')
|
||||
->sort('taskElements/createdAt', OrderType::DESC)
|
||||
->limit(5)->execute();
|
||||
->limit(5)
|
||||
->where('id', 0, '>')
|
||||
->where('tags/title/language', $response->getLanguage())
|
||||
->execute();
|
||||
|
||||
$view->addData('tasks', $tasks);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,37 +15,44 @@ declare(strict_types=1);
|
|||
use Modules\Tasks\Models\TaskPriority;
|
||||
use Modules\Tasks\Models\TaskStatus;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
?>
|
||||
<table class="default">
|
||||
<thead>
|
||||
<td><?= $this->getHtml('Status', 'Tasks'); ?>
|
||||
<td><?= $this->getHtml('Due/Priority', 'Tasks'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Title', 'Tasks'); ?>
|
||||
<tfoot>
|
||||
<tbody>
|
||||
<?php
|
||||
$c = 0;
|
||||
foreach ($this->tasks as $key => $task) : ++$c;
|
||||
$url = UriFactory::build(!empty($task->redirect) ? $task->redirect : ('{/prefix}task/single?{?}&id=' . $task->getId()));
|
||||
|
||||
$color = 'darkred';
|
||||
if ($task->getStatus() === TaskStatus::DONE) { $color = 'green'; }
|
||||
elseif ($task->getStatus() === TaskStatus::OPEN) { $color = 'darkblue'; }
|
||||
elseif ($task->getStatus() === TaskStatus::WORKING) { $color = 'purple'; }
|
||||
elseif ($task->getStatus() === TaskStatus::CANCELED) { $color = 'red'; }
|
||||
elseif ($task->getStatus() === TaskStatus::SUSPENDED) { $color = 'yellow'; } ?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('S' . $task->getStatus(), 'Tasks'); ?></span></a>
|
||||
<td><a href="<?= $url; ?>">
|
||||
<?php if ($task->getPriority() === TaskPriority::NONE) : ?>
|
||||
<?= $this->printHtml($task->getDue()->format('Y-m-d H:i')); ?>
|
||||
<?php else : ?>
|
||||
<?= $this->getHtml('P' . $task->getPriority()); ?>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($task->getTitle()); ?></a>
|
||||
<?php endforeach; if ($c == 0) : ?>
|
||||
<tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<div id="news-dashboard" class="col-xs-12 col-md-6" draggable="true">
|
||||
<div class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('News', 'News'); ?></div>
|
||||
<table class="default">
|
||||
<thead>
|
||||
<td><?= $this->getHtml('Status', 'Tasks'); ?>
|
||||
<td><?= $this->getHtml('Due/Priority', 'Tasks'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Title', 'Tasks'); ?>
|
||||
<tfoot>
|
||||
<tbody>
|
||||
<?php
|
||||
$c = 0;
|
||||
foreach ($this->tasks as $key => $task) : ++$c;
|
||||
$url = UriFactory::build(!empty($task->redirect) ? $task->redirect : ('{/prefix}task/single?{?}&id=' . $task->getId()));
|
||||
|
||||
$color = 'darkred';
|
||||
if ($task->getStatus() === TaskStatus::DONE) { $color = 'green'; }
|
||||
elseif ($task->getStatus() === TaskStatus::OPEN) { $color = 'darkblue'; }
|
||||
elseif ($task->getStatus() === TaskStatus::WORKING) { $color = 'purple'; }
|
||||
elseif ($task->getStatus() === TaskStatus::CANCELED) { $color = 'red'; }
|
||||
elseif ($task->getStatus() === TaskStatus::SUSPENDED) { $color = 'yellow'; } ?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('S' . $task->getStatus(), 'Tasks'); ?></span></a>
|
||||
<td><a href="<?= $url; ?>">
|
||||
<?php if ($task->getPriority() === TaskPriority::NONE) : ?>
|
||||
<?= $this->printHtml($task->due->format('Y-m-d H:i')); ?>
|
||||
<?php else : ?>
|
||||
<?= $this->getHtml('P' . $task->getPriority()); ?>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($task->title); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c == 0) : ?>
|
||||
<tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<div class="portlet-foot"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -12,10 +12,51 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\Tasks\Models\TaskPriority;
|
||||
use Modules\Tasks\Models\TaskStatus;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
$tasksList = $this->getData('tasks') ?? [];
|
||||
?>
|
||||
<div id="task-dashboard" class="col-xs-12 col-md-6" draggable="true">
|
||||
|
||||
<div id="tasks-dashboard" class="col-xs-12 col-md-6" draggable="true">
|
||||
<div class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Tasks', 'Tasks'); ?></div>
|
||||
<?= $this->getData('tasklist')->render($this->getData('tasks')); ?>
|
||||
<table class="default">
|
||||
<thead>
|
||||
<td><?= $this->getHtml('Status', 'Tasks'); ?>
|
||||
<td><?= $this->getHtml('Due/Priority', 'Tasks'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Title', 'Tasks'); ?>
|
||||
<tfoot>
|
||||
<tbody>
|
||||
<?php
|
||||
$c = 0;
|
||||
foreach ($tasksList as $key => $task) : ++$c;
|
||||
$url = UriFactory::build(!empty($task->redirect) ? $task->redirect : ('{/prefix}task/single?{?}&id=' . $task->getId()));
|
||||
|
||||
$color = 'darkred';
|
||||
if ($task->getStatus() === TaskStatus::DONE) { $color = 'green'; }
|
||||
elseif ($task->getStatus() === TaskStatus::OPEN) { $color = 'darkblue'; }
|
||||
elseif ($task->getStatus() === TaskStatus::WORKING) { $color = 'purple'; }
|
||||
elseif ($task->getStatus() === TaskStatus::CANCELED) { $color = 'red'; }
|
||||
elseif ($task->getStatus() === TaskStatus::SUSPENDED) { $color = 'yellow'; } ?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('S' . $task->getStatus(), 'Tasks'); ?></span></a>
|
||||
<td><a href="<?= $url; ?>">
|
||||
<?php if ($task->getPriority() === TaskPriority::NONE) : ?>
|
||||
<?= $this->printHtml($task->due->format('Y-m-d H:i')); ?>
|
||||
<?php else : ?>
|
||||
<?= $this->getHtml('P' . $task->getPriority()); ?>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($task->title); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c == 0) : ?>
|
||||
<tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<div class="portlet-foot">
|
||||
<a class="button" href="<?= UriFactory::build('{/prefix}task/dashboard?{?}') ?>"><?= $this->getHtml('More', '0', '0'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user