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:06 +00:00
parent c979546b15
commit 5611db45d6
8 changed files with 30 additions and 30 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,7 +20,7 @@ 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\FloatInt;
/** /**
* Promotion class. * Promotion class.
@ -38,7 +38,7 @@ class Promotion
* @var int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected int $id = 0; public int $id = 0;
/** /**
* Event start. * Event start.
@ -83,34 +83,34 @@ class Promotion
/** /**
* Budget costs. * Budget costs.
* *
* @var Money * @var FloatInt
* @since 1.0.0 * @since 1.0.0
*/ */
public Money $budgetCosts; public FloatInt $budgetCosts;
/** /**
* Budget earnings. * Budget earnings.
* *
* @var Money * @var FloatInt
* @since 1.0.0 * @since 1.0.0
*/ */
public Money $budgetEarnings; public FloatInt $budgetEarnings;
/** /**
* Current total costs. * Current total costs.
* *
* @var Money * @var FloatInt
* @since 1.0.0 * @since 1.0.0
*/ */
public Money $actualCosts; public FloatInt $actualCosts;
/** /**
* Current total earnings. * Current total earnings.
* *
* @var Money * @var FloatInt
* @since 1.0.0 * @since 1.0.0
*/ */
public Money $actualEarnings; public FloatInt $actualEarnings;
/** /**
* Tasks. * Tasks.
@ -188,10 +188,10 @@ class Promotion
$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->actualCosts = new Money(); $this->actualCosts = new FloatInt();
$this->actualEarnings = new Money(); $this->actualEarnings = new FloatInt();
$this->budgetCosts = new Money(); $this->budgetCosts = new FloatInt();
$this->budgetEarnings = new Money(); $this->budgetEarnings = 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 PromotionAttribute implements \JsonSerializable
* @var int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected int $id = 0; public int $id = 0;
/** /**
* Promotion this attribute belongs to * Promotion this attribute belongs to

View File

@ -33,7 +33,7 @@ class PromotionAttributeType 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 PromotionAttributeValue 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('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('marketing/promotion/profile?{?}&id=' . $value->getId()); ?> $url = \phpOMS\Uri\UriFactory::build('marketing/promotion/profile?{?}&id=' . $value->id); ?>
<tr tabindex="0" data-href="<?= $url; ?>"> <tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a> <td data-label="<?= $this->getHtml('Title'); ?>"><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

@ -21,7 +21,7 @@ use Modules\Marketing\Models\PromotionMapper;
use Modules\Media\Models\Media; use Modules\Media\Models\Media;
use Modules\Tasks\Models\Task; use Modules\Tasks\Models\Task;
use phpOMS\DataStorage\Database\Query\OrderType; use phpOMS\DataStorage\Database\Query\OrderType;
use phpOMS\Localization\Money; use phpOMS\Stdlib\Base\FloatInt;
/** /**
* @internal * @internal
@ -42,7 +42,7 @@ final class PromotionMapperTest extends \PHPUnit\Framework\TestCase
$promotion->start = new \DateTime('2000-05-05'); $promotion->start = new \DateTime('2000-05-05');
$promotion->end = new \DateTime('2005-05-05'); $promotion->end = new \DateTime('2005-05-05');
$money = new Money(); $money = new FloatInt();
$money->setString('1.23'); $money->setString('1.23');
$promotion->budgetCosts = $money; $promotion->budgetCosts = $money;
@ -74,13 +74,13 @@ final class PromotionMapperTest extends \PHPUnit\Framework\TestCase
$promotion->addMedia($media); $promotion->addMedia($media);
$id = PromotionMapper::create()->execute($promotion); $id = PromotionMapper::create()->execute($promotion);
self::assertGreaterThan(0, $promotion->getId()); self::assertGreaterThan(0, $promotion->id);
self::assertEquals($id, $promotion->getId()); self::assertEquals($id, $promotion->id);
$promotionR = PromotionMapper::get() $promotionR = PromotionMapper::get()
->with('tasks') ->with('tasks')
->with('media') ->with('media')
->where('id', $promotion->getId())->execute(); ->where('id', $promotion->id)->execute();
self::assertEquals($promotion->name, $promotionR->name); self::assertEquals($promotion->name, $promotionR->name);
self::assertEquals($promotion->description, $promotionR->description); self::assertEquals($promotion->description, $promotionR->description);

View File

@ -18,7 +18,7 @@ use Modules\Marketing\Models\ProgressType;
use Modules\Marketing\Models\Promotion; use Modules\Marketing\Models\Promotion;
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
@ -41,7 +41,7 @@ final class PromotionTest extends \PHPUnit\Framework\TestCase
*/ */
public function testDefault() : void public function testDefault() : void
{ {
self::assertEquals(0, $this->promotion->getId()); self::assertEquals(0, $this->promotion->id);
self::assertInstanceOf('\Modules\Calendar\Models\Calendar', $this->promotion->calendar); self::assertInstanceOf('\Modules\Calendar\Models\Calendar', $this->promotion->calendar);
self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->promotion->start->format('Y-m-d')); self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->promotion->start->format('Y-m-d'));
self::assertEquals((new \DateTime('now'))->modify('+1 month')->format('Y-m-d'), $this->promotion->end->format('Y-m-d')); self::assertEquals((new \DateTime('now'))->modify('+1 month')->format('Y-m-d'), $this->promotion->end->format('Y-m-d'));
@ -130,10 +130,10 @@ final class PromotionTest extends \PHPUnit\Framework\TestCase
'end' => $this->promotion->end, 'end' => $this->promotion->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,