make id public, organigram impl. media password/encryption, settings bug fix, Money->FloatInt change, ...

This commit is contained in:
Dennis Eichhorn 2023-05-06 11:42:05 +00:00
parent 34b8afe57a
commit 7e1537f393
8 changed files with 29 additions and 29 deletions

View File

@ -33,7 +33,7 @@ class AccountRelation
* @var int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected int $id = 0; public int $id = 0;
/** /**
* Promotion * Promotion

View File

@ -20,8 +20,8 @@ use Modules\Calendar\Models\Calendar;
use Modules\Media\Models\Media; use Modules\Media\Models\Media;
use Modules\Tasks\Models\NullTask; use Modules\Tasks\Models\NullTask;
use Modules\Tasks\Models\Task; use Modules\Tasks\Models\Task;
use phpOMS\Localization\Money;
use phpOMS\Stdlib\Base\Exception\InvalidEnumValue; use phpOMS\Stdlib\Base\Exception\InvalidEnumValue;
use phpOMS\Stdlib\Base\FloatInt;
/** /**
* Event class. * Event class.
@ -39,7 +39,7 @@ class Event
* @var int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected int $id = 0; public int $id = 0;
/** /**
* Type. * Type.
@ -47,7 +47,7 @@ class Event
* @var int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
private int $type = EventType::DEFAULT; public int $type = EventType::DEFAULT;
/** /**
* Event start. * Event start.
@ -92,34 +92,34 @@ class Event
/** /**
* Costs. * Costs.
* *
* @var Money * @var FloatInt
* @since 1.0.0 * @since 1.0.0
*/ */
public Money $budgetCosts; public FloatInt $budgetCosts;
/** /**
* Earnings. * Earnings.
* *
* @var Money * @var FloatInt
* @since 1.0.0 * @since 1.0.0
*/ */
public Money $budgetEarnings; public FloatInt $budgetEarnings;
/** /**
* Costs. * Costs.
* *
* @var Money * @var FloatInt
* @since 1.0.0 * @since 1.0.0
*/ */
public Money $actualCosts; public FloatInt $actualCosts;
/** /**
* Earnings. * Earnings.
* *
* @var Money * @var FloatInt
* @since 1.0.0 * @since 1.0.0
*/ */
public Money $actualEarnings; public FloatInt $actualEarnings;
/** /**
* Tasks. * Tasks.
@ -197,10 +197,10 @@ class Event
$this->start = new \DateTime('now'); $this->start = new \DateTime('now');
$this->end = (new \DateTime('now'))->modify('+1 month'); $this->end = (new \DateTime('now'))->modify('+1 month');
$this->calendar = new Calendar(); $this->calendar = new Calendar();
$this->budgetCosts = new Money(); $this->budgetCosts = new FloatInt();
$this->budgetEarnings = new Money(); $this->budgetEarnings = new FloatInt();
$this->actualCosts = new Money(); $this->actualCosts = new FloatInt();
$this->actualEarnings = new Money(); $this->actualEarnings = new FloatInt();
$this->createdAt = new \DateTimeImmutable('now'); $this->createdAt = new \DateTimeImmutable('now');
$this->createdBy = new NullAccount(); $this->createdBy = new NullAccount();

View File

@ -30,7 +30,7 @@ class EventAttribute implements \JsonSerializable
* @var int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected int $id = 0; public int $id = 0;
/** /**
* Event this attribute belongs to * Event this attribute belongs to

View File

@ -34,7 +34,7 @@ class EventAttributeType implements \JsonSerializable
* @var int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected int $id = 0; public int $id = 0;
/** /**
* Name/string identifier by which it can be found/categorized * Name/string identifier by which it can be found/categorized

View File

@ -36,7 +36,7 @@ class EventAttributeValue implements \JsonSerializable
* @var int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected int $id = 0; public int $id = 0;
/** /**
* Depending attribute type * Depending attribute type

View File

@ -34,7 +34,7 @@ echo $this->getData('nav')->render(); ?>
<td><?= $this->getHtml('End'); ?> <td><?= $this->getHtml('End'); ?>
<tbody> <tbody>
<?php $count = 0; foreach ($events as $key => $value) : ++$count; <?php $count = 0; foreach ($events as $key => $value) : ++$count;
$url = \phpOMS\Uri\UriFactory::build('eventmanagement/profile?{?}&id=' . $value->getId()); ?> $url = \phpOMS\Uri\UriFactory::build('eventmanagement/profile?{?}&id=' . $value->id); ?>
<tr tabindex="0" data-href="<?= $url; ?>"> <tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a> <td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></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>

View File

@ -76,10 +76,10 @@ final class EventMapperTest extends \PHPUnit\Framework\TestCase
$event->addMedia($media); $event->addMedia($media);
$id = EventMapper::create()->execute($event); $id = EventMapper::create()->execute($event);
self::assertGreaterThan(0, $event->getId()); self::assertGreaterThan(0, $event->id);
self::assertEquals($id, $event->getId()); self::assertEquals($id, $event->id);
$eventR = EventMapper::get()->with('tasks')->with('media')->where('id', $event->getId())->execute(); $eventR = EventMapper::get()->with('tasks')->with('media')->where('id', $event->id)->execute();
self::assertEquals($event->name, $eventR->name); self::assertEquals($event->name, $eventR->name);
self::assertEquals($event->description, $eventR->description); self::assertEquals($event->description, $eventR->description);

View File

@ -19,7 +19,7 @@ use Modules\EventManagement\Models\EventType;
use Modules\EventManagement\Models\ProgressType; use Modules\EventManagement\Models\ProgressType;
use Modules\Media\Models\Media; use Modules\Media\Models\Media;
use Modules\Tasks\Models\Task; use Modules\Tasks\Models\Task;
use phpOMS\Localization\Money; use phpOMS\Stdlib\Base\FloatInt;
/** /**
* @internal * @internal
@ -42,7 +42,7 @@ final class EventTest extends \PHPUnit\Framework\TestCase
*/ */
public function testDefault() : void public function testDefault() : void
{ {
self::assertEquals(0, $this->event->getId()); self::assertEquals(0, $this->event->id);
self::assertEquals(EventType::DEFAULT, $this->event->getType()); self::assertEquals(EventType::DEFAULT, $this->event->getType());
self::assertInstanceOf('\Modules\Calendar\Models\Calendar', $this->event->calendar); self::assertInstanceOf('\Modules\Calendar\Models\Calendar', $this->event->calendar);
self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->event->start->format('Y-m-d')); self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->event->start->format('Y-m-d'));
@ -154,10 +154,10 @@ final class EventTest extends \PHPUnit\Framework\TestCase
'end' => $this->event->end, 'end' => $this->event->end,
'name' => 'Name', 'name' => 'Name',
'description' => 'Description', 'description' => 'Description',
'budgetCosts' => new Money(), 'budgetCosts' => new FloatInt(),
'budgetEarnings' => new Money(), 'budgetEarnings' => new FloatInt(),
'actualCosts' => new Money(), 'actualCosts' => new FloatInt(),
'actualEarnings' => new Money(), 'actualEarnings' => new FloatInt(),
'tasks' => [], 'tasks' => [],
'media' => [], 'media' => [],
'progress' => 10, 'progress' => 10,