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 abstract class PermissionState extends Enum
{ {
public const WORKFLOW = 1; public const WORKFLOW = 1;
public const TEMPLATE = 2; public const TEMPLATE = 2;
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -16,21 +16,21 @@ declare(strict_types=1);
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
<section class="box w-50 floatLeft"> <section class="box w-50 floatLeft">
<header><h1><?= $this->getHtml('Task') ?></h1></header> <header><h1><?= $this->getHtml('Task'); ?></h1></header>
<div class="inner"> <div class="inner">
<form id="fTask" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/api}task/create'); ?>"> <form id="fTask" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/api}task/create'); ?>">
<table class="layout wf-100"> <table class="layout wf-100">
<tbody> <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><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><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><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 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><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="iMessage"><?= $this->getHtml('Message'); ?></label>
<tr><td><textarea id="iMessage" name="description" placeholder="&#xf040;"></textarea><td> <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); ?>"> <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> </table>
@ -39,15 +39,15 @@ echo $this->getData('nav')->render(); ?>
</section> </section>
<section class="box w-50 floatLeft"> <section class="box w-50 floatLeft">
<header><h1><?= $this->getHtml('Media') ?></h1></header> <header><h1><?= $this->getHtml('Media'); ?></h1></header>
<div class="inner"> <div class="inner">
<form> <form>
<table class="layout wf-100"> <table class="layout wf-100">
<tbody> <tbody>
<tr><td colspan="2"><label for="iMedia"><?= $this->getHtml('Media') ?></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><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="iUpload"><?= $this->getHtml('Upload'); ?></label>
<tr><td><input type="file" id="iUpload" form="fTask"><input form="fTask" type="hidden" name="type"><td> <tr><td><input type="file" id="iUpload" form="fTask"><input form="fTask" type="hidden" name="type"><td>
</table> </table>
</form> </form>

View File

@ -22,14 +22,14 @@ echo $this->getData('nav')->render(); ?>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="portlet"> <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"> <table class="default">
<thead> <thead>
<td><?= $this->getHtml('Status') ?> <td><?= $this->getHtml('Status'); ?>
<td><?= $this->getHtml('Next') ?> <td><?= $this->getHtml('Next'); ?>
<td class="full"><?= $this->getHtml('Title') ?> <td class="full"><?= $this->getHtml('Title'); ?>
<td><?= $this->getHtml('Creator') ?> <td><?= $this->getHtml('Creator'); ?>
<td><?= $this->getHtml('Created') ?> <td><?= $this->getHtml('Created'); ?>
<tfoot> <tfoot>
<tbody> <tbody>
<?php $c = 0; foreach ($workflows as $key => $workflow) : ++$c; <?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::CANCELED) { $color = 'red'; }
elseif ($workflow->getStatus() === \Modules\Workflow\Models\WorkflowStatus::SUSPENDED) { $color = 'yellow'; } ?> elseif ($workflow->getStatus() === \Modules\Workflow\Models\WorkflowStatus::SUSPENDED) { $color = 'yellow'; } ?>
<tr> <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('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('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('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('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('Created'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($workflow->getCreatedAt()->format('Y-m-d H:i')); ?></a>
<?php endforeach; if ($c == 0) : ?> <?php endforeach; if ($c == 0) : ?>
<tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?> <tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?> <?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::CANCELED) { $color = 'red'; }
elseif ($element->getStatus() === \Modules\Tasks\Models\TaskStatus::SUSPENDED) { $color = 'yellow'; } ?> elseif ($element->getStatus() === \Modules\Tasks\Models\TaskStatus::SUSPENDED) { $color = 'yellow'; } ?>
<section class="box w-50"> <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> <div><?= $this->printHtml($element->getCreatedBy()->getId()); ?> - <?= $this->printHtml($element->getCreatedAt()->format('Y-m-d H:i')); ?></div>
</section> </section>
<?php if ($element->getDescription() !== '') : ?> <?php if ($element->getDescription() !== '') : ?>
@ -72,15 +72,15 @@ foreach ($elements as $key => $element) : ++$c;
<div class="inner"> <div class="inner">
<form> <form>
<table class="layout wf-100"> <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><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><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> <tr><td><select>
<option> <option>
</select> </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="text" id="iReceiver" placeholder="&#xf007; Guest">
<tr><td><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>"><input type="hidden" name="type" value="1"> <tr><td><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>"><input type="hidden" name="type" value="1">
</table> </table>

View File

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