mirror of
https://github.com/Karaka-Management/oms-ProjectManagement.git
synced 2026-01-23 21:18:40 +00:00
make id public, organigram impl. media password/encryption, settings bug fix, Money->FloatInt change, ...
This commit is contained in:
parent
9cfbec431e
commit
96ac32726c
|
|
@ -19,7 +19,7 @@ use Modules\Admin\Models\NullAccount;
|
|||
use Modules\Calendar\Models\Calendar;
|
||||
use Modules\Media\Models\Media;
|
||||
use Modules\Tasks\Models\Task;
|
||||
use phpOMS\Localization\Money;
|
||||
use phpOMS\Stdlib\Base\FloatInt;
|
||||
|
||||
/**
|
||||
* Project class.
|
||||
|
|
@ -37,7 +37,7 @@ class Project
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected int $id = 0;
|
||||
public int $id = 0;
|
||||
|
||||
/**
|
||||
* Start date.
|
||||
|
|
@ -98,34 +98,34 @@ class Project
|
|||
/**
|
||||
* Budget costs.
|
||||
*
|
||||
* @var Money
|
||||
* @var FloatInt
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public Money $budgetCosts;
|
||||
public FloatInt $budgetCosts;
|
||||
|
||||
/**
|
||||
* Budget earnings.
|
||||
*
|
||||
* @var Money
|
||||
* @var FloatInt
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public Money $budgetEarnings;
|
||||
public FloatInt $budgetEarnings;
|
||||
|
||||
/**
|
||||
* Current total costs.
|
||||
*
|
||||
* @var Money
|
||||
* @var FloatInt
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public Money $actualCosts;
|
||||
public FloatInt $actualCosts;
|
||||
|
||||
/**
|
||||
* Current total earnings.
|
||||
*
|
||||
* @var Money
|
||||
* @var FloatInt
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public Money $actualEarnings;
|
||||
public FloatInt $actualEarnings;
|
||||
|
||||
/**
|
||||
* Progress percentage.
|
||||
|
|
@ -202,10 +202,10 @@ class Project
|
|||
|
||||
$this->calendar = new Calendar();
|
||||
|
||||
$this->actualCosts = new Money();
|
||||
$this->actualEarnings = new Money();
|
||||
$this->budgetCosts = new Money();
|
||||
$this->budgetEarnings = new Money();
|
||||
$this->actualCosts = new FloatInt();
|
||||
$this->actualEarnings = new FloatInt();
|
||||
$this->budgetCosts = new FloatInt();
|
||||
$this->budgetEarnings = new FloatInt();
|
||||
|
||||
$this->setName($name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class ProjectAttribute implements \JsonSerializable
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected int $id = 0;
|
||||
public int $id = 0;
|
||||
|
||||
/**
|
||||
* Project this attribute belongs to
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class ProjectAttributeType 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
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class ProjectAttributeValue implements \JsonSerializable
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected int $id = 0;
|
||||
public int $id = 0;
|
||||
|
||||
/**
|
||||
* Depending attribute type
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<td><?= $this->getHtml('Due'); ?>
|
||||
<tbody>
|
||||
<?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; ?>">
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ final class NullProjectTest extends \PHPUnit\Framework\TestCase
|
|||
public function testId() : void
|
||||
{
|
||||
$null = new NullProject(2);
|
||||
self::assertEquals(2, $null->getId());
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use Modules\ProjectManagement\Models\Project;
|
|||
use Modules\ProjectManagement\Models\ProjectMapper;
|
||||
use Modules\Tasks\Models\Task;
|
||||
use phpOMS\DataStorage\Database\Query\OrderType;
|
||||
use phpOMS\Localization\Money;
|
||||
use phpOMS\Stdlib\Base\FloatInt;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
|
@ -42,7 +42,7 @@ final class ProjectMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$project->start = new \DateTime('2000-05-05');
|
||||
$project->end = new \DateTime('2005-05-05');
|
||||
|
||||
$money = new Money();
|
||||
$money = new FloatInt();
|
||||
$money->setString('1.23');
|
||||
|
||||
$project->budgetCosts = $money;
|
||||
|
|
@ -74,10 +74,10 @@ final class ProjectMapperTest extends \PHPUnit\Framework\TestCase
|
|||
$project->addMedia($media);
|
||||
|
||||
$id = ProjectMapper::create()->execute($project);
|
||||
self::assertGreaterThan(0, $project->getId());
|
||||
self::assertEquals($id, $project->getId());
|
||||
self::assertGreaterThan(0, $project->id);
|
||||
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->description, $projectR->description);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use Modules\Media\Models\Media;
|
|||
use Modules\ProjectManagement\Models\ProgressType;
|
||||
use Modules\ProjectManagement\Models\Project;
|
||||
use Modules\Tasks\Models\Task;
|
||||
use phpOMS\Localization\Money;
|
||||
use phpOMS\Stdlib\Base\FloatInt;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
|
@ -42,12 +42,12 @@ final class ProjectTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
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::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'))->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->description);
|
||||
self::assertEquals(0, $this->project->budgetCosts->getInt());
|
||||
|
|
@ -69,7 +69,7 @@ final class ProjectTest extends \PHPUnit\Framework\TestCase
|
|||
public function testCreatedByInputOutput() : void
|
||||
{
|
||||
$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,
|
||||
'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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user