autofixes

This commit is contained in:
Dennis Eichhorn 2020-08-30 20:13:11 +02:00
parent 3787703c9c
commit 8ee2071d8d
10 changed files with 36 additions and 30 deletions

View File

@ -34,7 +34,6 @@ use phpOMS\Views\View;
* While costs are universal the goal for promotions, events etc. is not. * While costs are universal the goal for promotions, events etc. is not.
* In some cases it could be sales in others it could be response rate etc. * In some cases it could be sales in others it could be response rate etc.
* Implement a way to define goals and allow manual+system side evaluation. * Implement a way to define goals and allow manual+system side evaluation.
*
*/ */
final class BackendController extends Controller final class BackendController extends Controller
{ {

View File

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

View File

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

View File

@ -49,6 +49,7 @@ class Promotion
* @since 1.0.0 * @since 1.0.0
*/ */
private string $name = ''; private string $name = '';
/** /**
* Description. * Description.
* *

View File

@ -28,13 +28,13 @@ echo $this->getData('nav')->render(); ?>
<tbody> <tbody>
<tr><td colspan="2"><label for="iTitle"><?= $this->getHtml('Type'); ?></label> <tr><td colspan="2"><label for="iTitle"><?= $this->getHtml('Type'); ?></label>
<tr><td colspan="2"><select></select> <tr><td colspan="2"><select></select>
<tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Title') ?></label> <tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Title'); ?></label>
<tr><td colspan="2"><input type="text"> <tr><td colspan="2"><input type="text">
<tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Description') ?></label> <tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Description'); ?></label>
<tr><td colspan="2"><textarea></textarea> <tr><td colspan="2"><textarea></textarea>
<tr><td><label for="iTitle"><?= $this->getHtml('Start'); ?></label><td><label for="iTitle"><?= $this->getHtml('End'); ?></label> <tr><td><label for="iTitle"><?= $this->getHtml('Start'); ?></label><td><label for="iTitle"><?= $this->getHtml('End'); ?></label>
<tr><td><input type="datetime-local"><td><input type="datetime-local"> <tr><td><input type="datetime-local"><td><input type="datetime-local">
<tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Budget') ?></label> <tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Budget'); ?></label>
<tr><td colspan="2"><input type="text" id="iBudget" name="budget" placeholder=""> <tr><td colspan="2"><input type="text" id="iBudget" name="budget" placeholder="">
</table> </table>
</form> </form>

View File

@ -27,15 +27,15 @@ echo $this->getData('nav')->render(); ?>
<table class="default"> <table class="default">
<thead> <thead>
<tr> <tr>
<td><?= $this->getHtml('Status') ?> <td><?= $this->getHtml('Status'); ?>
<td><?= $this->getHtml('Type') ?> <td><?= $this->getHtml('Type'); ?>
<td class="wf-100"><?= $this->getHtml('Title') ?> <td class="wf-100"><?= $this->getHtml('Title'); ?>
<td><?= $this->getHtml('Start') ?> <td><?= $this->getHtml('Start'); ?>
<td><?= $this->getHtml('End') ?> <td><?= $this->getHtml('End'); ?>
<td><?= $this->getHtml('Location') ?> <td><?= $this->getHtml('Location'); ?>
<td><?= $this->getHtml('Expenses') ?> <td><?= $this->getHtml('Expenses'); ?>
<td><?= $this->getHtml('Sales') ?> <td><?= $this->getHtml('Sales'); ?>
<td><?= $this->getHtml('Budget') ?> <td><?= $this->getHtml('Budget'); ?>
<tbody> <tbody>
<?php $count = 0; foreach ([] as $key => $value) : ++$count; ?> <?php $count = 0; foreach ([] as $key => $value) : ++$count; ?>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -28,15 +28,15 @@ echo $this->getData('nav')->render(); ?>
<tbody> <tbody>
<tr><td colspan="2"><label for="iTitle"><?= $this->getHtml('Type'); ?></label> <tr><td colspan="2"><label for="iTitle"><?= $this->getHtml('Type'); ?></label>
<tr><td colspan="2"><select></select> <tr><td colspan="2"><select></select>
<tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Title') ?></label> <tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Title'); ?></label>
<tr><td colspan="2"><input type="text"> <tr><td colspan="2"><input type="text">
<tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Description') ?></label> <tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Description'); ?></label>
<tr><td colspan="2"><textarea></textarea> <tr><td colspan="2"><textarea></textarea>
<tr><td><label for="iTitle"><?= $this->getHtml('Start') ?></label><td><label for="iTitle"><?= $this->getHtml('End') ?></label> <tr><td><label for="iTitle"><?= $this->getHtml('Start'); ?></label><td><label for="iTitle"><?= $this->getHtml('End'); ?></label>
<tr><td><input type="datetime-local"><td><input type="datetime-local"> <tr><td><input type="datetime-local"><td><input type="datetime-local">
<tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Budget') ?></label> <tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Budget'); ?></label>
<tr><td colspan="2"><input type="text" id="iBudget" name="budget" placeholder=""> <tr><td colspan="2"><input type="text" id="iBudget" name="budget" placeholder="">
<tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Limit') ?></label> <tr><td colspan="2"><label for="iBudget"><?= $this->getHtml('Limit'); ?></label>
<tr><td colspan="2"><input type="text"> <tr><td colspan="2"><input type="text">
<tr><td colspan="2"><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>"> <tr><td colspan="2"><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
</table> </table>

View File

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

View File

@ -25,15 +25,15 @@ echo $this->getData('nav')->render(); ?>
<form id="fProject" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/api}marketing/promotion?{?}&csrf={$CSRF}'); ?>"> <form id="fProject" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/api}marketing/promotion?{?}&csrf={$CSRF}'); ?>">
<table class="layout wf-100"> <table class="layout wf-100">
<tbody> <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($promotion->getName()); ?>" required> <tr><td colspan="2"><input type="text" id="iName" name="name" placeholder="&#xf007; Name" value="<?= $this->printHtml($promotion->getName()); ?>" required>
<tr><td><label for="iStart"><?= $this->getHtml('Start') ?></label> <tr><td><label for="iStart"><?= $this->getHtml('Start'); ?></label>
<td><label for="iEnd"><?= $this->getHtml('End') ?></label> <td><label for="iEnd"><?= $this->getHtml('End'); ?></label>
<tr><td><input type="datetime-local" id="iStart" name="start" value="<?= $this->printHtml($promotion->getStart()->format('Y-m-d\TH:i:s')); ?>"> <tr><td><input type="datetime-local" id="iStart" name="start" value="<?= $this->printHtml($promotion->getStart()->format('Y-m-d\TH:i:s')); ?>">
<td><input type="datetime-local" id="iEnd" name="end" value="<?= $this->printHtml($promotion->getEnd()->format('Y-m-d\TH:i:s')); ?>"> <td><input type="datetime-local" id="iEnd" name="end" value="<?= $this->printHtml($promotion->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($promotion->getDescription()); ?></textarea> <tr><td colspan="2"><textarea id="iDescription" name="desc"><?= $this->printHtml($promotion->getDescription()); ?></textarea>
<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><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'); ?>"> <tr><td colspan="2"><input type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</table> </table>

View File

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