Release 2.34 (#5465)

* fix timing issue in timesheet edit form with deactivated rounding
* bump packages
* only show update messages for newer plugin versions
* replace deprecated method
* remove internal from API
* remove technical terms from translation
* prevent calls to internal symfony methods
* helper method to flag entry as modified
* support meta-fields in weekly-hourse view
* fix running timesheets were deleted in weekly-hourse
This commit is contained in:
Kevin Papst
2025-05-09 14:22:47 +02:00
committed by GitHub
parent 452a8d9390
commit dfd97fd6f3
35 changed files with 428 additions and 362 deletions

View File

@@ -10,9 +10,12 @@
namespace App\Model;
use App\Entity\Activity;
use App\Entity\MetaTableTypeInterface;
use App\Entity\Project;
use App\Entity\Timesheet;
use App\Entity\User;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
/**
* @internal
@@ -24,9 +27,18 @@ class QuickEntryModel
* @var Timesheet[]
*/
private array $timesheets = [];
/**
* @var Collection<int, MetaTableTypeInterface>
*/
private Collection $metaFields;
public function __construct(private User $user, private ?Project $project = null, private ?Activity $activity = null)
public function __construct(
private readonly User $user,
private ?Project $project = null,
private ?Activity $activity = null
)
{
$this->metaFields = new ArrayCollection();
}
public function markAsPrototype(): void
@@ -184,4 +196,36 @@ class QuickEntryModel
$this->timesheets[] = clone $record;
}
}
/**
* @return Collection<int, MetaTableTypeInterface>
*/
public function getMetaFields(): Collection
{
return $this->metaFields;
}
public function setMetaFieldValue(MetaTableTypeInterface $metaField): void
{
// we only update the value for fields which were previously registered
// as we do NOT want new fields to show up by accident
foreach ($this->metaFields as $field) {
if ($field->getName() === $metaField->getName() && $metaField->getValue() !== null) {
$field->setValue($metaField->getValue());
break;
}
}
}
/**
* @param array<MetaTableTypeInterface> $metaFields
*/
public function setMetaFields(array $metaFields): void
{
$collection = new ArrayCollection();
foreach($metaFields as $field) {
$collection->add(clone $field);
}
$this->metaFields = $collection;
}
}

View File

@@ -23,7 +23,7 @@ class QuickEntryWeek
*/
private array $rows = [];
public function __construct(private \DateTime $startDate)
public function __construct(private readonly \DateTime $startDate)
{
}
@@ -79,7 +79,7 @@ class QuickEntryWeek
$result = strcmp((string) $aName, (string) $bName);
}
return $result < 0 ? -1 : 1;
return $result < 0 ? -1 : 1;
}
/**

View File

@@ -9,9 +9,6 @@
namespace App\Model;
/**
* @internal
*/
class TimesheetCountedStatistic implements \JsonSerializable
{
private int $counter = 0;
@@ -34,8 +31,6 @@ class TimesheetCountedStatistic implements \JsonSerializable
/**
* For unified access, used in frontend.
*
* @return int
*/
public function getCounter(): int
{
@@ -84,8 +79,6 @@ class TimesheetCountedStatistic implements \JsonSerializable
/**
* For unified access, used in frontend.
*
* @return int
*/
public function getValue(): int
{
@@ -104,8 +97,6 @@ class TimesheetCountedStatistic implements \JsonSerializable
/**
* For unified access, used in frontend.
*
* @return int
*/
public function getDuration(): int
{
@@ -114,8 +105,6 @@ class TimesheetCountedStatistic implements \JsonSerializable
/**
* For unified access, used in frontend.
*
* @return float
*/
public function getRate(): float
{
@@ -134,8 +123,6 @@ class TimesheetCountedStatistic implements \JsonSerializable
/**
* Returns the total internal rate of all included timesheet records.
*
* @return float
*/
public function getInternalRate(): float
{