autofixes

This commit is contained in:
Dennis Eichhorn 2020-08-30 20:13:11 +02:00
parent df31c240a9
commit 52572c7004
9 changed files with 41 additions and 27 deletions

View File

@ -27,5 +27,6 @@ use phpOMS\Stdlib\Base\Enum;
abstract class PermissionState extends Enum
{
public const WORKFLOW = 1;
public const TEMPLATE = 2;
}

View File

@ -27,9 +27,14 @@ use phpOMS\Stdlib\Base\Enum;
abstract class WorkflowStatus extends Enum
{
public const OPEN = 1;
public const WORKING = 2;
public const SUSPENDED = 3;
public const CANCELED = 4;
public const DONE = 5;
public const CLOSED = 6;
}

View File

@ -27,6 +27,8 @@ use phpOMS\Stdlib\Base\Enum;
abstract class PermissionStatus extends Enum
{
public const PENDING = 1;
public const APPROVED = 2;
public const DISMISSED = 3;
}

View File

@ -27,7 +27,10 @@ use phpOMS\Stdlib\Base\Enum;
abstract class States extends Enum
{
public const DEFAULT = 0;
public const PENDING = 1;
public const APPROVED = 2;
public const DISMISSED = 3;
}

View File

@ -28,7 +28,9 @@ use phpOMS\DataStorage\Database\Connection\ConnectionAbstract;
class Workflow implements WorkflowInterface
{
private $id = 0;
private $state = 0;
private $con = null;
/**

View File

@ -16,21 +16,21 @@ declare(strict_types=1);
echo $this->getData('nav')->render(); ?>
<section class="box w-50 floatLeft">
<header><h1><?= $this->getHtml('Task') ?></h1></header>
<header><h1><?= $this->getHtml('Task'); ?></h1></header>
<div class="inner">
<form id="fTask" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/api}task/create'); ?>">
<table class="layout wf-100">
<tbody>
<tr><td colspan="2"><label for="iReceiver"><?= $this->getHtml('To') ?></label>
<tr><td colspan="2"><label for="iReceiver"><?= $this->getHtml('To'); ?></label>
<tr><td><span class="input"><button type="button" data-action='[{"type": "popup", "tpl": "acc-grp-tpl", "aniIn": "fadeIn", "aniOut": "fadeOut", "stay": 5000}]' formaction=""><i class="fa fa-book"></i></button><input type="number" min="1" id="iReceiver" name="receiver" placeholder="&#xf007; Guest" required></span><td><button><?= $this->getHtml('Add', '0', '0'); ?></button>
<tr><td colspan="2"><label for="iObserver"><?= $this->getHtml('CC') ?></label>
<tr><td colspan="2"><label for="iObserver"><?= $this->getHtml('CC'); ?></label>
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="number" min="1" id="iObserver" name="observer" placeholder="&#xf007; Guest" required></span><td><button><?= $this->getHtml('Add', '0', '0'); ?></button>
<tr><td colspan="2"><label for="iDue"><?= $this->getHtml('Due') ?></label>
<tr><td colspan="2"><label for="iDue"><?= $this->getHtml('Due'); ?></label>
<tr><td><input type="datetime-local" id="iDue" name="due" value="<?= $this->printHtml((new \DateTime('NOW'))->format('Y-m-d\TH:i:s')); ?>"><td>
<tr><td colspan="2"><label for="iTitle"><?= $this->getHtml('Title') ?></label>
<tr><td><input type="text" id="iTitle" name="title" placeholder="&#xf040; <?= $this->getHtml('Title') ?>"><td>
<tr><td colspan="2"><label for="iMessage"><?= $this->getHtml('Message') ?></label>
<tr><td colspan="2"><label for="iTitle"><?= $this->getHtml('Title'); ?></label>
<tr><td><input type="text" id="iTitle" name="title" placeholder="&#xf040; <?= $this->getHtml('Title'); ?>"><td>
<tr><td colspan="2"><label for="iMessage"><?= $this->getHtml('Message'); ?></label>
<tr><td><textarea id="iMessage" name="description" placeholder="&#xf040;"></textarea><td>
<tr><td colspan="2"><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>"><input type="hidden" name="type" value="<?= $this->printHtml(\Modules\Tasks\Models\TaskType::SINGLE); ?>">
</table>
@ -39,15 +39,15 @@ echo $this->getData('nav')->render(); ?>
</section>
<section class="box w-50 floatLeft">
<header><h1><?= $this->getHtml('Media') ?></h1></header>
<header><h1><?= $this->getHtml('Media'); ?></h1></header>
<div class="inner">
<form>
<table class="layout wf-100">
<tbody>
<tr><td colspan="2"><label for="iMedia"><?= $this->getHtml('Media') ?></label>
<tr><td><input type="text" id="iMedia" placeholder="&#xf15b; File"><td><button><?= $this->getHtml('Select') ?></button>
<tr><td colspan="2"><label for="iUpload"><?= $this->getHtml('Upload') ?></label>
<tr><td colspan="2"><label for="iMedia"><?= $this->getHtml('Media'); ?></label>
<tr><td><input type="text" id="iMedia" placeholder="&#xf15b; File"><td><button><?= $this->getHtml('Select'); ?></button>
<tr><td colspan="2"><label for="iUpload"><?= $this->getHtml('Upload'); ?></label>
<tr><td><input type="file" id="iUpload" form="fTask"><input form="fTask" type="hidden" name="type"><td>
</table>
</form>

View File

@ -22,14 +22,14 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Workflow') ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="portlet-head"><?= $this->getHtml('Workflow'); ?><i class="fa fa-download floatRight download btn"></i></div>
<table class="default">
<thead>
<td><?= $this->getHtml('Status') ?>
<td><?= $this->getHtml('Next') ?>
<td class="full"><?= $this->getHtml('Title') ?>
<td><?= $this->getHtml('Creator') ?>
<td><?= $this->getHtml('Created') ?>
<td><?= $this->getHtml('Status'); ?>
<td><?= $this->getHtml('Next'); ?>
<td class="full"><?= $this->getHtml('Title'); ?>
<td><?= $this->getHtml('Creator'); ?>
<td><?= $this->getHtml('Created'); ?>
<tfoot>
<tbody>
<?php $c = 0; foreach ($workflows as $key => $workflow) : ++$c;
@ -41,11 +41,11 @@ echo $this->getData('nav')->render(); ?>
elseif ($workflow->getStatus() === \Modules\Workflow\Models\WorkflowStatus::CANCELED) { $color = 'red'; }
elseif ($workflow->getStatus() === \Modules\Workflow\Models\WorkflowStatus::SUSPENDED) { $color = 'yellow'; } ?>
<tr>
<td data-label="<?= $this->getHtml('Status') ?>"><a href="<?= $url; ?>"><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('S' . $workflow->getStatus()) ?></span></a>
<td data-label="<?= $this->getHtml('Next') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getDue()->format('Y-m-d H:i')); ?></a>
<td data-label="<?= $this->getHtml('Title') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getTitle()); ?></a>
<td data-label="<?= $this->getHtml('Creator') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getCreatedBy()->getId()); ?></a>
<td data-label="<?= $this->getHtml('Created') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getCreatedAt()->format('Y-m-d H:i')); ?></a>
<td data-label="<?= $this->getHtml('Status'); ?>"><a href="<?= $url; ?>"><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('S' . $workflow->getStatus()); ?></span></a>
<td data-label="<?= $this->getHtml('Next'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getDue()->format('Y-m-d H:i')); ?></a>
<td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getTitle()); ?></a>
<td data-label="<?= $this->getHtml('Creator'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getCreatedBy()->getId()); ?></a>
<td data-label="<?= $this->getHtml('Created'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getCreatedAt()->format('Y-m-d H:i')); ?></a>
<?php endforeach; if ($c == 0) : ?>
<tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>

View File

@ -43,7 +43,7 @@ foreach ($elements as $key => $element) : ++$c;
elseif ($element->getStatus() === \Modules\Tasks\Models\TaskStatus::CANCELED) { $color = 'red'; }
elseif ($element->getStatus() === \Modules\Tasks\Models\TaskStatus::SUSPENDED) { $color = 'yellow'; } ?>
<section class="box w-50">
<div class="floatRight"><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('S' . $element->getStatus()) ?></span></div>
<div class="floatRight"><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('S' . $element->getStatus()); ?></span></div>
<div><?= $this->printHtml($element->getCreatedBy()->getId()); ?> - <?= $this->printHtml($element->getCreatedAt()->format('Y-m-d H:i')); ?></div>
</section>
<?php if ($element->getDescription() !== '') : ?>
@ -72,15 +72,15 @@ foreach ($elements as $key => $element) : ++$c;
<div class="inner">
<form>
<table class="layout wf-100">
<tr><td><label for="iMessage"><?= $this->getHtml('Message') ?></label>
<tr><td><label for="iMessage"><?= $this->getHtml('Message'); ?></label>
<tr><td><textarea></textarea>
<tr><td><label for="iDue"><?= $this->getHtml('Due') ?></label>
<tr><td><label for="iDue"><?= $this->getHtml('Due'); ?></label>
<tr><td><input type="datetime-local">
<tr><td><label for="iReceiver"><?= $this->getHtml('Status') ?></label>
<tr><td><label for="iReceiver"><?= $this->getHtml('Status'); ?></label>
<tr><td><select>
<option>
</select>
<tr><td><label for="iReceiver"><?= $this->getHtml('To') ?></label>
<tr><td><label for="iReceiver"><?= $this->getHtml('To'); ?></label>
<tr><td><input type="text" id="iReceiver" placeholder="&#xf007; Guest">
<tr><td><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>"><input type="hidden" name="type" value="1">
</table>

View File

@ -20,6 +20,7 @@ namespace Modules\Workflow\tests\Admin;
class AdminTest extends \PHPUnit\Framework\TestCase
{
protected const MODULE_NAME = 'Workflow';
protected const URI_LOAD = '';
use \Modules\tests\ModuleTestTrait;