mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix SocialWorkTypeFilter: allow null value in date, and avoid vuejs module ExportFormActionGoal to override the export form content
This commit is contained in:
parent
eb01c7c203
commit
947b7b90e2
5
.changes/unreleased/Fixed-20231123-144502.yaml
Normal file
5
.changes/unreleased/Fixed-20231123-144502.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
kind: Fixed
|
||||
body: 'Export: fix the list of accompanying period work, when the "calc date" is null'
|
||||
time: 2023-11-23T14:45:02.839510554+01:00
|
||||
custom:
|
||||
Issue: "219"
|
@ -206,6 +206,7 @@ class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod implements L
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||
$calcDate = $data['calc_date'] ?? new RollingDate(RollingDate::T_TODAY);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
|
||||
@ -220,7 +221,7 @@ class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod implements L
|
||||
->andWhere('acppart.startDate != acppart.endDate OR acppart.endDate IS NULL')
|
||||
// get participants at the given date
|
||||
->andWhere('acppart.startDate <= :calc_date AND (acppart.endDate > :calc_date OR acppart.endDate IS NULL)')
|
||||
->setParameter('calc_date', $this->rollingDateConverter->convert($data['calc_date']));
|
||||
->setParameter('calc_date', $this->rollingDateConverter->convert($calcDate));
|
||||
|
||||
if ($this->filterStatsByCenters) {
|
||||
$qb
|
||||
@ -236,7 +237,7 @@ class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod implements L
|
||||
|
||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
||||
|
||||
$this->addSelectClauses($qb, $this->rollingDateConverter->convert($data['calc_date']));
|
||||
$this->addSelectClauses($qb, $this->rollingDateConverter->convert($calcDate));
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
@ -206,6 +206,7 @@ class ListAccompanyingPeriodWorkAssociatePersonOnWork implements ListInterface,
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||
$calcDate = $data['calc_date'] ?? new RollingDate(RollingDate::T_TODAY);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
|
||||
@ -231,7 +232,7 @@ class ListAccompanyingPeriodWorkAssociatePersonOnWork implements ListInterface,
|
||||
|
||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
||||
|
||||
$this->addSelectClauses($qb, $this->rollingDateConverter->convert($data['calc_date']));
|
||||
$this->addSelectClauses($qb, $this->rollingDateConverter->convert($calcDate));
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
@ -144,6 +144,9 @@ class SocialWorkTypeFilter implements FilterInterface
|
||||
$ids = [];
|
||||
|
||||
foreach ($asIterable as $value) {
|
||||
if (null === $value) {
|
||||
continue;
|
||||
}
|
||||
$ids[] = $value->getId();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<teleport to="#export_filters_social_work_type_filter_form">
|
||||
|
||||
<fieldset class="mb-3" id="actionType">
|
||||
<div class="row">
|
||||
@ -68,8 +67,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -4,11 +4,13 @@ import App from './App.vue';
|
||||
|
||||
if (null !== document.getElementById('export_filters_social_work_type_filter_enabled')) {
|
||||
const i18n = _createI18n({});
|
||||
const form = document.getElementById('export_filters_social_work_type_filter_form');
|
||||
const after = form.appendChild(document.createElement('div'));
|
||||
|
||||
const app = createApp({
|
||||
template: `<app></app>`,
|
||||
})
|
||||
.use(i18n)
|
||||
.component('app', App)
|
||||
.mount('#export_export');
|
||||
.mount(after);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user