Compare commits

..

1 Commits

6 changed files with 56 additions and 45 deletions

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

@@ -1,6 +0,0 @@
kind: UX
body: Change the order of display for results and objectives in the social work/action form
time: 2025-11-03T13:15:54.837971477+01:00
custom:
Issue: "455"
SchemaChange: No schema change

View File

@@ -14,7 +14,7 @@
"ext-openssl": "*",
"ext-redis": "*",
"ext-zlib": "*",
"champs-libres/wopi-bundle": "dev-master#1be045ee95310d2037683859ecefdbf3a10f7be6 as 0.4.x-dev",
"champs-libres/wopi-bundle": "dev-master@dev",
"champs-libres/wopi-lib": "dev-master@dev",
"doctrine/data-fixtures": "^1.8",
"doctrine/doctrine-bundle": "^2.1",

View File

@@ -52,6 +52,30 @@
</div>
</div>
<!-- results which are not attached to an objective -->
<div v-if="hasResultsForAction">
<div class="results_without_objective">
{{ $t("results_without_objective") }}
</div>
<div>
<add-result
:availableResults="resultsForAction"
destination="action"
></add-result>
</div>
</div>
<!-- results which **are** attached to an objective -->
<div v-for="g in goalsPicked" :key="g.goal.id">
<div class="item-title" @click="removeGoal(g)">
<span class="removable">{{
localizeString(g.goal.title)
}}</span>
</div>
<div>
<add-result :goal="g.goal" destination="goal"></add-result>
</div>
</div>
<div class="accordion" id="expandedSuggestions">
<div
v-if="availableForCheckGoal.length > 0"
@@ -114,31 +138,6 @@
}}</span>
</div>
</div>
<!-- results which are not attached to an objective -->
<div v-if="hasResultsForAction">
<div class="results_without_objective">
{{ $t("results_without_objective") }}
</div>
<div>
<add-result
:availableResults="resultsForAction"
destination="action"
></add-result>
</div>
</div>
<!-- results which **are** attached to an objective -->
<div v-for="g in goalsPicked" :key="g.goal.id">
<div class="item-title" @click="removeGoal(g)">
<span class="removable">{{
localizeString(g.goal.title)
}}</span>
</div>
<div>
<add-result :goal="g.goal" destination="goal"></add-result>
</div>
</div>
</div>
<div id="evaluations" class="action-row">

View File

@@ -60,7 +60,6 @@ import {
EVALUATION_DOCUMENT_MOVE_SUCCESS,
} from "translator";
import { useToast } from "vue-toast-notification";
import { buildLinkCreate as buildLinkCreateNotification } from "ChillMainAssets/lib/entity-notification/api";
const props = defineProps(["evaluation", "docAnchorId"]);
const store = useStore();

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));
}
}
}