formatting fixes, bug fixes and support impl.

This commit is contained in:
Dennis Eichhorn 2021-07-04 18:27:21 +02:00
parent 2cdbd83244
commit f08e412011
7 changed files with 13 additions and 11 deletions

View File

@ -97,7 +97,7 @@ final class ApiController extends Controller
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function createTaskFromRequest(RequestAbstract $request) : Task public function createTaskFromRequest(RequestAbstract $request) : Task
{ {
$task = new Task(); $task = new Task();
$task->title = (string) ($request->getData('title') ?? ''); $task->title = (string) ($request->getData('title') ?? '');
@ -277,7 +277,7 @@ final class ApiController extends Controller
* *
* @since 1.0.0 * @since 1.0.0
*/ */
private function createTaskElementFromRequest(RequestAbstract $request, Task $task) : TaskElement public function createTaskElementFromRequest(RequestAbstract $request, Task $task) : TaskElement
{ {
$element = new TaskElement(); $element = new TaskElement();
$element->createdBy = new NullAccount($request->header->account); $element->createdBy = new NullAccount($request->header->account);

View File

@ -17,7 +17,7 @@ namespace Modules\Tasks\Controller;
use phpOMS\Module\ModuleAbstract; use phpOMS\Module\ModuleAbstract;
/** /**
* Task class. * Task controller class.
* *
* @package Modules\Tasks * @package Modules\Tasks
* @license OMS License 1.0 * @license OMS License 1.0

View File

@ -54,7 +54,7 @@ class Task implements \JsonSerializable
* @var Account * @var Account
* @since 1.0.0 * @since 1.0.0
*/ */
protected Account $createdBy; public Account $createdBy;
/** /**
* Created. * Created.

View File

@ -336,7 +336,8 @@ final class TaskMapper extends DataMapperAbstract
string $order = 'ASC', string $order = 'ASC',
int $relations = RelationType::ALL, int $relations = RelationType::ALL,
int $depth = 3 int $depth = 3
) : array { ) : array
{
$depth = 3; $depth = 3;
$userWhere = new Where(self::$db); $userWhere = new Where(self::$db);
$userWhere->where(AccountRelationMapper::getTable() . '.task_account_account', '=', $user) $userWhere->where(AccountRelationMapper::getTable() . '.task_account_account', '=', $user)
@ -378,7 +379,8 @@ final class TaskMapper extends DataMapperAbstract
string $order = 'ASC', string $order = 'ASC',
int $relations = RelationType::ALL, int $relations = RelationType::ALL,
int $depth = 3 int $depth = 3
) : array { ) : array
{
$depth = 3; $depth = 3;
$userWhere = new Where(self::$db); $userWhere = new Where(self::$db);
$userWhere->where(AccountRelationMapper::getTable() . '.task_account_account', '=', $user) $userWhere->where(AccountRelationMapper::getTable() . '.task_account_account', '=', $user)

View File

@ -15,7 +15,7 @@ declare(strict_types=1);
namespace Modules\Tasks\Models; namespace Modules\Tasks\Models;
/** /**
* Task class. * Task template class.
* *
* @package Modules\Tasks\Models * @package Modules\Tasks\Models
* @license OMS License 1.0 * @license OMS License 1.0

View File

@ -74,7 +74,7 @@ echo $this->getData('nav')->render(); ?>
</a> </a>
<?php endforeach; ?> <?php endforeach; ?>
<td data-label="<?= $this->getHtml('Creator'); ?>"> <td data-label="<?= $this->getHtml('Creator'); ?>">
<a href="<?= $url; ?>"><?= $this->printHtml($task->getCreatedBy()->name1); ?></a> <a href="<?= $url; ?>"><?= $this->printHtml($task->createdBy->name1); ?></a>
<td data-label="<?= $this->getHtml('Created'); ?>"> <td data-label="<?= $this->getHtml('Created'); ?>">
<a href="<?= $url; ?>"><?= $this->printHtml($task->createdAt->format('Y-m-d H:i')); ?></a> <a href="<?= $url; ?>"><?= $this->printHtml($task->createdAt->format('Y-m-d H:i')); ?></a>
<?php endforeach; if ($c == 0) : ?> <?php endforeach; if ($c == 0) : ?>

View File

@ -58,10 +58,10 @@ echo $this->getData('nav')->render(); ?>
<div class="portlet-head"> <div class="portlet-head">
<div class="row middle-xs"> <div class="row middle-xs">
<span class="col-xs-0"> <span class="col-xs-0">
<img class="profile-image" loading="lazy" alt="<?= $this->getHtml('User', '0', '0'); ?>" src="<?= $this->getAccountImage($task->getCreatedBy()->getId()); ?>"> <img class="profile-image" loading="lazy" alt="<?= $this->getHtml('User', '0', '0'); ?>" src="<?= $this->getAccountImage($task->createdBy->getId()); ?>">
</span> </span>
<span> <span>
<?= $this->printHtml($task->getCreatedBy()->name1); ?> - <?= $this->printHtml($task->createdAt->format('Y/m/d H:i')); ?> <?= $this->printHtml($task->createdBy->name1); ?> - <?= $this->printHtml($task->createdAt->format('Y/m/d H:i')); ?>
</span> </span>
<span class="col-xs end-xs plain-grid"> <span class="col-xs end-xs plain-grid">
<span id="task-status-badge" class="nobreak tag task-status-<?= $task->getStatus(); ?>"> <span id="task-status-badge" class="nobreak tag task-status-<?= $task->getStatus(); ?>">
@ -103,7 +103,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</div> </div>
<div class="col-xs-0 end-xs plain-grid"> <div class="col-xs-0 end-xs plain-grid">
<?php if ($task->isEditable && $this->request->header->account === $task->getCreatedBy()->getId()) : ?> <?php if ($task->isEditable && $this->request->header->account === $task->createdBy->getId()) : ?>
<div class="col-xs end-xs plain-grid"> <div class="col-xs end-xs plain-grid">
<button class="save hidden"><?= $this->getHtml('Save', '0', '0'); ?></button> <button class="save hidden"><?= $this->getHtml('Save', '0', '0'); ?></button>
<button class="cancel hidden"><?= $this->getHtml('Cancel', '0', '0'); ?></button> <button class="cancel hidden"><?= $this->getHtml('Cancel', '0', '0'); ?></button>