Compare commits

..

3 Commits

18 changed files with 274 additions and 349 deletions

View File

@@ -0,0 +1,6 @@
kind: Fixed
body: Insert name of file as the document title when uploading
time: 2025-11-19T13:33:24.778116633+01:00
custom:
Issue: ""
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: Fixed
body: Add missing path paramater 'id' for editing multiple participations
time: 2025-11-19T13:48:02.078949572+01:00
custom:
Issue: ""
SchemaChange: No schema change

View File

@@ -1,6 +0,0 @@
kind: Fixed
body: Do not suggest a user that is no longer active in the activity form.
time: 2025-12-01T18:58:59.410998029+01:00
custom:
Issue: "475"
SchemaChange: No schema change

View File

@@ -0,0 +1,6 @@
kind: UX
body: Display whether doc generation template is active or not in admin and order templates alphabetically
time: 2025-11-03T16:19:10.051947925+01:00
custom:
Issue: "456"
SchemaChange: No schema change

View File

@@ -1,6 +0,0 @@
## v4.8.1 - 2025-11-20
### Fixed
* Insert name of file as the document title when uploading
* Add missing path paramater 'id' for editing multiple participations
* ([#471](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/471)) Hide the display of inactive user groups in the api

View File

@@ -1,10 +0,0 @@
## v4.8.2 - 2025-11-26
### Fixed
* ([#466](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/466)) Associate activity's creator as a participant by default, and retro-actively append the creator to each activity
**Schema Change**: Add columns or tables
* Fix template parameter for update_multiple route on event participations
### UX
* ([#470](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/470)) Alphabetically order userJobs and mainLocations within user creation form
* ([#437](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/437)) Change position and color of confirm parcours button

View File

@@ -6,22 +6,6 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie). and is generated by [Changie](https://github.com/miniscruff/changie).
## v4.8.2 - 2025-11-26
### Fixed
* ([#466](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/466)) Associate activity's creator as a participant by default, and retro-actively append the creator to each activity
**Schema Change**: Add columns or tables
* Fix template parameter for update_multiple route on event participations
### UX
* ([#470](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/470)) Alphabetically order userJobs and mainLocations within user creation form
* ([#437](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/437)) Change position and color of confirm parcours button
## v4.8.1 - 2025-11-20
### Fixed
* Insert name of file as the document title when uploading
* Add missing path paramater 'id' for editing multiple participations
* ([#471](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/471)) Hide the display of inactive user groups in the api
## v4.8.0 - 2025-11-17 ## v4.8.0 - 2025-11-17
### Feature ### Feature
* ([#461](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/461)) Make a calendar item on the 'mes rendez-vous' page clickable. Clicking will navigate to the edit page of the calendar item. * ([#461](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/461)) Make a calendar item on the 'mes rendez-vous' page clickable. Clicking will navigate to the edit page of the calendar item.

View File

@@ -382,7 +382,6 @@ final class ActivityController extends AbstractController
$entity = new Activity(); $entity = new Activity();
$entity->setUser($this->security->getUser()); $entity->setUser($this->security->getUser());
$entity->addUser($this->security->getUser());
if ($person instanceof Person) { if ($person instanceof Person) {
$entity->setPerson($person); $entity->setPerson($person);

View File

@@ -103,7 +103,7 @@ const store = createStore({
} }
// console.log("suggested users", suggestedUsers); // console.log("suggested users", suggestedUsers);
return suggestedUsers.filter((u) => u.enabled === true); return suggestedUsers;
}, },
suggestedResources(state) { suggestedResources(state) {
// const resources = state.activity.accompanyingPeriod.resources; // const resources = state.activity.accompanyingPeriod.resources;

View File

@@ -1,50 +0,0 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\Migrations\Activity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Migration fixing the automatic association of users to activities (exchanges).
*
* Originally, the user who created an exchange was not automatically associated
* to it (the "TMS" column), which led to incomplete data and biased statistics.
*
* This migration:
* - retroactively associates the creator of each exchange to the corresponding
* activity;
* - flags these backfilled associations with a temporary column so it is clear
* they were added by this data correction and can be safely cleaned up later.
*/
final class Version20251118124241 extends AbstractMigration
{
public function getDescription(): string
{
return 'Insert the creator of activity into the activity_user table';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE activity_user ADD COLUMN by_migration BOOL DEFAULT FALSE');
$this->addSql("COMMENT ON COLUMN activity_user.by_migration IS 'For backup purpose - can be safely deleted after a while. See migration \\Chill\\Migrations\\Activity\\Version20251118124241'");
$this->addSql('INSERT INTO activity_user (activity_id, user_id, by_migration)
SELECT id, user_id, true FROM activity
ON CONFLICT DO NOTHING');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE activity_user DROP COLUMN by_migration');
}
}

View File

@@ -87,7 +87,7 @@ class AdminDocGeneratorTemplateController extends CRUDController
*/ */
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{ {
return $query->addSelect('JSON_EXTRACT(e.name, :lang) AS HIDDEN name_lang') return $query->addSelect('REPLACE(JSON_EXTRACT(e.name, :lang), \' \', \'~\') AS HIDDEN name_lang')
->setParameter('lang', $request->getLocale()) ->setParameter('lang', $request->getLocale())
->addOrderBy('name_lang', 'ASC'); ->addOrderBy('name_lang', 'ASC');
} }

View File

@@ -25,12 +25,24 @@
<div class="item-bloc"> <div class="item-bloc">
<div class="item-row"> <div class="item-row">
<div class="item-col" style="flex-basis:100%;"> <div class="item-col" style="flex-basis:100%;">
<h2>{{ entity.name|localize_translatable_string }}</h2> <h2>{{ entity.name|localize_translatable_string }} </h2>
<p style="margin-left: 1rem;"><span class="badge bg-chill-gray">
{% if entity.active %}
{{ 'admin.active'|trans }}
{% else %}
{{ 'admin.not active'|trans }}
{% endif %}
</span></p>
</div> </div>
</div> </div>
<div class="item-row"> <div class="item-row">
<p><span class="badge bg-chill-green-dark">{{ contextManager.getContextByKey(entity.context).name|trans }}</span></p> <p><span class="badge bg-chill-green-dark">{{ contextManager.getContextByKey(entity.context).name|trans }}</span></p>
</div> </div>
{# <div class="item-row">#}
{# <div class="item-col" style="flex-basis:100%;">#}
{##}
{# </div>#}
{# </div>#}
<div class="item-row"> <div class="item-row">
<div class="item-col"></div> <div class="item-col"></div>
<ul class="record_actions item-col flex-shrink-1"> <ul class="record_actions item-col flex-shrink-1">

View File

@@ -49,3 +49,7 @@ crud:
Template file: Fichier modèle Template file: Fichier modèle
admin:
active: Actif
not active: Non-actif

View File

@@ -486,7 +486,7 @@ final class ParticipationController extends AbstractController
return $this->redirectToRoute( return $this->redirectToRoute(
'chill_event__event_show', 'chill_event__event_show',
['id' => $event->getId()] ['event_id' => $event->getId()]
); );
} }

View File

@@ -12,12 +12,5 @@ declare(strict_types=1);
namespace Chill\MainBundle\Controller; namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\ApiController; use Chill\MainBundle\CRUD\Controller\ApiController;
use Symfony\Component\HttpFoundation\Request;
class UserGroupApiController extends ApiController class UserGroupApiController extends ApiController {}
{
protected function customizeQuery(string $action, Request $request, $query): void
{
$query->andWhere('e.active = TRUE');
}
}

View File

@@ -18,7 +18,6 @@ use Chill\MainBundle\Entity\UserJob;
use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\ChillPhoneNumberType; use Chill\MainBundle\Form\Type\ChillPhoneNumberType;
use Chill\MainBundle\Form\Type\PickCivilityType; use Chill\MainBundle\Form\Type\PickCivilityType;
use Chill\MainBundle\Repository\UserJobRepository;
use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Bridge\Doctrine\Form\Type\EntityType;
@@ -37,7 +36,7 @@ use Symfony\Component\Validator\Constraints\Regex;
class UserType extends AbstractType class UserType extends AbstractType
{ {
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag, private readonly UserJobRepository $userJobRepository) {} public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {}
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
@@ -81,7 +80,12 @@ class UserType extends AbstractType
'placeholder' => 'choose a job', 'placeholder' => 'choose a job',
'class' => UserJob::class, 'class' => UserJob::class,
'choice_label' => fn (UserJob $c) => $this->translatableStringHelper->localize($c->getLabel()), 'choice_label' => fn (UserJob $c) => $this->translatableStringHelper->localize($c->getLabel()),
'choices' => $this->loadAndSortUserJobs(), 'query_builder' => static function (EntityRepository $er) {
$qb = $er->createQueryBuilder('uj');
$qb->where('uj.active = TRUE');
return $qb;
},
]) ])
->add('mainLocation', EntityType::class, [ ->add('mainLocation', EntityType::class, [
'label' => 'Main location', 'label' => 'Main location',
@@ -92,7 +96,6 @@ class UserType extends AbstractType
'query_builder' => static function (EntityRepository $er) { 'query_builder' => static function (EntityRepository $er) {
$qb = $er->createQueryBuilder('l'); $qb = $er->createQueryBuilder('l');
$qb->orderBy('l.locationType'); $qb->orderBy('l.locationType');
$qb->orderBy('l.name', 'ASC');
$qb->where('l.availableForUsers = TRUE'); $qb->where('l.availableForUsers = TRUE');
return $qb; return $qb;
@@ -152,20 +155,6 @@ class UserType extends AbstractType
} }
} }
private function loadAndSortUserJobs(): array
{
$items = $this->userJobRepository->findBy(['active' => true]);
usort(
$items,
fn ($a, $b) => mb_strtolower((string) $this->translatableStringHelper->localize($a->getLabel()))
<=>
mb_strtolower((string) $this->translatableStringHelper->localize($b->getLabel()))
);
return $items;
}
/** /**
* @param OptionsResolverInterface $resolver * @param OptionsResolverInterface $resolver
*/ */

View File

@@ -41,7 +41,6 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
'isAbsent' => false, 'isAbsent' => false,
'absenceStart' => null, 'absenceStart' => null,
'absenceEnd' => null, 'absenceEnd' => null,
'enabled' => true,
]; ];
public function __construct(private readonly UserRender $userRender, private readonly ClockInterface $clock) {} public function __construct(private readonly UserRender $userRender, private readonly ClockInterface $clock) {}
@@ -109,7 +108,6 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
'isAbsent' => $object->isAbsent(), 'isAbsent' => $object->isAbsent(),
'absenceStart' => $this->normalizer->normalize($object->getAbsenceStart(), $format, $absenceDatesContext), 'absenceStart' => $this->normalizer->normalize($object->getAbsenceStart(), $format, $absenceDatesContext),
'absenceEnd' => $this->normalizer->normalize($object->getAbsenceEnd(), $format, $absenceDatesContext), 'absenceEnd' => $this->normalizer->normalize($object->getAbsenceEnd(), $format, $absenceDatesContext),
'enabled' => $object->isEnabled(),
]; ];
if ('docgen' === $format) { if ('docgen' === $format) {

View File

@@ -20,16 +20,16 @@
</ul> </ul>
</div> </div>
<ul class="record_actions"> <ul class="record_actions">
<li>
<a class="btn btn-delete" :href="deleteLink">
{{ $t("confirm.delete") }}
</a>
</li>
<li> <li>
<button class="btn btn-save" disabled> <button class="btn btn-save" disabled>
{{ $t("confirm.ok") }} {{ $t("confirm.ok") }}
</button> </button>
</li> </li>
<li>
<a class="btn btn-delete" :href="deleteLink">
{{ $t("confirm.delete") }}
</a>
</li>
</ul> </ul>
</div> </div>
@@ -40,11 +40,6 @@
" "
/> />
<ul class="record_actions"> <ul class="record_actions">
<li>
<a class="btn btn-delete" :href="deleteLink">
{{ $t("confirm.delete") }}
</a>
</li>
<li> <li>
<button <button
class="btn btn-save" class="btn btn-save"
@@ -53,6 +48,11 @@
{{ $t("confirm.ok") }} {{ $t("confirm.ok") }}
</button> </button>
</li> </li>
<li>
<a class="btn btn-delete" :href="deleteLink">
{{ $t("confirm.delete") }}
</a>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@@ -112,7 +112,7 @@
</template> </template>
<template #footer> <template #footer>
<button <button
class="btn btn-save" class="btn btn-danger"
:disabled="disableConfirm" :disabled="disableConfirm"
@click="confirmCourse" @click="confirmCourse"
> >