added more columns to spreadsheet exports (#2413)

This commit is contained in:
Kevin Papst
2021-03-08 18:32:11 +01:00
committed by GitHub
parent 30ac5e4c24
commit 0b7d551048
13 changed files with 321 additions and 9 deletions

View File

@@ -166,8 +166,6 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
*/
private $user;
/**
* Activity
*
* @var Activity
*
* @Serializer\Expose()
@@ -180,8 +178,6 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
*/
private $activity;
/**
* Project
*
* @var Project
*
* @Serializer\Expose()
@@ -727,6 +723,13 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
$timesheet->setMetaField(clone $meta);
}
$timesheet->tags = new ArrayCollection();
/** @var Tag $tag */
foreach ($this->tags as $tag) {
$timesheet->addTag($tag);
}
return $timesheet;
}
@@ -734,7 +737,24 @@ class Timesheet implements EntityWithMetaFields, ExportItemInterface
{
if ($this->id) {
$this->id = null;
$this->exported = false;
}
$this->exported = false;
$currentMeta = $this->meta;
$this->meta = new ArrayCollection();
/** @var TimesheetMeta $meta */
foreach ($currentMeta as $meta) {
$newMeta = clone $meta;
$newMeta->setEntity($this);
$this->setMetaField($newMeta);
}
$currentTags = $this->tags;
$this->tags = new ArrayCollection();
/** @var Tag $tag */
foreach ($currentTags as $tag) {
$this->addTag($tag);
}
}
}