Compare commits

..

1 Commits

4 changed files with 33 additions and 29 deletions

View File

@@ -1,6 +0,0 @@
kind: Fixed
body: 'Fix: display also social actions linked to parents of the selected social issue'
time: 2025-10-29T12:43:55.008647232+01:00
custom:
Issue: "451"
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: Fixed
body: 'Fix: export actions and their results in csv even when action does not have any goals attached to it.'
time: 2025-10-29T14:38:36.195220844+01:00
custom:
Issue: "453"
SchemaChange: No schema change

View File

@@ -239,22 +239,13 @@ class SocialIssue
}
/**
* @return Collection<SocialAction> All the social actions of the entity, it's
* the descendants and it's parents
* @return Collection<SocialAction> All the descendant social actions of all
* the descendants of the entity
*/
public function getRecursiveSocialActions(): Collection
{
$recursiveSocialActions = new ArrayCollection();
// Get social actions from parent issues
foreach ($this->getAncestors(false) as $ancestor) {
foreach ($ancestor->getDescendantsSocialActions() as $descendant) {
if (!$recursiveSocialActions->contains($descendant)) {
$recursiveSocialActions->add($descendant);
}
}
}
foreach ($this->getDescendantsWithThis() as $socialIssue) {
foreach ($socialIssue->getDescendantsSocialActions() as $descendant) {
if (!$recursiveSocialActions->contains($descendant)) {

View File

@@ -42,28 +42,41 @@ final readonly class SocialActionCSVExportService
$csv->insertOne($headers);
foreach ($actions as $action) {
if ($action->getGoals()->isEmpty() && $action->getResults()->isEmpty() && $action->getEvaluations()->isEmpty()) {
$hasGoals = !$action->getGoals()->isEmpty();
$hasResults = !$action->getResults()->isEmpty();
$hasEvaluations = !$action->getEvaluations()->isEmpty();
// If action has no goals, results, or evaluations, insert a single row
if (!$hasGoals && !$hasResults && !$hasEvaluations) {
$csv->insertOne($this->formatRow($action));
continue;
}
foreach ($action->getGoals() as $goal) {
if ($goal->getResults()->isEmpty()) {
$csv->insertOne($this->formatRow($action, $goal));
}
foreach ($goal->getResults() as $goalResult) {
$csv->insertOne($this->formatRow($action, $goal, $goalResult));
// Process goals and their results
if ($hasGoals) {
foreach ($action->getGoals() as $goal) {
if ($goal->getResults()->isEmpty()) {
$csv->insertOne($this->formatRow($action, $goal));
} else {
foreach ($goal->getResults() as $goalResult) {
$csv->insertOne($this->formatRow($action, $goal, $goalResult));
}
}
}
}
foreach ($action->getResults() as $result) {
if ($result->getGoals()->isEmpty()) {
// Process results that are linked to this action (regardless of whether they have goals elsewhere)
if ($hasResults && !$hasGoals) {
foreach ($action->getResults() as $result) {
$csv->insertOne($this->formatRow($action, null, null, $result));
}
}
foreach ($action->getEvaluations() as $evaluation) {
$csv->insertOne($this->formatRow($action, evaluation: $evaluation));
// Process evaluations
if ($hasEvaluations) {
foreach ($action->getEvaluations() as $evaluation) {
$csv->insertOne($this->formatRow($action, evaluation: $evaluation));
}
}
}