changed file permissions

This commit is contained in:
Dennis Eichhorn 2020-06-09 22:03:51 +02:00
parent 4aba4ad579
commit c3145ec7da
77 changed files with 128 additions and 82 deletions

0
.github/dev_bug_report.md vendored Normal file → Executable file
View File

0
.github/dev_feature_request.md vendored Normal file → Executable file
View File

0
.github/user_bug_report.md vendored Normal file → Executable file
View File

0
.github/user_feature_request.md vendored Normal file → Executable file
View File

0
.github/workflows/greetings.yml vendored Normal file → Executable file
View File

0
.github/workflows/image.yml vendored Normal file → Executable file
View File

0
.github/workflows/main.yml vendored Normal file → Executable file
View File

0
Admin/Hooks/Web/Api.php Normal file → Executable file
View File

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

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

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

0
Admin/Installer.php Normal file → Executable file
View File

0
Admin/Routes/Web/Api.php Normal file → Executable file
View File

0
Admin/Routes/Web/Backend.php Normal file → Executable file
View File

0
Admin/Status.php Normal file → Executable file
View File

0
Admin/Uninstaller.php Normal file → Executable file
View File

0
Admin/Updater.php Normal file → Executable file
View File

0
CODE_OF_CONDUCT.md Normal file → Executable file
View File

0
CONTRIBUTING.md Normal file → Executable file
View File

0
Controller/ApiController.php Normal file → Executable file
View File

0
Controller/BackendController.php Normal file → Executable file
View File

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

0
Docs/Dev/en/SUMMARY.md Normal file → Executable file
View File

0
Docs/Dev/en/task.md Normal file → Executable file
View File

0
Docs/Help/en/SUMMARY.md Normal file → Executable file
View File

0
Docs/Help/en/introduction.md Normal file → Executable file
View File

0
Docs/Help/en/task.md Normal file → Executable file
View File

0
LICENSE.txt Normal file → Executable file
View File

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

0
README.md Normal file → Executable file
View File

0
Theme/Backend/Components/Tasks/ListView.php Normal file → Executable file
View File

0
Theme/Backend/Components/Tasks/PriorityView.php Normal file → Executable file
View File

0
Theme/Backend/Components/Tasks/StatusView.php Normal file → Executable file
View File

0
Theme/Backend/Components/Tasks/list.tpl.php Normal file → Executable file
View File

0
Theme/Backend/Components/Tasks/priority.tpl.php Normal file → Executable file
View File

0
Theme/Backend/Components/Tasks/status.tpl.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.en.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/en.lang.php Normal file → Executable file
View File

3
Theme/Backend/css/styles.css Normal file → Executable file
View File

@ -8,10 +8,12 @@
.tag.task-status-1 { .tag.task-status-1 {
background: #ff6250; background: #ff6250;
color: #fff;
} }
.tag.task-status-2 { .tag.task-status-2 {
background: #3498db; background: #3498db;
color: #fff;
} }
.tag.task-status-3 { .tag.task-status-3 {
@ -20,6 +22,7 @@
.tag.task-status-4 { .tag.task-status-4 {
background: #9b59b6; background: #9b59b6;
color: #fff;
} }
.tag.task-status-5 { .tag.task-status-5 {

0
Theme/Backend/dashboard-task.tpl.php Normal file → Executable file
View File

0
Theme/Backend/task-analysis.tpl.php Normal file → Executable file
View File

0
Theme/Backend/task-create.tpl.php Normal file → Executable file
View File

0
Theme/Backend/task-dashboard.tpl.php Normal file → Executable file
View File

182
Theme/Backend/task-single.tpl.php Normal file → Executable file
View File

@ -29,16 +29,16 @@ echo $this->getData('nav')->render(); ?>
<div class="row"> <div class="row">
<div class="col-md-6 col-xs-12"> <div class="col-md-6 col-xs-12">
<div id="task" class="portlet" <section id="task" class="portlet"
data-update-content="#task" data-update-content="#task"
data-update-element="#task .portlet-head, #task .task-content" data-update-element="#task .task-title, #task .task-content"
data-update-tpl="#headTpl, #contentTpl" data-update-tpl="#headTpl, #contentTpl"
data-tag="form" data-tag="form"
data-method="POST" data-method="POST"
data-uri="<?= \phpOMS\Uri\UriFactory::build('{/api}task?id={?id}&csrf={$CSRF}'); ?>"> data-uri="<?= \phpOMS\Uri\UriFactory::build('{/api}task?id={?id}&csrf={$CSRF}'); ?>">
<?php if ($task->isEditable()) : ?> <?php if ($task->isEditable()) : ?>
<template id="headTpl"> <template id="headTpl">
<div class="portlet-head"><input type="text" data-tpl-text="/title" data-tpl-value="/title" data-value="" name="title"></div> <h1 class="task-title"><input type="text" data-tpl-text="/title" data-tpl-value="/title" data-value="" name="title" autocomplete="off"></h1>
</template> </template>
<template id="contentTpl"> <template id="contentTpl">
<div class="task-content"> <div class="task-content">
@ -54,14 +54,25 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
</template> </template>
<?php endif; ?> <?php endif; ?>
<div class="portlet-head" data-tpl-text="/title" data-tpl-value="/title" data-value=""><?= $this->printHtml($task->getTitle()); ?></div> <div class="portlet-head">
<div class="portlet-body"> <div class="row middle-xs">
<span id="task-status-badge" class="floatRight nobreak tag task-status-<?= $this->printHtml($task->getStatus()); ?>"> <span class="col-xs-0">
<?= $this->getHtml('S' . $task->getStatus()) ?> <img class="profile-image" alt="<?= $this->getHtml('User', '0', '0'); ?>" data-lazyload="<?= $this->getAccountImage($task->getCreatedBy()); ?>">
</span> </span>
<div> <span>
<?= $this->printHtml($task->getCreatedBy()->getName1()); ?> - <?= $this->printHtml($task->getCreatedAt()->format('Y/m/d H:i')); ?> <?= $this->printHtml($task->getCreatedBy()->getName1()); ?> - <?= $this->printHtml($task->getCreatedAt()->format('Y/m/d H:i')); ?>
</span>
<span class="col-xs end-xs plain-grid">
<span id="task-status-badge" class="nobreak tag task-status-<?= $this->printHtml($task->getStatus()); ?>">
<?= $this->getHtml('S' . $task->getStatus()) ?>
</span>
</span>
</div> </div>
</div>
<div class="portlet-body">
<span class="task-title" data-tpl-text="/title" data-tpl-value="/title" data-value="">
<?= $this->printHtml($task->getTitle()); ?>
</span>
<article class="task-content" <article class="task-content"
data-tpl-text="{/base}/api/task?id={?id}" data-tpl-text="{/base}/api/task?id={?id}"
data-tpl-value="{/base}/api/task?id={?id}" data-tpl-value="{/base}/api/task?id={?id}"
@ -69,37 +80,38 @@ echo $this->getData('nav')->render(); ?>
data-tpl-text-path="/0/response/description" data-tpl-text-path="/0/response/description"
data-value="" data-value=""
><?= $task->getDescription(); ?></article> ><?= $task->getDescription(); ?></article>
<?php if (!empty($taskMedia)) : ?>
<div class="inner">
<?php foreach ($taskMedia as $media) : ?>
<span><?= $media->getName(); ?></span>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div> </div>
<?php if ($task->isEditable()) : ?> <div class="portlet-foot row">
<div class="portlet-foot"> <div class="row col-xs plain-grid">
<div class="pAlignTable"> <div class="col-xs">
<div class="vC wf-100"> <?php if (!empty($taskMedia)) : ?>
<?php if ($task->getPriority() === TaskPriority::NONE) : ?> <div>
<?= $this->getHtml('Due') ?>: <?= $this->printHtml($task->getDue()->format('Y/m/d H:i')); ?> <?php foreach ($taskMedia as $media) : ?>
<?php else : ?> <span><?= $media->getName(); ?></span>
<?= $this->getHtml('Priority') ?>: <?= $this->getHtml('P' . $task->getPriority()) ?> <?php endforeach; ?>
</div>
<?php endif; ?>
<div>
<?php if ($task->getPriority() === TaskPriority::NONE) : ?>
<?= $this->getHtml('Due') ?>: <?= $this->printHtml($task->getDue()->format('Y/m/d H:i')); ?>
<?php else : ?>
<?= $this->getHtml('Priority') ?>: <?= $this->getHtml('P' . $task->getPriority()) ?>
<?php endif; ?>
</div>
</div>
<div class="col-xs-0 end-xs plain-grid">
<?php if ($task->isEditable() && $this->request->getHeader()->getAccount() === $task->getCreatedBy()->getId()) : ?>
<div class="col-xs end-xs plain-grid">
<button class="save hidden"><?= $this->getHtml('Save', '0', '0') ?></button>
<button class="cancel hidden"><?= $this->getHtml('Cancel', '0', '0') ?></button>
<button class="update"><?= $this->getHtml('Edit', '0', '0') ?></button>
</div>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php if ($task->isEditable() && $this->request->getHeader()->getAccount() === $task->getCreatedBy()->getId()) : ?>
<div class="vC">
<button class="save hidden"><?= $this->getHtml('Save', '0', '0') ?></button>
<button class="cancel hidden"><?= $this->getHtml('Cancel', '0', '0') ?></button>
<button class="update"><?= $this->getHtml('Edit', '0', '0') ?></button>
</div>
<?php endif; ?>
</div> </div>
</div> </div>
<?php endif; ?> </section>
</div>
<div id="elements"> <div id="elements">
<template id="elementTpl"> <template id="elementTpl">
@ -158,67 +170,73 @@ echo $this->getData('nav')->render(); ?>
<?php endif; ?> <?php endif; ?>
<?php $c = 0; $previous = null; <?php $c = 0; $previous = null;
foreach ($elements as $key => $element) : ++$c; foreach ($elements as $key => $element) : ++$c;
if ($element->getDescription() !== '') : if ($element->getDescription() !== '') : ?>
?> <section id="taskelmenet-<?= $c; ?>" class="portlet taskElement"
<section id="taskelmenet-<?= $c; ?>" class="box wf-100 taskElement"
data-update-content="#elements" data-update-content="#elements"
data-update-element=".taskElement .taskElement-content" data-update-element=".taskElement .taskElement-content"
data-tag="form" data-tag="form"
data-method="POST" data-method="POST"
data-uri="<?= \phpOMS\Uri\UriFactory::build('{/api}task/element?{?}&csrf={$CSRF}'); ?>"> data-uri="<?= \phpOMS\Uri\UriFactory::build('{/api}task/element?{?}&csrf={$CSRF}'); ?>">
<div class="inner pAlignTable"> <div class="portlet-head">
<div class="vC wf-100"> <div class="row middle-xs">
<?= $this->printHtml($element->getCreatedBy()->getName1()); ?> - <?= $this->printHtml($element->getCreatedAt()->format('Y-m-d H:i')); ?> <span class="col-xs-0">
<img class="profile-image" alt="<?= $this->getHtml('User', '0', '0'); ?>" data-lazyload="<?= $this->getAccountImage($element->getCreatedBy()); ?>">
</span>
<span class="col-xs">
<?= $this->printHtml($element->getCreatedBy()->getName1()); ?> - <?= $this->printHtml($element->getCreatedAt()->format('Y-m-d H:i')); ?>
</span>
<span class="tag task-status-<?= $this->printHtml($element->getStatus()); ?>">
<?= $this->getHtml('S' . $element->getStatus()) ?>
</span>
</div> </div>
<span class="vC tag task-status-<?= $this->printHtml($element->getStatus()); ?>">
<?= $this->getHtml('S' . $element->getStatus()) ?>
</span>
</div> </div>
<?php if ($element->getDescription() !== '') : ?> <?php if ($element->getDescription() !== '') : ?>
<div class="inner taskElement-content"> <div class="portlet-body taskElement-content">
<article data-tpl-text="/content" data-tpl-value="{/api}task/element?id={?id}" data-tpl-value-path="/0/response/description" data-value=""><?= $element->getDescription(); ?></article> <article data-tpl-text="/content" data-tpl-value="{/api}task/element?id={?id}" data-tpl-value-path="/0/response/description" data-value=""><?= $element->getDescription(); ?></article>
</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" style="background: #efefef; border-top: 1px solid #dfdfdf;"> <div class="portlet-foot row middle-xs">
<?php if ($element->getStatus() !== TaskStatus::CANCELED <?php $elementMedia = $element->getMedia();
|| $element->getStatus() !== TaskStatus::DONE if (!empty($elementMedia)) : ?>
|| $element->getStatus() !== TaskStatus::SUSPENDED <div>
|| $c != $cElements <?php foreach ($elementMedia as $media) : ?>
) : ?> <span><?= $media->getName(); ?></span>
<div class="vC wf-100 nobreak"> <?php endforeach; ?>
<?php </div>
if ($element->getPriority() === TaskPriority::NONE <?php endif; ?>
&& ($previous !== null
&& $previous->getDue()->format('Y/m/d H:i') !== $element->getDue()->format('Y/m/d H:i')
)
) : ?>
<?= $this->getHtml('Due') ?>: <?= $this->printHtml($element->getDue()->format('Y/m/d H:i')); ?>
<?php elseif ($previous !== null && $previous->getPriority() !== $element->getPriority()) : ?>
<?= $this->getHtml('Priority') ?>: <?= $this->getHtml('P' . $element->getPriority()) ?>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($task->isEditable() <?php if ($element->getStatus() !== TaskStatus::CANCELED
&& $this->request->getHeader()->getAccount() === $element->getCreatedBy()->getId() || $element->getStatus() !== TaskStatus::DONE
) : ?> || $element->getStatus() !== TaskStatus::SUSPENDED
<div class="vC"> || $c != $cElements
<input type="hidden" value="<?= $element->getId(); ?>" name="id"> ) : ?>
<button class="save hidden"><?= $this->getHtml('Save', '0', '0') ?></button> <div>
<button class="cancel hidden"><?= $this->getHtml('Cancel', '0', '0') ?></button> <?php
<button class="update"><?= $this->getHtml('Edit', '0', '0') ?></button> if ($element->getPriority() === TaskPriority::NONE
</div> && ($previous !== null
<?php endif; ?> && $previous->getDue()->format('Y/m/d H:i') !== $element->getDue()->format('Y/m/d H:i')
)
) : ?>
<?= $this->getHtml('Due') ?>: <?= $this->printHtml($element->getDue()->format('Y/m/d H:i')); ?>
<?php elseif ($previous !== null && $previous->getPriority() !== $element->getPriority()) : ?>
<?= $this->getHtml('Priority') ?>: <?= $this->getHtml('P' . $element->getPriority()) ?>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($task->isEditable()
&& $this->request->getHeader()->getAccount() === $element->getCreatedBy()->getId()
) : ?>
<div class="col-xs end-xs plain-grid">
<input type="hidden" value="<?= $element->getId(); ?>" name="id">
<button class="save hidden"><?= $this->getHtml('Save', '0', '0') ?></button>
<button class="cancel hidden"><?= $this->getHtml('Cancel', '0', '0') ?></button>
<button class="update"><?= $this->getHtml('Edit', '0', '0') ?></button>
</div>
<?php endif; ?>
</section> </section>
<?php endif; ?> <?php endif; ?>

25
Views/TaskView.php Normal file → Executable file
View File

@ -16,6 +16,9 @@ namespace Modules\Tasks\Views;
use Modules\Tasks\Models\TaskStatus; use Modules\Tasks\Models\TaskStatus;
use phpOMS\Views\View; use phpOMS\Views\View;
use phpOMS\Uri\UriFactory;
use Modules\Admin\Models\Account;
use Modules\Profile\Models\ProfileMapper;
/** /**
* Task view class. * Task view class.
@ -27,6 +30,28 @@ use phpOMS\Views\View;
*/ */
class TaskView extends View class TaskView extends View
{ {
/**
* Get the profile image
*
* If the profile doesn't have an image a random default image is used
*
* @param Account $account Account
*
* @return string
*
* @since 1.0.0
*/
public function getAccountImage(Account $account) : string
{
$profile = ProfileMapper::getFor($account->getId(), 'account');
if ($profile === null || $profile->getImage()->getPath() === '') {
return UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) . '.png');
}
return UriFactory::build($profile->getImage()->getPath());
}
/** /**
* Get task status color. * Get task status color.
* *

0
composer.json Normal file → Executable file
View File

0
composer.lock generated Normal file → Executable file
View File

0
img/module_teaser_small.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

0
info.json Normal file → Executable file
View File

0
tests/Admin/AdminTest.php Normal file → Executable file
View File

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

0
tests/ControllerTest.php Normal file → Executable file
View File

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

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

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

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

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

0
tests/Tasks.side Normal file → Executable file
View File