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
* @since 1.0.0
*/
protected int $id = 0;
public int $id = 0;
/**
* Promotion

View File

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

View File

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

View File

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

View File

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

View File

@ -34,7 +34,7 @@ echo $this->getData('nav')->render(); ?>
<td><?= $this->getHtml('End'); ?>
<tbody>
<?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; ?>">
<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>

View File

@ -76,10 +76,10 @@ final class EventMapperTest extends \PHPUnit\Framework\TestCase
$event->addMedia($media);
$id = EventMapper::create()->execute($event);
self::assertGreaterThan(0, $event->getId());
self::assertEquals($id, $event->getId());
self::assertGreaterThan(0, $event->id);
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->description, $eventR->description);

View File

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