small bugfixes (#2655)

* improve report visibility
* fix timesheet duration, which breaks validation
* added contributing section in README
* do not allow to change project for existing activities - fixes #2576
* bump theme version to fix FOSUserBundle dependency
* use entity color instead of inherited one - fixes #2200
This commit is contained in:
Kevin Papst
2021-07-10 00:37:03 +02:00
committed by GitHub
parent 9ddb87a6fd
commit 2583fdf20e
17 changed files with 101 additions and 121 deletions

View File

@@ -411,6 +411,11 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
*/
public function getDuration(): ?int
{
// only auto calculate if manually set duration is null - the result is important for eg. validations
if ($this->duration === null && $this->begin !== null && $this->end !== null) {
return $this->end->getTimestamp() - $this->begin->getTimestamp();
}
return $this->duration;
}