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 9cfbec431e
commit 96ac32726c
8 changed files with 32 additions and 32 deletions

View File

@ -19,7 +19,7 @@ use Modules\Admin\Models\NullAccount;
use Modules\Calendar\Models\Calendar; use Modules\Calendar\Models\Calendar;
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;
/** /**
* Project class. * Project class.
@ -37,7 +37,7 @@ class Project
* @var int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected int $id = 0; public int $id = 0;
/** /**
* Start date. * Start date.
@ -98,34 +98,34 @@ class Project
/** /**
* 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;
/** /**
* Progress percentage. * Progress percentage.
@ -202,10 +202,10 @@ class Project
$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->setName($name); $this->setName($name);
} }

View File

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

View File

@ -33,7 +33,7 @@ class ProjectAttributeType 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 ProjectAttributeValue 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('projectmanagement/profile?{?}&id=' . $value->getId()); ?> $url = \phpOMS\Uri\UriFactory::build('projectmanagement/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

@ -37,6 +37,6 @@ final class NullProjectTest extends \PHPUnit\Framework\TestCase
public function testId() : void public function testId() : void
{ {
$null = new NullProject(2); $null = new NullProject(2);
self::assertEquals(2, $null->getId()); self::assertEquals(2, $null->id);
} }
} }

View File

@ -21,7 +21,7 @@ use Modules\ProjectManagement\Models\Project;
use Modules\ProjectManagement\Models\ProjectMapper; use Modules\ProjectManagement\Models\ProjectMapper;
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 ProjectMapperTest extends \PHPUnit\Framework\TestCase
$project->start = new \DateTime('2000-05-05'); $project->start = new \DateTime('2000-05-05');
$project->end = new \DateTime('2005-05-05'); $project->end = new \DateTime('2005-05-05');
$money = new Money(); $money = new FloatInt();
$money->setString('1.23'); $money->setString('1.23');
$project->budgetCosts = $money; $project->budgetCosts = $money;
@ -74,10 +74,10 @@ final class ProjectMapperTest extends \PHPUnit\Framework\TestCase
$project->addMedia($media); $project->addMedia($media);
$id = ProjectMapper::create()->execute($project); $id = ProjectMapper::create()->execute($project);
self::assertGreaterThan(0, $project->getId()); self::assertGreaterThan(0, $project->id);
self::assertEquals($id, $project->getId()); self::assertEquals($id, $project->id);
$projectR = ProjectMapper::get()->with('media')->where('id', $project->getId())->execute(); $projectR = ProjectMapper::get()->with('media')->where('id', $project->id)->execute();
self::assertEquals($project->getName(), $projectR->getName()); self::assertEquals($project->getName(), $projectR->getName());
self::assertEquals($project->description, $projectR->description); self::assertEquals($project->description, $projectR->description);

View File

@ -19,7 +19,7 @@ use Modules\Media\Models\Media;
use Modules\ProjectManagement\Models\ProgressType; use Modules\ProjectManagement\Models\ProgressType;
use Modules\ProjectManagement\Models\Project; use Modules\ProjectManagement\Models\Project;
use Modules\Tasks\Models\Task; use Modules\Tasks\Models\Task;
use phpOMS\Localization\Money; use phpOMS\Stdlib\Base\FloatInt;
/** /**
* @internal * @internal
@ -42,12 +42,12 @@ final class ProjectTest extends \PHPUnit\Framework\TestCase
*/ */
public function testDefault() : void public function testDefault() : void
{ {
self::assertEquals(0, $this->project->getId()); self::assertEquals(0, $this->project->id);
self::assertInstanceOf('\Modules\Calendar\Models\Calendar', $this->project->calendar); self::assertInstanceOf('\Modules\Calendar\Models\Calendar', $this->project->calendar);
self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->project->createdAt->format('Y-m-d')); self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->project->createdAt->format('Y-m-d'));
self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->project->start->format('Y-m-d')); self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->project->start->format('Y-m-d'));
self::assertEquals((new \DateTime('now'))->modify('+1 month')->format('Y-m-d'), $this->project->end->format('Y-m-d')); self::assertEquals((new \DateTime('now'))->modify('+1 month')->format('Y-m-d'), $this->project->end->format('Y-m-d'));
self::assertEquals(0, $this->project->createdBy->getId()); self::assertEquals(0, $this->project->createdBy->id);
self::assertEquals('', $this->project->getName()); self::assertEquals('', $this->project->getName());
self::assertEquals('', $this->project->description); self::assertEquals('', $this->project->description);
self::assertEquals(0, $this->project->budgetCosts->getInt()); self::assertEquals(0, $this->project->budgetCosts->getInt());
@ -69,7 +69,7 @@ final class ProjectTest extends \PHPUnit\Framework\TestCase
public function testCreatedByInputOutput() : void public function testCreatedByInputOutput() : void
{ {
$this->project->createdBy = new NullAccount(1); $this->project->createdBy = new NullAccount(1);
self::assertEquals(1, $this->project->createdBy->getId()); self::assertEquals(1, $this->project->createdBy->id);
} }
/** /**
@ -179,10 +179,10 @@ final class ProjectTest extends \PHPUnit\Framework\TestCase
'end' => $this->project->end, 'end' => $this->project->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,