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

@@ -49,7 +49,6 @@ use Symfony\Component\Validator\Constraints as Assert;
*
* @Exporter\Order({"id", "name", "project", "budget", "timeBudget", "color", "visible", "comment"})
* @Exporter\Expose("project", label="label.project", exp="object.getProject() === null ? null : object.getProject().getName()")
* @ Exporter\Expose("teams", label="label.team", exp="object.getTeams().toArray()", type="array")
*/
class Activity implements EntityWithMetaFields
{
@@ -368,7 +367,22 @@ class Activity implements EntityWithMetaFields
{
if ($this->id) {
$this->id = null;
$this->meta = new ArrayCollection();
}
$currentTeams = $this->teams;
$this->teams = new ArrayCollection();
/** @var Team $team */
foreach ($currentTeams as $team) {
$this->addTeam($team);
}
$currentMeta = $this->meta;
$this->meta = new ArrayCollection();
/** @var ProjectMeta $meta */
foreach ($currentMeta as $meta) {
$newMeta = clone $meta;
$newMeta->setEntity($this);
$this->setMetaField($newMeta);
}
}
}