This commit is contained in:
Dennis Eichhorn 2017-10-02 09:19:20 +02:00
parent cc6b4e5d82
commit 08e3a10e03
5 changed files with 50 additions and 6 deletions

View File

@ -153,6 +153,16 @@ class Task implements \JsonSerializable
return $key; return $key;
} }
public function getMedia() : array
{
return $this->media;
}
public function addMedia($media) /* : void */
{
$this->media[] = $media;
}
public function isCc(int $id) : bool public function isCc(int $id) : bool
{ {
return false; return false;

View File

@ -91,6 +91,12 @@ class TaskElement implements \JsonSerializable
*/ */
private $forwarded = 0; private $forwarded = 0;
/**
* Media.
*
* @var array
* @since 1.0.0
*/
private $media = []; private $media = [];
/** /**
@ -153,6 +159,16 @@ class TaskElement implements \JsonSerializable
} }
} }
public function getMedia() : array
{
return $this->media;
}
public function addMedia($media) /* : void */
{
$this->media[] = $media;
}
/** /**
* @return string * @return string
* *

View File

@ -58,8 +58,8 @@ class TaskElementMapper extends DataMapperAbstract
'media' => [ 'media' => [
'mapper' => MediaMapper::class, 'mapper' => MediaMapper::class,
'table' => 'task_element_media', 'table' => 'task_element_media',
'dst' => 'task_element_media_dst', 'dst' => 'task_element_media_src',
'src' => 'task_element_media_src', 'src' => 'task_element_media_dst',
], ],
]; ];

View File

@ -71,8 +71,8 @@ class TaskMapper extends DataMapperAbstract
'media' => [ // todo: maybe make this a has one and then link to collection instead of single media files! 'media' => [ // todo: maybe make this a has one and then link to collection instead of single media files!
'mapper' => MediaMapper::class, 'mapper' => MediaMapper::class,
'table' => 'task_media', 'table' => 'task_media',
'dst' => 'task_media_dst', 'dst' => 'task_media_src',
'src' => 'task_media_src', 'src' => 'task_media_dst',
], ],
]; ];

View File

@ -16,6 +16,7 @@
* @var \Modules\Tasks\Models\Task $task * @var \Modules\Tasks\Models\Task $task
*/ */
$task = $this->getData('task'); $task = $this->getData('task');
$taskMedia = $task->getMedia();
$elements = $task->getTaskElements(); $elements = $task->getTaskElements();
$cElements = count($elements); $cElements = count($elements);
@ -39,6 +40,15 @@ echo $this->getData('nav')->render(); ?>
<?= $this->printHtml($task->getDescription()); ?> <?= $this->printHtml($task->getDescription()); ?>
</blockquote> </blockquote>
</div> </div>
<?php if(!empty($taskMedia)) : ?>
<div class="inner">
<?php foreach($taskMedia as $media) : ?>
<span><?= $media->getName(); ?></span>
<?php endforeach; ?>
</div>
<?php endif; ?>
<div class="inner"> <div class="inner">
<div class="pAlignTable"> <div class="pAlignTable">
<div class="vCenterTable wf-100">Created <?= $this->printHtml($task->getCreatedBy()->getName1()); ?></div> <div class="vCenterTable wf-100">Created <?= $this->printHtml($task->getCreatedBy()->getName1()); ?></div>
@ -60,13 +70,21 @@ echo $this->getData('nav')->render(); ?>
<span class="vCenterTable tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('S' . $element->getStatus()) ?></span> <span class="vCenterTable tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('S' . $element->getStatus()) ?></span>
</div> </div>
<?php if ($element->getDescription() !== '') : ?> <?php if ($element->getDescription() !== '') : ?>
<div class="inner"> <div class="inner">
<blockquote> <blockquote>
<?= $this->printHtml($element->getDescription()); ?> <?= $this->printHtml($element->getDescription()); ?>
</blockquote> </blockquote>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php $elementMedia = $element->getMedia(); if(!empty($elementMedia)) : ?>
<div class="inner">
<?php foreach($elementMedia as $media) : ?>
<span><?= $media->getName(); ?></span>
<?php endforeach; ?>
</div>
<?php endif; ?>
<div class="inner pAlignTable"> <div class="inner pAlignTable">
<?php if ($element->getForwarded() !== 0) : ?> <?php if ($element->getForwarded() !== 0) : ?>