This commit is contained in:
Dennis Eichhorn 2017-10-03 20:25:11 +02:00
parent 6a0ac74a85
commit 569899d028
2 changed files with 18 additions and 116 deletions

View File

@ -142,6 +142,18 @@ class Controller extends ModuleAbstract implements WebInterface
$view->setTemplate('/Modules/EventManagement/Theme/Backend/eventmanagement-profile');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004201001, $request, $response));
$taskListView = new \Modules\Tasks\Theme\Backend\Components\Tasks\BaseView($this->app, $request, $response);
$taskListView->setTemplate('/Modules/Tasks/Theme/Backend/Components/Tasks/list');
$view->addData('tasklist', $taskListView);
$calendarView = new \Modules\Calendar\Theme\Backend\Components\Calendar\BaseView($this->app, $request, $response);
$calendarView->setTemplate('/Modules/Calendar/Theme/Backend/Components/Calendar/mini');
$view->addData('calendar', $calendarView);
$mediaListView = new \Modules\Media\Theme\Backend\Components\Media\BaseView($this->app, $request, $response);
$mediaListView->setTemplate('/Modules/Media/Theme/Backend/Components/Media/list');
$view->addData('medialist', $mediaListView);
$event = EventMapper::get((int) $request->getData('id'));
$view->addData('event', $event);

View File

@ -53,128 +53,18 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12 col-md-6">
<div class="box wf-100">
<table class="table red">
<caption><?= $this->getHtml('Tasks', 'Tasks') ?></caption>
<thead>
<td><?= $this->getHtml('Status') ?>
<td><?= $this->getHtml('Due', 'Tasks') ?>
<td class="full"><?= $this->getHtml('Title') ?>
<tfoot>
<tbody>
<?php $c = 0; foreach($tasks as $key => $task) : $c++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/task/single?{?}&id=' . $task->getId());
$color = 'darkred';
if($task->getStatus() === \Modules\Tasks\Models\TaskStatus::DONE) { $color = 'green'; }
elseif($task->getStatus() === \Modules\Tasks\Models\TaskStatus::OPEN) { $color = 'darkblue'; }
elseif($task->getStatus() === \Modules\Tasks\Models\TaskStatus::WORKING) { $color = 'purple'; }
elseif($task->getStatus() === \Modules\Tasks\Models\TaskStatus::CANCELED) { $color = 'red'; }
elseif($task->getStatus() === \Modules\Tasks\Models\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; ?>"><?= $this->printHtml($task->getDue()->format('Y-m-d H:i')); ?></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>
<?= $this->getData('tasklist')->render($event->getTasks()); ?>
</div>
</div>
</div>
<div class="row">
<div id="calendar" class="m-calendar m-calendar-mini col-xs-12 col-md-6" draggable="true" data-action='[
{
"listener": "click", "selector": "#calendar span.tag", "action": [
{"key": 1, "type": "dom.popup", "tpl": "calendar-event-popup-tpl", "aniIn": "fadeIn"}
]
}
]'>
<div class="box wf-100">
<ul class="weekdays green">
<li><?= $this->getHtml('Sunday', 'Calendar'); ?>
<li><?= $this->getHtml('Monday', 'Calendar'); ?>
<li><?= $this->getHtml('Tuesday', 'Calendar'); ?>
<li><?= $this->getHtml('Wednesday', 'Calendar'); ?>
<li><?= $this->getHtml('Thursday', 'Calendar'); ?>
<li><?= $this->getHtml('Friday', 'Calendar'); ?>
<li><?= $this->getHtml('Saturday', 'Calendar'); ?>
</ul>
<?php $current = $event->getCalendar()->getDate()->getMonthCalendar(0); $isActiveMonth = false;
for($i = 0; $i < 6; $i++) : ?>
<ul class="days">
<?php for($j = 0; $j < 7; $j++) :
$isActiveMonth = ((int) $current[$i*7+$j]->format('d') === 1) ? !$isActiveMonth : $isActiveMonth;
?>
<?php if($isActiveMonth) :?>
<li class="day<?= $event->getCalendar()->hasEventOnDate($current[$i*7+$j]) ? ' has-event' : '';?>">
<div class="date"><?= $current[$i*7+$j]->format('d'); ?></div>
<?php else: ?>
<li class="day other-month<?= $event->getCalendar()->hasEventOnDate($current[$i*7+$j]) ? ' has-event' : '';?>">
<div class="date"><?= $current[$i*7+$j]->format('d'); ?></div>
<?php endif; ?>
<?php endfor; ?>
</li>
</ul>
<?php endfor;?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<?= $this->getData('calendar')->render($event->getCalendar()); ?>
</div>
<div class="col-xs-12 col-md-6">
<div class="box wf-100">
<table class="table blue">
<caption><?= $this->getHtml('Media', 'Media') ?></caption>
<thead>
<td>
<td class="wf-100"><?= $this->getHtml('Name', 'Media') ?>
<td><?= $this->getHtml('Type', 'Media') ?>
<td><?= $this->getHtml('Size', 'Media') ?>
<td><?= $this->getHtml('Creator', 'Media') ?>
<td><?= $this->getHtml('Created', 'Media') ?>
<tfoot>
<tbody>
<?php $count = 0; $media = $event->getMedia(); foreach($media as $key => $value) : $count++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/media/single?{?}&id=' . $value->getId());
$icon = '';
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
if($extensionType === \phpOMS\System\File\ExtensionType::CODE) {
$icon = 'file-code-o';
} elseif($extensionType === \phpOMS\System\File\ExtensionType::TEXT) {
$icon = 'file-text-o';
} elseif($extensionType === \phpOMS\System\File\ExtensionType::PRESENTATION) {
$icon = 'file-powerpoint-o';
} elseif($extensionType === \phpOMS\System\File\ExtensionType::PDF) {
$icon = 'file-pdf-o';
} elseif($extensionType === \phpOMS\System\File\ExtensionType::ARCHIVE) {
$icon = 'file-zip-o';
} elseif($extensionType === \phpOMS\System\File\ExtensionType::AUDIO) {
$icon = 'file-audio-o';
} elseif($extensionType === \phpOMS\System\File\ExtensionType::VIDEO) {
$icon = 'file-video-o';
} elseif($extensionType === \phpOMS\System\File\ExtensionType::IMAGE) {
$icon = 'file-image-o';
} elseif($extensionType === \phpOMS\System\File\ExtensionType::SPREADSHEET) {
$icon = 'file-excel-o';
} elseif($value->getExtension() === 'collection') {
$icon = 'folder-open-o';
} else {
$icon = 'file-o';
}
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><i class="fa fa-<?= $this->printHtml($icon); ?>"></i></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getExtension()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getSize()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getCreatedBy()->getName1()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getCreatedAt()->format('Y-m-d H:i:s')); ?></a>
<?php endforeach; ?>
<?php if($count === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>
<?= $this->getData('medialist')->render($event->getMedia()); ?>
</div>
</div>