autofixes

This commit is contained in:
Dennis Eichhorn 2020-08-30 20:13:11 +02:00
parent af47a45c01
commit 9a46e411fe
7 changed files with 43 additions and 33 deletions

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

@ -27,5 +27,6 @@ use phpOMS\Stdlib\Base\Enum;
abstract class ProjectResponsibility extends Enum
{
public const MANAGER = 0;
public const OTHER = 1;
}

View File

@ -27,8 +27,12 @@ use phpOMS\Stdlib\Base\Enum;
abstract class ProjectStatus extends Enum
{
public const ACTIVE = 0;
public const INACTIVE = 1;
public const HOLD = 2;
public const CANCELED = 3;
public const FINISHED = 4;
}

View File

@ -18,33 +18,33 @@ 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('Project') ?></h1></header>
<header><h1><?= $this->getHtml('Project'); ?></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="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectStatus::ACTIVE); ?>"><?= $this->getHtml('Active') ?>
<option value="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectStatus::INACTIVE); ?>"><?= $this->getHtml('Inactive') ?>
<option value="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectStatus::FINISHED); ?>"><?= $this->getHtml('Finished') ?>
<option value="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectStatus::CANCELED); ?>"><?= $this->getHtml('Canceled') ?>
<option value="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectStatus::HOLD); ?>"><?= $this->getHtml('Hold') ?>
<option value="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectStatus::ACTIVE); ?>"><?= $this->getHtml('Active'); ?>
<option value="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectStatus::INACTIVE); ?>"><?= $this->getHtml('Inactive'); ?>
<option value="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectStatus::FINISHED); ?>"><?= $this->getHtml('Finished'); ?>
<option value="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectStatus::CANCELED); ?>"><?= $this->getHtml('Canceled'); ?>
<option value="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectStatus::HOLD); ?>"><?= $this->getHtml('Hold'); ?>
</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="iDue"><?= $this->getHtml('Start') ?></label><td><label for="iDue"><?= $this->getHtml('Due') ?></label><td>
<tr><td><label for="iDue"><?= $this->getHtml('Start'); ?></label><td><label for="iDue"><?= $this->getHtml('Due'); ?></label><td>
<tr><td><input type="datetime-local" id="iDue" name="due"><td><input type="datetime-local" id="iDue" name="due"><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="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectResponsibility::MANAGER); ?>"><?= $this->getHtml('Manager') ?>
<option value="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectResponsibility::OTHER); ?>"><?= $this->getHtml('Other') ?>
<option value="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectResponsibility::MANAGER); ?>"><?= $this->getHtml('Manager'); ?>
<option value="<?= $this->printHtml(\Modules\ProjectManagement\Models\ProjectResponsibility::OTHER); ?>"><?= $this->getHtml('Other'); ?>
</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('Due') ?>
<td class="wf-100"><?= $this->getHtml('Title'); ?>
<td><?= $this->getHtml('Start'); ?>
<td><?= $this->getHtml('Due'); ?>
<tbody>
<?php $count = 0; foreach ($list as $key => $value) : ++$count;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}projectmanagement/profile?{?}&id=' . $value->getId());?>
$url = \phpOMS\Uri\UriFactory::build('{/prefix}projectmanagement/profile?{?}&id=' . $value->getId()); ?>
<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('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('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('Due'); ?>"><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

@ -24,24 +24,24 @@ echo $this->getData('nav')->render(); ?>
<form id="fProject" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/api}projectmanagement?{?}&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($project->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($project->getStart()->format('Y-m-d\TH:i:s')); ?>">
<td><input type="datetime-local" id="iEnd" name="end" value="<?= $this->printHtml($project->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($project->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\ProjectManagement\Models\ProgressType::MANUAL; ?>"><?= $this->getHtml('Manual') ?>
<option value="<?= \Modules\ProjectManagement\Models\ProgressType::LINEAR; ?>"><?= $this->getHtml('Linear') ?>
<option value="<?= \Modules\ProjectManagement\Models\ProgressType::EXPONENTIAL; ?>"><?= $this->getHtml('Exponential') ?>
<option value="<?= \Modules\ProjectManagement\Models\ProgressType::LOG; ?>"><?= $this->getHtml('Log') ?>
<option value="<?= \Modules\ProjectManagement\Models\ProgressType::TASKS; ?>"><?= $this->getHtml('Tasks') ?>
<option value="<?= \Modules\ProjectManagement\Models\ProgressType::MANUAL; ?>"><?= $this->getHtml('Manual'); ?>
<option value="<?= \Modules\ProjectManagement\Models\ProgressType::LINEAR; ?>"><?= $this->getHtml('Linear'); ?>
<option value="<?= \Modules\ProjectManagement\Models\ProgressType::EXPONENTIAL; ?>"><?= $this->getHtml('Exponential'); ?>
<option value="<?= \Modules\ProjectManagement\Models\ProgressType::LOG; ?>"><?= $this->getHtml('Log'); ?>
<option value="<?= \Modules\ProjectManagement\Models\ProgressType::TASKS; ?>"><?= $this->getHtml('Tasks'); ?>
</select>
<td><input type="text" id="iProgress" name="progress" value="<?= $project->getProgress(); ?>"<?= $project->getProgressType() !== \Modules\ProjectManagement\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\ProjectManagement\tests\Admin;
class AdminTest extends \PHPUnit\Framework\TestCase
{
protected const MODULE_NAME = 'ProjectManagement';
protected const URI_LOAD = '';
use \Modules\tests\ModuleTestTrait;