permission changes & minor bug fixes

This commit is contained in:
Dennis Eichhorn 2022-11-09 22:56:19 +01:00
parent 7a31dbc13c
commit 9dad1dc011
62 changed files with 25 additions and 17 deletions

0
Admin/Install/Dashboard.install.json Normal file → Executable file
View File

0
Admin/Install/Dashboard.php Normal file → Executable file
View File

0
ICAL.txt Normal file → Executable file
View File

View File

@ -36,4 +36,12 @@ final class NullTask extends Task
$this->id = $id; $this->id = $id;
parent::__construct(); parent::__construct();
} }
/**
* {@inheritdoc}
*/
public function jsonSerialize() : mixed
{
return ['id' => $this->id];
}
} }

0
Models/TaskSeen.php Normal file → Executable file
View File

0
Models/TaskSeenMapper.php Normal file → Executable file
View File

View File

@ -31,7 +31,7 @@ use phpOMS\Uri\UriFactory;
<?php <?php
$c = 0; $c = 0;
foreach ($this->tasks as $key => $task) : ++$c; foreach ($this->tasks as $key => $task) : ++$c;
$url = UriFactory::build(!empty($task->redirect) ? $task->redirect : ('{/prefix}task/single?{?}&id=' . $task->getId())); $url = UriFactory::build(!empty($task->redirect) ? $task->redirect : ('task/single?{?}&id=' . $task->getId()));
$color = 'darkred'; $color = 'darkred';
if ($task->getStatus() === TaskStatus::DONE) { $color = 'green'; } if ($task->getStatus() === TaskStatus::DONE) { $color = 'green'; }

0
Theme/Backend/Lang/Navigation.ar.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.cs.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.da.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.de.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.el.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.en.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.es.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.fi.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.fr.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.hu.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.it.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.ja.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.ko.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.no.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.pl.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.pt.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.ru.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.sv.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.th.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.tr.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.uk.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/Navigation.zh.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/ar.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/cs.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/da.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/de.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/el.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/en.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/es.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/fi.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/fr.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/hu.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/it.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/ja.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/ko.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/no.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/pl.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/pt.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/ru.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/sv.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/th.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/tr.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/uk.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/zh.lang.php Normal file → Executable file
View File

View File

@ -34,7 +34,7 @@ $tasksList = $this->getData('tasks') ?? [];
foreach ($tasksList as $key => $task) : ++$c; foreach ($tasksList as $key => $task) : ++$c;
$url = UriFactory::build(!empty($task->redirect) $url = UriFactory::build(!empty($task->redirect)
? $task->redirect ? $task->redirect
: ('{/prefix}task/single?{?}&id=' . $task->getId()) : ('task/single?{?}&id=' . $task->getId())
); );
?> ?>
<tr data-href="<?= $url; ?>"> <tr data-href="<?= $url; ?>">
@ -54,7 +54,7 @@ $tasksList = $this->getData('tasks') ?? [];
</table> </table>
</div> </div>
<div class="portlet-foot"> <div class="portlet-foot">
<a class="button" href="<?= UriFactory::build('{/prefix}task/dashboard?{?}'); ?>"><?= $this->getHtml('More', '0', '0'); ?></a> <a class="button" href="<?= UriFactory::build('task/dashboard?{?}'); ?>"><?= $this->getHtml('More', '0', '0'); ?></a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -27,8 +27,8 @@ use phpOMS\Uri\UriFactory;
/** @var \Modules\Tasks\Models\Task[] $tasks */ /** @var \Modules\Tasks\Models\Task[] $tasks */
$tasks = $this->getData('tasks') ?? []; $tasks = $this->getData('tasks') ?? [];
$previous = empty($tasks) ? '{/prefix}task/dashboard' : '{/prefix}task/dashboard?{?}&id=' . \reset($tasks)->getId() . '&ptype=p'; $previous = empty($tasks) ? 'task/dashboard' : 'task/dashboard?{?}&id=' . \reset($tasks)->getId() . '&ptype=p';
$next = empty($tasks) ? '{/prefix}task/dashboard' : '{/prefix}task/dashboard?{?}&id=' . \end($tasks)->getId() . '&ptype=n'; $next = empty($tasks) ? 'task/dashboard' : 'task/dashboard?{?}&id=' . \end($tasks)->getId() . '&ptype=n';
$open = $this->getData('open'); $open = $this->getData('open');
@ -54,7 +54,7 @@ if ($open !== null) :
<?php <?php
$c = 0; $c = 0;
foreach ($open as $key => $task) : ++$c; foreach ($open as $key => $task) : ++$c;
$url = UriFactory::build(!empty($task->redirect) ? $task->redirect : ('{/prefix}task/single?{?}&id=' . $task->getId())); $url = UriFactory::build(!empty($task->redirect) ? $task->redirect : ('task/single?{?}&id=' . $task->getId()));
?> ?>
<tr tabindex="0" data-href="<?= $url; ?>"> <tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Status'); ?>"> <td data-label="<?= $this->getHtml('Status'); ?>">
@ -80,7 +80,7 @@ if ($open !== null) :
</a> </a>
<?php endforeach; ?> <?php endforeach; ?>
<td data-label="<?= $this->getHtml('Creator'); ?>"> <td data-label="<?= $this->getHtml('Creator'); ?>">
<a class="content" href="<?= UriFactory::build('{/prefix}profile/single?{?}&for=' . $task->createdBy->getId()); ?>"><?= $this->printHtml($this->renderUserName('%3$s %2$s %1$s', [$task->createdBy->name1, $task->createdBy->name2, $task->createdBy->name3, $task->createdBy->login ?? ''])); ?></a> <a class="content" href="<?= UriFactory::build('profile/single?{?}&for=' . $task->createdBy->getId()); ?>"><?= $this->printHtml($this->renderUserName('%3$s %2$s %1$s', [$task->createdBy->name1, $task->createdBy->name2, $task->createdBy->name3, $task->createdBy->login ?? ''])); ?></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) : ?>
@ -115,7 +115,7 @@ if ($open !== null) :
} }
++$c; ++$c;
$url = UriFactory::build(!empty($task->redirect) ? $task->redirect : ('{/prefix}task/single?{?}&id=' . $task->getId())); $url = UriFactory::build(!empty($task->redirect) ? $task->redirect : ('task/single?{?}&id=' . $task->getId()));
?> ?>
<tr tabindex="0" data-href="<?= $url; ?>"> <tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Status'); ?>"> <td data-label="<?= $this->getHtml('Status'); ?>">
@ -141,7 +141,7 @@ if ($open !== null) :
</a> </a>
<?php endforeach; ?> <?php endforeach; ?>
<td data-label="<?= $this->getHtml('Creator'); ?>"> <td data-label="<?= $this->getHtml('Creator'); ?>">
<a class="content" href="<?= UriFactory::build('{/prefix}profile/single?{?}&for=' . $task->createdBy->getId()); ?>"><?= $this->printHtml($this->renderUserName('%3$s %2$s %1$s', [$task->createdBy->name1, $task->createdBy->name2, $task->createdBy->name3, $task->createdBy->login ?? ''])); ?></a> <a class="content" href="<?= UriFactory::build('profile/single?{?}&for=' . $task->createdBy->getId()); ?>"><?= $this->printHtml($this->renderUserName('%3$s %2$s %1$s', [$task->createdBy->name1, $task->createdBy->name2, $task->createdBy->name3, $task->createdBy->login ?? ''])); ?></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

@ -84,7 +84,7 @@ echo $this->getData('nav')->render(); ?>
<?php if (!empty($taskMedia)) : ?> <?php if (!empty($taskMedia)) : ?>
<div> <div>
<?php foreach ($taskMedia as $media) : ?> <?php foreach ($taskMedia as $media) : ?>
<span><a class="content" href="<?= UriFactory::build('{/prefix}media/single?id=' . $media->getId());?>"><?= $media->name; ?></a></span> <span><a class="content" href="<?= UriFactory::build('media/single?id=' . $media->getId());?>"><?= $media->name; ?></a></span>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
@ -176,7 +176,7 @@ echo $this->getData('nav')->render(); ?>
<section class="portlet"> <section class="portlet">
<div class="portlet-body"> <div class="portlet-body">
<?= \sprintf($this->getHtml('status_change'), <?= \sprintf($this->getHtml('status_change'),
'<a href="' . UriFactory::build('{/prefix}profile/single?{?}&for=' . $element->createdBy->getId()) . '">' . $this->printHtml( '<a href="' . UriFactory::build('profile/single?{?}&for=' . $element->createdBy->getId()) . '">' . $this->printHtml(
$this->renderUserName( $this->renderUserName(
'%3$s %2$s %1$s', '%3$s %2$s %1$s',
[$element->createdBy->name1, $element->createdBy->name2, $element->createdBy->name3, $element->createdBy->login]) [$element->createdBy->name1, $element->createdBy->name2, $element->createdBy->name3, $element->createdBy->login])
@ -196,7 +196,7 @@ echo $this->getData('nav')->render(); ?>
<section class="portlet"> <section class="portlet">
<div class="portlet-body"> <div class="portlet-body">
<?= \sprintf($this->getHtml('priority_change'), <?= \sprintf($this->getHtml('priority_change'),
'<a href="' . UriFactory::build('{/prefix}profile/single?{?}&for=' . $element->createdBy->getId()) . '">' . $this->printHtml( '<a href="' . UriFactory::build('profile/single?{?}&for=' . $element->createdBy->getId()) . '">' . $this->printHtml(
$this->renderUserName( $this->renderUserName(
'%3$s %2$s %1$s', '%3$s %2$s %1$s',
[$element->createdBy->name1, $element->createdBy->name2, $element->createdBy->name3, $element->createdBy->login]) [$element->createdBy->name1, $element->createdBy->name2, $element->createdBy->name3, $element->createdBy->login])
@ -254,7 +254,7 @@ echo $this->getData('nav')->render(); ?>
<?php if (!empty($elementMedia)) : ?> <?php if (!empty($elementMedia)) : ?>
<div> <div>
<?php foreach ($elementMedia as $media) : ?> <?php foreach ($elementMedia as $media) : ?>
<span><a class="content" href="<?= UriFactory::build('{/prefix}media/single?id=' . $media->getId());?>"><?= $media->name; ?></a></span> <span><a class="content" href="<?= UriFactory::build('media/single?id=' . $media->getId());?>"><?= $media->name; ?></a></span>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
@ -300,14 +300,14 @@ echo $this->getData('nav')->render(); ?>
) : ?> ) : ?>
<section class="portlet wf-100"> <section class="portlet wf-100">
<div class="portlet-body"> <div class="portlet-body">
<a href="<?= UriFactory::build('{/prefix}profile/single?{?}&for=' . $element->createdBy->getId()); ?>"><?= $this->printHtml( <a href="<?= UriFactory::build('profile/single?{?}&for=' . $element->createdBy->getId()); ?>"><?= $this->printHtml(
$this->renderUserName( $this->renderUserName(
'%3$s %2$s %1$s', '%3$s %2$s %1$s',
[$element->createdBy->name1, $element->createdBy->name2, $element->createdBy->name3, $element->createdBy->login]) [$element->createdBy->name1, $element->createdBy->name2, $element->createdBy->name3, $element->createdBy->login])
); ?></a> <?= $this->getHtml('forwarded_to'); ?> ); ?></a> <?= $this->getHtml('forwarded_to'); ?>
<?php foreach ($tos as $to) : ?> <?php foreach ($tos as $to) : ?>
<?php if ($to instanceof AccountRelation) : ?> <?php if ($to instanceof AccountRelation) : ?>
<a href="<?= UriFactory::build('{/prefix}profile/single?{?}&for=' . $to->getRelation()->getId()); ?>"><?= $this->printHtml($to->getRelation()->name1); ?></a> <a href="<?= UriFactory::build('profile/single?{?}&for=' . $to->getRelation()->getId()); ?>"><?= $this->printHtml($to->getRelation()->name1); ?></a>
<?php elseif ($to instanceof GroupRelation) : ?> <?php elseif ($to instanceof GroupRelation) : ?>
<?= $this->printHtml($to->getRelation()->name); ?> <?= $this->printHtml($to->getRelation()->name); ?>
<?php endif; ?> <?php endif; ?>

View File

@ -74,10 +74,10 @@ class TaskView extends View
->execute(); ->execute();
if (($profile instanceof NullProfile) || $profile->image->getPath() === '') { if (($profile instanceof NullProfile) || $profile->image->getPath() === '') {
return UriFactory::build('{/prefix}' . $this->defaultProfileImage->getPath()); return UriFactory::build('' . $this->defaultProfileImage->getPath());
} }
return UriFactory::build('{/prefix}' . $profile->image->getPath()); return UriFactory::build('' . $profile->image->getPath());
} }
/** /**

0
tests/Controller/ApiControllerTest.php Normal file → Executable file
View File

0
tests/Controller/BackendControllerTest.php Normal file → Executable file
View File

0
tests/Controller/test.md Normal file → Executable file
View File

0
tests/Models/NullTaskElementTest.php Normal file → Executable file
View File

0
tests/Models/NullTaskTest.php Normal file → Executable file
View File

0
tests/Models/RelationAbstractTest.php Normal file → Executable file
View File

0
tests/Views/TaskViewTest.php Normal file → Executable file
View File