autofixes

This commit is contained in:
Dennis Eichhorn 2020-08-30 20:13:10 +02:00
parent e2c7d8044c
commit 268320f6fd
6 changed files with 32 additions and 26 deletions

View File

@ -52,6 +52,7 @@ class Event
* @since 1.0.0
*/
private string $name = '';
/**
* Description.
*
@ -125,7 +126,7 @@ class Event
return $this->id;
}
/**
/**
* Get media files.
*
* @return array

View File

@ -27,8 +27,12 @@ use phpOMS\Stdlib\Base\Enum;
abstract class ProgressType extends Enum
{
public const MANUAL = 0;
public const LINEAR = 1;
public const EXPONENTIAL = 2;
public const LOG = 3;
public const TASKS = 4;
}

View File

@ -18,28 +18,28 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getHtml('Event') ?></h1></header>
<header><h1><?= $this->getHtml('Event'); ?></h1></header>
<div class="inner">
<form>
<table class="layout wf-100">
<tr><td colspan="3"><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td colspan="3"><label for="iName"><?= $this->getHtml('Name'); ?></label>
<tr><td colspan="2"><input type="text" id="iName" name="name" placeholder="" required><td>
<tr><td colspan="3"><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td colspan="3"><label for="iDescription"><?= $this->getHtml('Description'); ?></label>
<tr><td colspan="2"><textarea id="iDescription" name="description"></textarea><td>
<tr><td colspan="3"><label for="iStatus"><?= $this->getHtml('Status') ?></label>
<tr><td colspan="3"><label for="iStatus"><?= $this->getHtml('Status'); ?></label>
<tr><td colspan="2"><select id="iStatus" name="status">
<option value="">
</select><td>
<tr><td colspan="3"><label for="iFiles"><?= $this->getHtml('Files') ?></label>
<tr><td colspan="3"><label for="iFiles"><?= $this->getHtml('Files'); ?></label>
<tr><td colspan="2"><input type="file" id="iFiles" name="file" multiple><td>
<tr><td><label for="iStart"><?= $this->getHtml('Start'); ?><label><td><label for="iEnd"><?= $this->getHtml('End'); ?><label><td>
<tr><td><input type="datetime-local" id="iStart" name="start" required><td><input type="datetime-local" id="iEnd" name="end" required><td>
<tr><td><label for="iResponsibility"><?= $this->getHtml('Responsibility') ?></label><td><label for="iUser"><?= $this->getHtml('UserGroup') ?></label><td>
<tr><td><label for="iResponsibility"><?= $this->getHtml('Responsibility'); ?></label><td><label for="iUser"><?= $this->getHtml('UserGroup'); ?></label><td>
<tr><td><select id="iStatus" name="status">
<option value="">
</select>
<td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" id="iUser" name="user" placeholder=""></span><td><button><?= $this->getHtml('Add', '0', '0'); ?></button>
<tr><td colspan="3"><label for="iBudget"><?= $this->getHtml('Budget') ?></label>
<tr><td colspan="3"><label for="iBudget"><?= $this->getHtml('Budget'); ?></label>
<tr><td colspan="2"><input type="text" id="iBudget" name="budget" placeholder=""><td>
<tr><td colspan="3"><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
</table>

View File

@ -29,16 +29,16 @@ echo $this->getData('nav')->render(); ?>
<table class="default">
<thead>
<tr>
<td class="wf-100"><?= $this->getHtml('Title') ?>
<td><?= $this->getHtml('Start') ?>
<td><?= $this->getHtml('End') ?>
<td class="wf-100"><?= $this->getHtml('Title'); ?>
<td><?= $this->getHtml('Start'); ?>
<td><?= $this->getHtml('End'); ?>
<tbody>
<?php $count = 0; foreach ($events as $key => $value) : ++$count;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}eventmanagement/profile?{?}&id=' . $value->getId());?>
$url = \phpOMS\Uri\UriFactory::build('{/prefix}eventmanagement/profile?{?}&id=' . $value->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<td data-label="<?= $this->getHtml('Start') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getStart()->format('Y-m-d')); ?></a>
<td data-label="<?= $this->getHtml('End') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getEnd()->format('Y-m-d')); ?></a>
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<td data-label="<?= $this->getHtml('Start'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getStart()->format('Y-m-d')); ?></a>
<td data-label="<?= $this->getHtml('End'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getEnd()->format('Y-m-d')); ?></a>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>

View File

@ -26,24 +26,24 @@ echo $this->getData('nav')->render(); ?>
<form id="fEvent" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/api}eventmanagement?{?}&csrf={$CSRF}'); ?>">
<table class="layout wf-100">
<tbody>
<tr><td colspan="2"><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td colspan="2"><label for="iName"><?= $this->getHtml('Name'); ?></label>
<tr><td colspan="2"><input type="text" id="iName" name="name" placeholder="&#xf007; Name" value="<?= $this->printHtml($event->getName()); ?>" required>
<tr><td><label for="iStart"><?= $this->getHtml('Start') ?></label>
<td><label for="iEnd"><?= $this->getHtml('End') ?></label>
<tr><td><label for="iStart"><?= $this->getHtml('Start'); ?></label>
<td><label for="iEnd"><?= $this->getHtml('End'); ?></label>
<tr><td><input type="datetime-local" id="iStart" name="start" value="<?= $this->printHtml($event->getStart()->format('Y-m-d\TH:i:s')); ?>">
<td><input type="datetime-local" id="iEnd" name="end" value="<?= $this->printHtml($event->getEnd()->format('Y-m-d\TH:i:s')); ?>">
<tr><td colspan="2"><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td colspan="2"><label for="iDescription"><?= $this->getHtml('Description'); ?></label>
<tr><td colspan="2"><textarea id="iDescription" name="desc"><?= $this->printHtml($event->getDescription()); ?></textarea>
<tr><td colspan="2"><label for="iProgressType"><?= $this->getHtml('Progress') ?></label>
<tr><td colspan="2"><label for="iProgressType"><?= $this->getHtml('Progress'); ?></label>
<tr><td><select id="iProgressType" name="progressType">
<option value="<?= \Modules\EventManagement\Models\ProgressType::MANUAL; ?>"><?= $this->getHtml('Manual') ?>
<option value="<?= \Modules\EventManagement\Models\ProgressType::LINEAR; ?>"><?= $this->getHtml('Linear') ?>
<option value="<?= \Modules\EventManagement\Models\ProgressType::EXPONENTIAL; ?>"><?= $this->getHtml('Exponential') ?>
<option value="<?= \Modules\EventManagement\Models\ProgressType::LOG; ?>"><?= $this->getHtml('Log') ?>
<option value="<?= \Modules\EventManagement\Models\ProgressType::TASKS; ?>"><?= $this->getHtml('Tasks') ?>
<option value="<?= \Modules\EventManagement\Models\ProgressType::MANUAL; ?>"><?= $this->getHtml('Manual'); ?>
<option value="<?= \Modules\EventManagement\Models\ProgressType::LINEAR; ?>"><?= $this->getHtml('Linear'); ?>
<option value="<?= \Modules\EventManagement\Models\ProgressType::EXPONENTIAL; ?>"><?= $this->getHtml('Exponential'); ?>
<option value="<?= \Modules\EventManagement\Models\ProgressType::LOG; ?>"><?= $this->getHtml('Log'); ?>
<option value="<?= \Modules\EventManagement\Models\ProgressType::TASKS; ?>"><?= $this->getHtml('Tasks'); ?>
</select>
<td><input type="text" id="iProgress" name="progress" value="<?= $event->getProgress(); ?>"<?= $event->getProgressType() !== \Modules\EventManagement\Models\ProgressType::MANUAL ? ' disabled' : ''; ?>>
<tr><td><label for="iBudget"><?= $this->getHtml('Budget') ?></label><td><label for="iActual"><?= $this->getHtml('Actual') ?></label>
<tr><td><label for="iBudget"><?= $this->getHtml('Budget'); ?></label><td><label for="iActual"><?= $this->getHtml('Actual'); ?></label>
<tr><td><input type="text" id="iBudget" name="budget" placeholder=""><td><input type="text" id="iActual" name="actual">
<tr><td colspan="2"><input type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</table>

View File

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